From 806794c308ef7d00b78a0b68f7f9d1ea5df10fa2 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 24 May 2022 14:22:04 -0400 Subject: [PATCH] Minor updates to control. --- deployment/go_www.sh | 8 ++++---- deployment/provision_lxc.sh | 8 +------- deployment/provision_vps.sh | 3 +-- deployment/run_btcpay_setup.sh | 14 ++++++++------ deployment/stub_docker_yml.sh | 18 +----------------- 5 files changed, 15 insertions(+), 36 deletions(-) diff --git a/deployment/go_www.sh b/deployment/go_www.sh index c149568..f375717 100755 --- a/deployment/go_www.sh +++ b/deployment/go_www.sh @@ -31,11 +31,11 @@ fi # if [ "$VPS_HOSTING_TARGET" != lxd ]; then - # really we should change this if clause to some thing like - # "if the perimeter firewall allows port 80/443, then go ahead." +# really we should change this if clause to some thing like +# "if the perimeter firewall allows port 80/443, then go ahead." if [ "$RUN_CERT_RENEWAL" = true ]; then - ./generate_certs.sh - fi + ./generate_certs.sh +fi if [ "$RUN_BACKUP" = true ]; then ./backup_www.sh diff --git a/deployment/provision_lxc.sh b/deployment/provision_lxc.sh index 8eb73aa..12ae50f 100755 --- a/deployment/provision_lxc.sh +++ b/deployment/provision_lxc.sh @@ -2,12 +2,6 @@ set -eux -# check to ensure the admin has specified a MACVLAN interface -if [ -z "$MACVLAN_INTERFACE" ]; then - echo "ERROR: MACVLAN_INTERFACE not defined in project." - exit 1 -fi - # The base VM image. BASE_LXC_IMAGE="ubuntu/22.04/cloud" @@ -24,7 +18,7 @@ export SSH_AUTHORIZED_KEY="$SSH_AUTHORIZED_KEY" envsubst < ./lxc_profile.yml > "$SITE_PATH/cloud-init-$APP_TO_DEPLOY.yml" # configure the profile with our generated cloud-init.yml file. -lxc profile edit "$LXD_VM_NAME" < "$SITE_PATH/cloud-init-$APP_TO_DEPLOY.yml" +cat "$SITE_PATH/cloud-init-$APP_TO_DEPLOY.yml" | lxc profile edit "$LXD_VM_NAME" function wait_for_lxc_ip { diff --git a/deployment/provision_vps.sh b/deployment/provision_vps.sh index 92c5beb..c4068bd 100755 --- a/deployment/provision_vps.sh +++ b/deployment/provision_vps.sh @@ -41,7 +41,6 @@ if [ "$APP_TO_DEPLOY" = www ] || [ "$APP_TO_DEPLOY" = certonly ]; then docker-machine create --driver amazonec2 \ --amazonec2-open-port 80 \ --amazonec2-open-port 443 \ - --amazonec2-open-port 8448 \ --amazonec2-access-key "$AWS_ACCESS_KEY" \ --amazonec2-secret-key "$AWS_SECRET_ACCESS_KEY" \ --amazonec2-region "$AWS_REGION" \ @@ -70,7 +69,7 @@ elif [ "$APP_TO_DEPLOY" = btcpay ]; then fi -docker-machine scp "$SITE_PATH/authorized_keys" "$FQDN:$REMOTE_HOME/authorized_keys" +docker-machine scp "$LXD_REMOTE_PATH/authorized_keys" "$FQDN:$REMOTE_HOME/authorized_keys" docker-machine ssh "$FQDN" "cat $REMOTE_HOME/authorized_keys >> $REMOTE_HOME/.ssh/authorized_keys" # we have to ensure ubuntu is able to do sudo less docker commands. diff --git a/deployment/run_btcpay_setup.sh b/deployment/run_btcpay_setup.sh index 0a956f6..b8e0637 100755 --- a/deployment/run_btcpay_setup.sh +++ b/deployment/run_btcpay_setup.sh @@ -41,12 +41,14 @@ export BTCPAY_ENABLE_SSH=true cd btcpayserver-docker -# run fast_sync if it's not been done before. -if [ ! -f /home/ubuntu/fast_sync_completed ]; then - cd ./contrib/FastSync - ./load-utxo-set.sh - touch /home/ubuntu/fast_sync_completed - cd - +if [ "${BTC_CHAIN}" != regtest ]; then + # run fast_sync if it's not been done before. + if [ ! -f /home/ubuntu/fast_sync_completed ]; then + cd ./contrib/FastSync + ./load-utxo-set.sh + touch /home/ubuntu/fast_sync_completed + cd - + fi fi # provision the btcpay server diff --git a/deployment/stub_docker_yml.sh b/deployment/stub_docker_yml.sh index c3a0516..0fc4d2e 100755 --- a/deployment/stub_docker_yml.sh +++ b/deployment/stub_docker_yml.sh @@ -33,7 +33,6 @@ cat >>"$DOCKER_YAML_PATH" <>"$DOCKER_YAML_PATH" <>"$DOCKER_YAML_PATH" <>"$DOCKER_YAML_PATH" <>"$DOCKER_YAML_PATH" <