@@ -37,9 +37,6 @@ ZULIP_AUTH_BACKENDS="${ZULIP_AUTH_BACKENDS:-EmailAuthBackend}"
37
37
ZULIP_RUN_POST_SETUP_SCRIPTS=" ${ZULIP_RUN_POST_SETUP_SCRIPTS:- True} "
38
38
# Zulip user setup
39
39
FORCE_FIRST_START_INIT=" ${FORCE_FIRST_START_INIT:- False} "
40
- # Auto backup settings
41
- AUTO_BACKUP_ENABLED=" ${AUTO_BACKUP_ENABLED:- True} "
42
- AUTO_BACKUP_INTERVAL=" ${AUTO_BACKUP_INTERVAL:- 30 3 * * * } "
43
40
# Zulip configuration function specific variable(s)
44
41
SPECIAL_SETTING_DETECTION_MODE=" ${SPECIAL_SETTING_DETECTION_MODE:- } "
45
42
MANUAL_CONFIGURATION=" ${MANUAL_CONFIGURATION:- false} "
@@ -56,6 +53,7 @@ prepareDirectories() {
56
53
rm -rf /home/zulip/uploads
57
54
ln -sfT " $DATA_DIR /uploads" /home/zulip/uploads
58
55
chown zulip:zulip -R " $DATA_DIR /uploads"
56
+ chown zulip:zulip -R " $DATA_DIR /backups"
59
57
# Link settings folder
60
58
if [ " $LINK_SETTINGS_TO_DATA " = " True" ] || [ " $LINK_SETTINGS_TO_DATA " = " true" ]; then
61
59
# Create settings directories
@@ -279,15 +277,6 @@ zulipConfiguration() {
279
277
fi
280
278
echo " Zulip configuration succeeded."
281
279
}
282
- autoBackupConfiguration () {
283
- if [ " $AUTO_BACKUP_ENABLED " != " True" ] && [ " $AUTO_BACKUP_ENABLED " != " true" ]; then
284
- rm -f /etc/cron.d/autobackup
285
- echo " Auto backup is disabled. Continuing."
286
- return 0
287
- fi
288
- printf ' MAILTO=""\n%s cd /;/entrypoint.sh app:backup\n' " $AUTO_BACKUP_INTERVAL " > /etc/cron.d/autobackup
289
- echo " Auto backup enabled."
290
- }
291
280
initialConfiguration () {
292
281
echo " === Begin Initial Configuration Phase ==="
293
282
prepareDirectories
@@ -301,7 +290,6 @@ initialConfiguration() {
301
290
authenticationBackends
302
291
zulipConfiguration
303
292
fi
304
- autoBackupConfiguration
305
293
echo " === End Initial Configuration Phase ==="
306
294
}
307
295
# === bootstrappingEnvironment ===
@@ -439,67 +427,6 @@ appManagePy() {
439
427
set +e
440
428
exec su zulip -c " /home/zulip/deployments/current/manage.py $( printf ' %q ' " $COMMAND " " $@ " ) "
441
429
}
442
- appBackup () {
443
- echo " Starting backup process ..."
444
- if [ -d " /tmp/backup-$( date " %D-%H-%M-%S" ) " ]; then
445
- echo " Temporary backup folder for \" $( date " %D-%H-%M-%S" ) \" already exists. Aborting."
446
- echo " Backup process failed. Exiting."
447
- exit 1
448
- fi
449
- local BACKUP_FOLDER
450
- BACKUP_FOLDER=" /tmp/backup-$( date " %D-%H-%M-%S" ) "
451
- mkdir -p " $BACKUP_FOLDER "
452
- waitingForDatabase
453
- pg_dump -h " $DB_HOST " -p " $DB_HOST_PORT " -U " $DB_USER " " $DB_NAME " > " $BACKUP_FOLDER /database-postgres.sql"
454
- tar -zcvf " $DATA_DIR /backups/backup-$( date " %D-%H-%M-%S" ) .tar.gz" " $BACKUP_FOLDER /"
455
- rm -r " ${BACKUP_FOLDER:? } /"
456
- echo " Backup process succeeded."
457
- exit 0
458
- }
459
- appRestore () {
460
- echo " Starting restore process ..."
461
- if [ -z " $( ls -A " $DATA_DIR /backups/" ) " ]; then
462
- echo " No backups to restore found in \" $DATA_DIR /backups/\" ."
463
- echo " Restore process failed. Exiting."
464
- exit 1
465
- fi
466
- while true ; do
467
- local backups=(" $DATA_DIR " /backups/* )
468
- printf ' |-> %s\n' " ${backups[@]# " $DATA_DIR " / backups/ } "
469
- echo " Please enter backup filename (full filename with extension): "
470
- read -r BACKUP_FILE
471
- if [ -z " $BACKUP_FILE " ]; then
472
- echo " Empty filename given. Please try again."
473
- echo " "
474
- continue
475
- fi
476
- if [ ! -e " $DATA_DIR /backups/$BACKUP_FILE " ]; then
477
- echo " File \" $BACKUP_FILE \" not found. Please try again."
478
- echo " "
479
- fi
480
- break
481
- done
482
- echo " File \" $BACKUP_FILE \" found."
483
- echo " "
484
- echo " ==============================================================="
485
- echo " !! WARNING !! Your current data will be deleted!"
486
- echo " !! WARNING !! YOU HAVE BEEN WARNED! You can abort with \" CTRL+C\" ."
487
- echo " !! WARNING !! Waiting 10 seconds before continuing ..."
488
- echo " ==============================================================="
489
- echo " "
490
- local TIMEOUT
491
- for TIMEOUT in {10..1}; do
492
- echo " $TIMEOUT "
493
- sleep 1
494
- done
495
- echo " !! WARNING !! Starting restore process ... !! WARNING !!"
496
- waitingForDatabase
497
- tar -zxvf " $DATA_DIR /backups/$BACKUP_FILE " -C /tmp
498
- psql -h " $DB_HOST " -p " $DB_HOST_PORT " -U " $DB_USER " " $DB_NAME " < " /tmp/$( basename " $BACKUP_FILE " | cut -d. -f1) /database-postgres.sql"
499
- rm -r " /tmp/$( basename | cut -d. -f1) /"
500
- echo " Restore process succeeded. Exiting."
501
- exit 0
502
- }
503
430
appCerts () {
504
431
configureCerts
505
432
}
@@ -508,8 +435,6 @@ appHelp() {
508
435
echo " > app:help - Show this help menu and exit"
509
436
echo " > app:version - Container Zulip server version"
510
437
echo " > app:managepy - Run Zulip's manage.py script (defaults to \" shell\" )"
511
- echo " > app:backup - Create backups of Zulip instances"
512
- echo " > app:restore - Restore backups of Zulip instances"
513
438
echo " > app:certs - Create self-signed certificates"
514
439
echo " > app:run - Run the Zulip server"
515
440
echo " > [COMMAND] - Run given command with arguments in shell"
@@ -530,12 +455,6 @@ case "$1" in
530
455
shift 1
531
456
appManagePy " $@ "
532
457
;;
533
- app:backup)
534
- appBackup
535
- ;;
536
- app:restore)
537
- appRestore
538
- ;;
539
458
app:certs)
540
459
appCerts
541
460
;;
0 commit comments