From 156099c7ed26012ffab55f7a711d598dbbaa6e4c Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Wed, 22 Jun 2022 13:29:52 -0400 Subject: [PATCH] Updated filenames. --- deployment/backup_btcpay.sh | 9 --- .../{go_btcpay.sh => btcpayserver/go.sh} | 13 ++-- deployment/prepare_vps_host.sh | 16 ----- deployment/restore_btcpay.sh | 21 ------- deployment/run_btcpay_setup.sh | 62 ------------------- lxd_init.yaml | 33 ---------- 6 files changed, 6 insertions(+), 148 deletions(-) delete mode 100755 deployment/backup_btcpay.sh rename deployment/{go_btcpay.sh => btcpayserver/go.sh} (83%) delete mode 100755 deployment/prepare_vps_host.sh delete mode 100755 deployment/restore_btcpay.sh delete mode 100755 deployment/run_btcpay_setup.sh delete mode 100644 lxd_init.yaml diff --git a/deployment/backup_btcpay.sh b/deployment/backup_btcpay.sh deleted file mode 100755 index 567c345..0000000 --- a/deployment/backup_btcpay.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -# take the services down, create a backup archive, then pull it down. -ssh "$FQDN" "cd $REMOTE_HOME/btcpayserver-docker/; sudo bash -c ./backup.sh" -ssh "$FQDN" "sudo cp /var/lib/docker/volumes/backup_datadir/_data/backup.tar.gz $REMOTE_HOME/backups/btcpay.tar.gz" -ssh "$FQDN" "sudo chown ubuntu:ubuntu $REMOTE_HOME/backups/btcpay.tar.gz" -scp "$FQDN:$REMOTE_HOME/backups/btcpay.tar.gz" "$LOCAL_BACKUP_PATH/btcpay-$1.tar.gz" diff --git a/deployment/go_btcpay.sh b/deployment/btcpayserver/go.sh similarity index 83% rename from deployment/go_btcpay.sh rename to deployment/btcpayserver/go.sh index c6c4d9f..99cc796 100755 --- a/deployment/go_btcpay.sh +++ b/deployment/btcpayserver/go.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -eu +set -eux cd "$(dirname "$0")" if [ "$RUN_BACKUP" = true ]; then @@ -14,7 +14,7 @@ if [ "$UPDATE_BTCPAY" = true ]; then if [ "$RUN_BACKUP" = true ]; then # grab a backup PRIOR to update - ./backup_btcpay.sh "before-update-$UNIX_BACKUP_TIMESTAMP" + ./backup.sh "before-update-$UNIX_BACKUP_TIMESTAMP" fi # run the update. @@ -24,7 +24,7 @@ if [ "$UPDATE_BTCPAY" = true ]; then else if [ "$RUN_BACKUP" = true ]; then # we just grab a regular backup - ./backup_btcpay.sh "regular-backup-$UNIX_BACKUP_TIMESTAMP" + ./backup.sh "regular-backup-$UNIX_BACKUP_TIMESTAMP" fi fi @@ -32,24 +32,23 @@ fi if [ "$RUN_RESTORE" = true ]; then # shellcheck disable=SC2029 ssh "$FQDN" "cd $REMOTE_HOME/btcpayserver-docker/; sudo bash -c ./btcpay-down.sh" - ./restore_btcpay.sh + #./restore.sh fi # the administrator may have indicated a reconfig; if so, re-run the setup (useful for adding alternative names to TLS) if [ "$RECONFIGURE_BTCPAY_SERVER" = true ]; then # re-run the setup script. - ./run_btcpay_setup.sh + ./run_setup.sh fi if [ "$MIGRATE_VPS" = false ]; then # The default is to resume services, though admin may want to keep services off (eg., for a migration) # we bring the services back up by default. # shellcheck disable=SC2029 - ssh "$FQDN" "cd $REMOTE_HOME/btcpayserver-docker/; sudo bash -c ./btcpay-up.sh" + ssh "$FQDN" "cd $REMOTE_HOME/btcpayserver-docker/; bash -c ./btcpay-up.sh" # we wait for lightning to comone line too. wait-for-it -t -60 "$FQDN:80" - wait-for-it -t -60 "$FQDN:443" xdg-open "http://$FQDN" else diff --git a/deployment/prepare_vps_host.sh b/deployment/prepare_vps_host.sh deleted file mode 100755 index d05c763..0000000 --- a/deployment/prepare_vps_host.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -exu - -# scan the remote machine and install it's identity in our SSH known_hosts file. -ssh-keyscan -H -t ecdsa "$FQDN" >> "$SSH_HOME/known_hosts" - -# create a directory to store backup archives. This is on all new vms. -ssh "$FQDN" mkdir -p "$REMOTE_HOME/backups" - -if [ "$APP_TO_DEPLOY" = btcpay ]; then - echo "INFO: new machine detected. Provisioning BTCPay server scripts." - - ./run_btcpay_setup.sh - exit -fi diff --git a/deployment/restore_btcpay.sh b/deployment/restore_btcpay.sh deleted file mode 100755 index c04c514..0000000 --- a/deployment/restore_btcpay.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -u - -# this scripts ASSUMES services have already been taken down. - -# first let's ask the user for the absolute path to the backup file that we want to restore. -FILE_PATH= -read -r -p "Please enter the absolute path of the backup file you want to restore: ": FILE_PATH -if [ -f "$FILE_PATH" ]; then - # then we grab a backup of the existing stuff BEFORE the restoration attempt - ./backup_btcpay.sh "before-restore-$UNIX_BACKUP_TIMESTAMP" - - echo "INFO: Restoring BTCPAY Server: $FILE_PATH" - ssh "$FQDN" mkdir -p "$REMOTE_BACKUP_PATH" - scp "$FILE_PATH" "$FQDN:$REMOTE_BACKUP_PATH/btcpay.tar.gz" - ssh "$FQDN" "cd /; sudo tar -xzvf $REMOTE_BACKUP_PATH/btcpay.tar.gz" -else - echo "ERROR: File does not exist." - exit 1 -fi diff --git a/deployment/run_btcpay_setup.sh b/deployment/run_btcpay_setup.sh deleted file mode 100755 index b8e0637..0000000 --- a/deployment/run_btcpay_setup.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -set -e - - -# export BTCPAY_FASTSYNC_ARCHIVE_FILENAME="utxo-snapshot-bitcoin-testnet-1445586.tar" -# BTCPAY_REMOTE_RESTORE_PATH="/var/lib/docker/volumes/generated_bitcoin_datadir/_data" - -# This is the config for a basic proxy to the listening port 127.0.0.1:2368 -# It also supports modern TLS, so SSL certs must be available. -cat > "$SITE_PATH/btcpay.sh" <