From 3bf42bba2af5c71f1bc81c4c31525da7bc6a58f2 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Mon, 15 Aug 2022 09:41:53 -0400 Subject: [PATCH] Restoration improvements. --- deploy.sh | 7 ++++--- deployment/www/go.sh | 8 +++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/deploy.sh b/deploy.sh index 0549eb4..7645fcf 100755 --- a/deploy.sh +++ b/deploy.sh @@ -30,6 +30,7 @@ VPS_HOSTING_TARGET=lxd RUN_CERT_RENEWAL=true USER_NO_BACKUP=false USER_RUN_RESTORE=false +RESTORE_WWW_USERDATA=true RESTORE_BTCPAY=false USER_SKIP_WWW=false USER_SKIP_BTCPAY=false @@ -254,6 +255,7 @@ function run_domain { if [ ! -d "$LOCAL_BACKUP_PATH" ]; then mkdir -p "$LOCAL_BACKUP_PATH" BACKUP_PATH_CREATED=true + RESTORE_WWW_USERDATA=false fi DDNS_HOST= @@ -370,8 +372,6 @@ function run_domain { exit 1 fi - bash -c ./deployment/stub_nginxconf.sh - MACHINE_EXISTS=false if [ "$VPS_HOSTING_TARGET" = aws ] && docker-machine ls -q | grep -q "$FQDN"; then MACHINE_EXISTS=true @@ -382,7 +382,7 @@ function run_domain { fi if [ "$USER_NO_BACKUP" = true ]; then - RUN_BACKUP=true + RUN_BACKUP=false fi if [ "$MACHINE_EXISTS" = true ]; then @@ -490,6 +490,7 @@ export GITEA_MYSQL_ROOT_PASSWORD="$(new_pass)" ## BTCPAY SERVER; if true, then a BTCPay server is deployed. export DEPLOY_BTCPAY_SERVER=false +export BTCPAYSERVER_MAC_ADDRESS="CHANGE_ME_REQUIRED" # CHAIN to DEPLOY; valid are 'regtest', 'testnet', and 'mainnet' export BTC_CHAIN=regtest diff --git a/deployment/www/go.sh b/deployment/www/go.sh index 6dbffc3..31b62bd 100755 --- a/deployment/www/go.sh +++ b/deployment/www/go.sh @@ -3,6 +3,8 @@ set -exu cd "$(dirname "$0")" +bash -c ./stub_nginxconf.sh + TOR_CONFIG_PATH= ssh "$FQDN" mkdir -p "$REMOTE_HOME/ghost_site" "$REMOTE_HOME/ghost_db" @@ -43,7 +45,11 @@ if [ "$RUN_BACKUP" = true ]; then fi if [ "$RUN_RESTORE" = true ]; then - ./restore.sh + # Generally speaking we try to restore data. But if the BACKUP directory was + # just created, we know that we'll deploy fresh. + if [ "$RESTORE_WWW_USERDATA" = true ]; then + ./restore.sh + fi fi if [ "$DEPLOY_ONION_SITE" = true ]; then