BTCPay updates.

This commit is contained in:
Derek Smith 2023-04-02 09:24:59 -04:00
parent 00b9c9bb55
commit 0c28ca4102
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
3 changed files with 21 additions and 15 deletions

View File

@ -6,7 +6,7 @@ cd "$(dirname "$0")"
export DOCKER_HOST="ssh://ubuntu@$BTCPAY_FQDN" export DOCKER_HOST="ssh://ubuntu@$BTCPAY_FQDN"
# run the btcpay setup script if it hasn't been done before. # run the btcpay setup script if it hasn't been done before.
if [ "$(ssh "$BTCPAY_FQDN" [[ ! -f "$REMOTE_HOME/btcpay.complete" ]]; echo $?)" -eq 0 ]; then if ssh "$BTCPAY_FQDN" "[ ! -f "$REMOTE_DATA_PATH/btcpay.complete" ]"; then
./stub_btcpay_setup.sh ./stub_btcpay_setup.sh
BACKUP_BTCPAY=false BACKUP_BTCPAY=false
fi fi

View File

@ -59,15 +59,11 @@ export BTCPAY_BASE_DIRECTORY=${REMOTE_HOME}
export BTCPAYGEN_EXCLUDE_FRAGMENTS="nginx-https;" export BTCPAYGEN_EXCLUDE_FRAGMENTS="nginx-https;"
export REVERSEPROXY_DEFAULT_HOST="$BTCPAY_USER_FQDN" export REVERSEPROXY_DEFAULT_HOST="$BTCPAY_USER_FQDN"
if [ "\$NBITCOIN_NETWORK" != regtest ]; then # if [ "\$NBITCOIN_NETWORK" != regtest ]; then
# run fast_sync if it's not been done before. # cd ./contrib/FastSync
if [ ! -f /home/ubuntu/fast_sync_completed ]; then # ./load-utxo-set.sh
cd ./contrib/FastSync # cd -
./load-utxo-set.sh # fi
touch /home/ubuntu/fast_sync_completed
cd -
fi
fi
# next we create fragments to customize various aspects of the system # next we create fragments to customize various aspects of the system
# this block customizes clightning to ensure the correct endpoints are being advertised # this block customizes clightning to ensure the correct endpoints are being advertised

View File

@ -78,10 +78,20 @@ if ! lxc list --format csv | grep -q "$LXD_VM_NAME"; then
sleep 10 sleep 10
bash -c "./wait_for_lxc_ip.sh --lxd-name=$LXD_VM_NAME" bash -c "./wait_for_lxc_ip.sh --lxd-name=$LXD_VM_NAME"
fi
# scan the remote machine and install it's identity in our SSH known_hosts file. # 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" ssh-keyscan -H -t ecdsa "$FQDN" >> "$SSH_HOME/known_hosts"
# create a directory to store backup archives. This is on all new vms. # create a directory to store backup archives. This is on all new vms.
ssh "$FQDN" mkdir -p "$REMOTE_HOME/backups" ssh "$FQDN" "mkdir -p $REMOTE_HOME/backups"
ssh "$FQDN" "sudo chown -R ubuntu:ubuntu $REMOTE_DATA_PATH"
if [ "$VIRTUAL_MACHINE" = btcpayserver ]; then
# send an updated ~/.bashrc so we have quicker access to cli tools
scp ./btcpayserver/bashrc.txt "ubuntu@$FQDN:$REMOTE_HOME/.bashrc"
ssh "$BTCPAY_FQDN" "chown ubuntu:ubuntu $REMOTE_HOME/.bashrc"
ssh "$BTCPAY_FQDN" "chmod 0664 $REMOTE_HOME/.bashrc"
fi
fi