Add restore logic back in.

This commit is contained in:
Derek Smith 2023-11-19 13:59:40 -05:00
parent 55dc01a3b0
commit 19f09254e8
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
2 changed files with 16 additions and 0 deletions

View File

@ -88,6 +88,15 @@ if [ "$RUN_CERT_RENEWAL" = true ] && [ "$RESTORE_CERTS" = false ] && [ "$STACKS_
#./generate_certs.sh #./generate_certs.sh
fi fi
if [ "$RESTORE_WWW" = true ]; then
APP_LIST="letsencrypt ghost gitea nostr"
for APP in $APP_LIST; do
export APP="$APP"
./restore_path.sh
done
fi
# nginx gets deployed first since it "owns" the docker networks of downstream services. # nginx gets deployed first since it "owns" the docker networks of downstream services.
./stub/nginx_yml.sh ./stub/nginx_yml.sh

View File

@ -3,6 +3,13 @@
set -eu set -eu
cd "$(dirname "$0")" cd "$(dirname "$0")"
# these variable are used by both backup/restore scripts.
export REMOTE_BACKUP_PATH="$REMOTE_BACKUP_PATH/www/$APP/$DOMAIN_IDENTIFIER"
export REMOTE_SOURCE_BACKUP_PATH="$REMOTE_DATA_PATH/$APP/$DOMAIN_NAME"
export LOCAL_BACKUP_PATH="$SITE_PATH/backups/www/$APP"
mkdir -p "$LOCAL_BACKUP_PATH"
FILE_COUNT="$(find "$LOCAL_BACKUP_PATH" -type f | wc -l)" FILE_COUNT="$(find "$LOCAL_BACKUP_PATH" -type f | wc -l)"
if [ "$FILE_COUNT" = 0 ]; then if [ "$FILE_COUNT" = 0 ]; then
exit 0 exit 0