Skip to content

Commit e3ad465

Browse files
authored
Drop support for Google Cloud drive for backups (hestiacp#3205)
* Drop support for backup / restore from Google Cloud storage * Add notice for active users * Fix broken tests
1 parent 7e8f09d commit e3ad465

File tree

7 files changed

+11
-75
lines changed

7 files changed

+11
-75
lines changed

bin/v-backup-user

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,6 @@ for backup_type in $(echo -e "${BACKUP_SYSTEM//,/\\n}"); do
715715
local) local_backup ;;
716716
ftp) ftp_backup ;;
717717
sftp) sftp_backup ;;
718-
google) google_backup ;;
719718
b2) b2_backup ;;
720719
rclone) rclone_backup ;;
721720
esac

bin/v-import-cpanel

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -244,19 +244,6 @@ for folder in *; do
244244
done
245245
echo "All mail accounts restored"
246246

247-
cd ../ssl/
248-
mv ./keys/* ./certs/
249-
ls ./certs/
250-
251-
cat ssl.db
252-
domains=$(/usr/local/hestia/bin/v-list-web-domains $new_user plain | awk '{ print $1 }')
253-
254-
for domain in $domains; do
255-
if [ -e ./sslcerts/$domain.key ]; then
256-
v-add-web-domain-ssl $user $domain $(pwd)/sslcerts/
257-
fi
258-
done
259-
260247
rm -rf "$tmpdir"
261248

262249
echo "##############################"

bin/v-restart-dns

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ if [ "$1" = 'scheduled' ] || [ -z "$1" -a "$SCHEDULED_RESTART" = 'yes' ]; then
5656
exit
5757
fi
5858

59-
6059
if [ -e '/etc/named.conf' ]; then
6160
dns_conf='/etc/named.conf'
6261
else

bin/v-restore-user

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ fi
6969

7070
# Checking local backup
7171
if [ ! -e "$BACKUP/$backup" ]; then
72-
if [[ "$BACKUP_SYSTEM" =~ "google" ]]; then
73-
google_download "$backup"
74-
downloaded='yes'
75-
fi
7672
if [[ "$BACKUP_SYSTEM" =~ "sftp" ]] && [ -z "$downloaded" ]; then
7773
sftp_download "$backup"
7874
downloaded='yes'

func/backup.sh

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -442,56 +442,6 @@ sftp_backup() {
442442
fi
443443
}
444444

445-
# Google backup download function
446-
google_backup() {
447-
448-
# Defining google settings
449-
source_conf "$HESTIA/conf/google.backup.conf"
450-
gsutil="$HESTIA/3rdparty/gsutil/gsutil"
451-
export BOTO_CONFIG="$HESTIA/conf/.google.backup.boto"
452-
453-
# Debug info
454-
echo -e "$(date "+%F %T") Remote: gs://$BUCKET/$BPATH/$user.$backup_new_date.tar"
455-
456-
# Checking retention
457-
backup_list=$(${gsutil} ls gs://$BUCKET/$BPATH/$user.* 2> /dev/null)
458-
backups_count=$(echo "$backup_list" | wc -l)
459-
if [ "$backups_count" -ge "$BACKUPS" ]; then
460-
backups_rm_number=$((backups_count - BACKUPS))
461-
for backup in $(echo "$backup_list" | head -n $backups_rm_number); do
462-
echo -e "$(date "+%F %T") Rotated gcp backup: $backup"
463-
$gsutil rm $backup > /dev/null 2>&1
464-
done
465-
fi
466-
467-
# Uploading backup archive
468-
echo -e "$(date "+%F %T") Uploading $user.$backup_new_date.tar ..."
469-
if [ "$localbackup" = 'yes' ]; then
470-
cd $BACKUP
471-
${gsutil} cp $user.$backup_new_date.tar gs://$BUCKET/$BPATH/ > /dev/null 2>&1
472-
else
473-
cd $tmpdir
474-
tar -cf $BACKUP/$user.$backup_new_date.tar .
475-
cd $BACKUP/
476-
${gsutil} cp $user.$backup_new_date.tar gs://$BUCKET/$BPATH/ > /dev/null 2>&1
477-
rc=$?
478-
rm -f $user.$backup_new_date.tar
479-
if [ "$rc" -ne 0 ]; then
480-
check_result "$E_CONNECT" "gsutil failed to upload $user.$backup_new_date.tar"
481-
fi
482-
fi
483-
}
484-
485-
google_download() {
486-
source_conf "$HESTIA/conf/google.backup.conf"
487-
gsutil="$HESTIA/3rdparty/gsutil/gsutil"
488-
export BOTO_CONFIG="$HESTIA/conf/.google.backup.boto"
489-
${gsutil} cp gs://$BUCKET/$BPATH/$1 $BACKUP/ > /dev/null 2>&1
490-
if [ "$?" -ne 0 ]; then
491-
check_result "$E_CONNECT" "gsutil failed to download $1"
492-
fi
493-
}
494-
495445
# BackBlaze B2 backup function
496446
b2_backup() {
497447
# Defining backblaze b2 settings

install/upgrade/versions/1.7.0.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,8 @@ for file in /etc/php/*/fpm/pool.d/www.conf; do
6666
echo "[ * ] Update $file legacy /var/run/ to /run/"
6767
sed -i 's|/var/run/|/run/|g' $file
6868
done
69+
70+
if echo "$BACKUP_SYSTEM" | grep "google" > /dev/null; then
71+
echo "[ ! ] Deprecation notice: Backup via Google Cloud has been removed setup backup again via Rclone to reinstate the backup and restore capebilities!"
72+
add_upgrade_message "Deprecation notice: Backup via Google Cloud has been removed setup backup again via Rclone to reinstate the backup and restore capebilities!"
73+
fi

test/test.bats

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,13 @@ function check_ip_not_banned(){
14921492
refute_output
14931493
}
14941494

1495+
@test "MAIL: Add account (duplicate)" {
1496+
run v-add-mail-account $user $domain test "$userpass2"
1497+
assert_failure $E_EXISTS
1498+
}
1499+
14951500
@test "MAIL: Add account alias" {
1496-
run v-add-mail-account $user $domain test hestiacprocks
1501+
run v-add-mail-account-alias $user $domain test hestiacprocks
14971502
assert_success
14981503
assert_file_contains /etc/exim4/domains/$domain/aliases "hestiacprocks@$domain"
14991504
refute_output
@@ -1517,11 +1522,6 @@ function check_ip_not_banned(){
15171522
assert_failure $E_EXISTS
15181523
}
15191524

1520-
@test "MAIL: Add account (duplicate)" {
1521-
run v-add-mail-account-alias $user $domain test "$userpass2"
1522-
assert_failure $E_EXISTS
1523-
}
1524-
15251525
@test "MAIL: change mail account password" {
15261526
run curl -k -X POST -d "email=test@$domain&password=$userpass2&new=123456" https://localhost:8083/reset/mail/
15271527
assert_success

0 commit comments

Comments
 (0)