From 59ca96cb6c3fb98507501afdf4630b77c24cb316 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Thu, 5 Jan 2023 11:14:48 -0500 Subject: [PATCH] migration and publish improvements. --- deployment/btcpayserver/stub_btcpay_setup.sh | 2 +- deployment/create_lxc_base.sh | 2 +- deployment/stub_lxc_profile.sh | 4 ++-- migrate.sh | 10 +++++++--- publish.sh | 4 +++- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/deployment/btcpayserver/stub_btcpay_setup.sh b/deployment/btcpayserver/stub_btcpay_setup.sh index 7973988..498b6bf 100755 --- a/deployment/btcpayserver/stub_btcpay_setup.sh +++ b/deployment/btcpayserver/stub_btcpay_setup.sh @@ -39,7 +39,7 @@ export NBITCOIN_NETWORK="${BTC_CHAIN}" export LIGHTNING_ALIAS="${PRIMARY_DOMAIN}" export BTCPAYGEN_LIGHTNING="clightning" export BTCPAYGEN_CRYPTO1="btc" -export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage-s;opt-add-btctransmuter;bitcoin-clightning.custom;" +export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage-s;bitcoin-clightning.custom;" export BTCPAYGEN_REVERSEPROXY="nginx" export BTCPAY_ENABLE_SSH=false export BTCPAY_BASE_DIRECTORY=${REMOTE_HOME} diff --git a/deployment/create_lxc_base.sh b/deployment/create_lxc_base.sh index cc91add..d62780e 100755 --- a/deployment/create_lxc_base.sh +++ b/deployment/create_lxc_base.sh @@ -36,7 +36,7 @@ if ! lxc image list --format csv "$VM_NAME" | grep -q "$VM_NAME"; then # if the image doesn't exist, download it from Ubuntu's image server # TODO see if we can fetch this file from a more censorship-resistant source, e.g., ipfs # we don't really need to cache this locally since it gets continually updated upstream. - lxc image copy "images:$BASE_LXC_IMAGE" "$CLUSTER_NAME": --alias "ubuntu-base" --public --vm + lxc image copy "images:$BASE_LXC_IMAGE" "$CLUSTER_NAME": --alias "ubuntu-base" --public --vm --auto-update fi # this vm is used temperarily with diff --git a/deployment/stub_lxc_profile.sh b/deployment/stub_lxc_profile.sh index dd47c4a..9bbfaa0 100755 --- a/deployment/stub_lxc_profile.sh +++ b/deployment/stub_lxc_profile.sh @@ -175,8 +175,8 @@ if [ "$LXD_HOSTNAME" = "sovereign-stack" ]; then - sudo apt-get update - sudo apt-get install -y docker-ce docker-ce-cli containerd.io - echo "alias ll='ls -lah'" >> /home/ubuntu/.bash_profile - - echo "alias bitcoin-cli='bitcoin-cli.sh \$@'" >> /home/ubuntu/.bash_profile - - echo "alias lightning-cli='bitcoin-lightning-cli.sh \$@'" >> /home/ubuntu/.bash_profile + - echo "alias bitcoin-cli=\"bitcoin-cli.sh \$@\"" >> /home/ubuntu/.bash_profile + - echo "alias lightning-cli=\"bitcoin-lightning-cli.sh \$@\"" >> /home/ubuntu/.bash_profile - sudo curl -s -L "https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - sudo apt-get install -y openssh-server diff --git a/migrate.sh b/migrate.sh index 3c823fb..d0cb958 100755 --- a/migrate.sh +++ b/migrate.sh @@ -62,10 +62,10 @@ echo "INFO: The BTCPAY_RESTORE_ARCHIVE_PATH for this migration will be: $BTCPAY_ # the --stop flag ensures that services do NOT come back online. # by default, we grab a backup. -bash -c "./deploy.sh --stop --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH" +bash -c "./deploy.sh --stop --no-cert-renew --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH" RESPONSE= -read -r -p "Are you sure you want to continue the migration? We have a backup TODO.": RESPONSE +read -r -p "Are you sure you want to continue the migration? ": RESPONSE if [ "$RESPONSE" != "y" ]; then echo "STOPPING." exit 0 @@ -90,9 +90,13 @@ if lxc profile list | grep -q sovereign-stack; then lxc profile delete sovereign-stack fi -if lxc image list | grep -q "sovereign-stack-base"; then +if lxc image list | grep -q sovereign-stack-base; then lxc image rm sovereign-stack-base fi +if lxc image list | grep -q ubuntu-base; then + lxc image rm ubuntu-base +fi + # Then we can run a restore operation and specify the backup archive at the CLI. bash -c "./deploy.sh -y --restore-www --restore-btcpay --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH" diff --git a/publish.sh b/publish.sh index 965725b..8d71b33 100755 --- a/publish.sh +++ b/publish.sh @@ -9,10 +9,12 @@ TAG_MESSAGE="Creating tag $TAG_NAME on $(date)." git tag -a "$TAG_NAME" -m "$TAG_MESSAGE" -s -# optional; push to remote +# push commits and tags to origin git push --set-upstream origin --all git push --set-upstream origin --tags + +## note this will only work if you have permissions to update HEAD on https://git.sovereign-stack.org/ss/sovereign-stack.git RESPONSE= read -r -p " Would you like to push this to the main ss repo? (y) ": RESPONSE if [ "$RESPONSE" != "y" ]; then