diff --git a/btcpayserver/go.sh b/btcpayserver/go.sh index 5e9d9ca..7491201 100755 --- a/btcpayserver/go.sh +++ b/btcpayserver/go.sh @@ -5,13 +5,7 @@ cd "$(dirname "$0")" export DOCKER_HOST="ssh://ubuntu@$BTCPAY_FQDN" -# run the btcpay setup script if it hasn't been done before. -if ssh "$BTCPAY_FQDN" "[ ! -f "$REMOTE_DATA_PATH/btcpay.complete" ]"; then - ./stub_btcpay_setup.sh - BACKUP_BTCPAY=false -fi - -RUN_SERVICES=true +./stub_btcpay_setup.sh # we will re-run the btcpayserver provisioning scripts if directed to do so. # if an update does occur, we grab another backup. @@ -49,7 +43,7 @@ if [ "$BACKUP_BTCPAY" = true ]; then ./backup_btcpay.sh fi -if [ "$RUN_SERVICES" = true ] && [ "$STOP_SERVICES" = false ]; then +if [ "$STOP_SERVICES" = 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. ssh "$FQDN" "bash -c $BTCPAY_SERVER_APPPATH/btcpay-up.sh" diff --git a/btcpayserver/stub_btcpay_setup.sh b/btcpayserver/stub_btcpay_setup.sh index 4036c5e..539d60b 100755 --- a/btcpayserver/stub_btcpay_setup.sh +++ b/btcpayserver/stub_btcpay_setup.sh @@ -3,6 +3,8 @@ set -e cd "$(dirname "$0")" + + # default is for regtest CLIGHTNING_WEBSOCKET_PORT=9736 if [ "$BITCOIN_CHAIN" = testnet ]; then @@ -13,6 +15,7 @@ fi export CLIGHTNING_WEBSOCKET_PORT="$CLIGHTNING_WEBSOCKET_PORT" + # export BTCPAY_FASTSYNC_ARCHIVE_FILENAME="utxo-snapshot-bitcoin-testnet-1445586.tar" # BTCPAY_REMOTE_RESTORE_PATH="/var/lib/docker/volumes/generated_bitcoin_datadir/_data" diff --git a/deploy.sh b/deploy.sh index 933add1..1e940f2 100755 --- a/deploy.sh +++ b/deploy.sh @@ -315,6 +315,16 @@ if ! lxc image list --format csv | grep -q "$DOCKER_BASE_IMAGE_NAME"; then fi for VIRTUAL_MACHINE in www btcpayserver; do + + if [ "$VIRTUAL_MACHINE" = btcpayserver ] && [ "$SKIP_BTCPAY" = true ]; then + continue + fi + + if [ "$VIRTUAL_MACHINE" = www ] && [ "$SKIP_WWW" = true ]; then + continue + fi + + export VIRTUAL_MACHINE="$VIRTUAL_MACHINE" FQDN= diff --git a/www/go.sh b/www/go.sh index d17e96e..2f994e8 100755 --- a/www/go.sh +++ b/www/go.sh @@ -130,6 +130,13 @@ if [ "$RESTART_FRONT_END" = true ]; then ./backup_path.sh fi done +else + exit 0 +fi + +# build the clams docker image +if [ "$BUILD_CLAMS" = true ]; then + ./clams/build.sh fi # nginx gets deployed first since it "owns" the docker networks of downstream services. @@ -141,6 +148,8 @@ fi ./stub/gitea_yml.sh ./stub/nostr_yml.sh + + # # start a browser session; point it to port 80 to ensure HTTPS redirect. # # WWW_FQDN is in our certificate, so we resolve to that. # wait-for-it -t 320 "$WWW_FQDN:80" diff --git a/www/stop_docker_stacks.sh b/www/stop_docker_stacks.sh index 7cd33c2..1a16d51 100755 --- a/www/stop_docker_stacks.sh +++ b/www/stop_docker_stacks.sh @@ -46,3 +46,10 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do done done done + +# remove the nginx stack +if docker stack list --format "{{.Name}}" | grep -q reverse-proxy; then + docker stack rm reverse-proxy + + sleep 5 +fi diff --git a/www/stub/ghost_yml.sh b/www/stub/ghost_yml.sh index 40f5c9a..bdc19c3 100755 --- a/www/stub/ghost_yml.sh +++ b/www/stub/ghost_yml.sh @@ -3,6 +3,7 @@ set -eu cd "$(dirname "$0")" +DEPLOY_STACK=false for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do export DOMAIN_NAME="$DOMAIN_NAME" export SITE_PATH="$SITES_PATH/$DOMAIN_NAME" @@ -12,6 +13,10 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do source "$SITE_PATH/site.conf" source ../../domain_env.sh + if [ "$DEPLOY_GHOST" = true ]; then + DEPLOY_STACK=true + fi + # for each language specified in the site.conf, we spawn a separate ghost container # at https://www.domain.com/$LANGUAGE_CODE for LANGUAGE_CODE in ${SITE_LANGUAGE_CODES//,/ }; do @@ -103,7 +108,7 @@ EOL EOL fi - if [ "$STOP_SERVICES" = false ]; then + if [ "$DEPLOY_STACK" = true ] && [ "$STOP_SERVICES" = false ]; then docker stack deploy -c "$DOCKER_YAML_PATH" "$DOMAIN_IDENTIFIER-ghost-$LANGUAGE_CODE" sleep 2 fi diff --git a/www/stub/nginx_config.sh b/www/stub/nginx_config.sh index 945409c..75f8998 100755 --- a/www/stub/nginx_config.sh +++ b/www/stub/nginx_config.sh @@ -307,17 +307,19 @@ EOL EOL fi - echo " # set up cache paths for nginx caching" >>"$NGINX_CONF_PATH" - for LANGUAGE_CODE in ${SITE_LANGUAGE_CODES//,/ }; do - STACK_NAME="$DOMAIN_IDENTIFIER-$LANGUAGE_CODE" - cat >>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" + for LANGUAGE_CODE in ${SITE_LANGUAGE_CODES//,/ }; do + STACK_NAME="$DOMAIN_IDENTIFIER-$LANGUAGE_CODE" + cat >>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" < 1 )); then - # we only need this clause if we know there is more than once lanuage being rendered. - cat >>"$NGINX_CONF_PATH" < 1 )); then + # we only need this clause if we know there is more than once lanuage being rendered. + cat >>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <>"$NGINX_CONF_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <> "$DOCKER_YAML_PATH" <