diff --git a/defaults.sh b/defaults.sh index eb2f911..94c77dd 100755 --- a/defaults.sh +++ b/defaults.sh @@ -3,8 +3,8 @@ set -eu export WWW_SERVER_MAC_ADDRESS= - - +export DEPLOY_WWW_SERVER=false +export DEPLOY_BTCPAY_SERVER=false export DEPLOY_GHOST=true export DEPLOY_NOSTR_RELAY=true export DEPLOY_ONION_SITE=false @@ -18,7 +18,7 @@ export NEXTCLOUD_HOSTNAME="nextcloud" export GITEA_HOSTNAME="git" export NOSTR_HOSTNAME="relay" - +export SITE_LANGUAGE_CODES="en" export NOSTR_ACCOUNT_PUBKEY= # used by 'aws' deployments only; planned deprecation @@ -137,7 +137,7 @@ export SITES_PATH="$HOME/ss-sites" export BASE_LXC_IMAGE="ubuntu/22.04/cloud" # Deploy a registry cache on your management machine. -export DEPLOY_MGMT_REGISTRY=true +export DEPLOY_MGMT_REGISTRY=false export OTHER_SITES_LIST= export REMOTE_HOME="/home/ubuntu" diff --git a/deploy.sh b/deploy.sh index 12ec340..549e274 100755 --- a/deploy.sh +++ b/deploy.sh @@ -25,7 +25,7 @@ fi DOMAIN_NAME= VPS_HOSTING_TARGET=lxd -RUN_CERT_RENEWAL=false +RUN_CERT_RENEWAL=true SKIP_WWW=false RESTORE_WWW=false BACKUP_CERTS=true @@ -476,9 +476,10 @@ function stub_project_definition { export WWW_SERVER_MAC_ADDRESS="CHANGE_ME_REQUIRED" export BTCPAYSERVER_MAC_ADDRESS="CHANGE_ME_REQUIRED" -# export BTC_CHAIN=mainnet -export PRIMARY_DOMAIN="CHANGE_ME" -export OTHER_SITES_LIST="" +export BTC_CHAIN="regtest|testnet|mainnet" +export PRIMARY_DOMAIN="domain0.tld" +export OTHER_SITES_LIST="domain1.tld,domain2.tld,domain3.tld" + EOL chmod 0744 "$PROJECT_DEFINITION_PATH" @@ -526,6 +527,11 @@ if [ "$VPS_HOSTING_TARGET" = lxd ]; then # let's provision our primary domain first. export DOMAIN_NAME="$PRIMARY_DOMAIN" + + # we deploy the WWW and btcpay server under the PRIMARY_DOMAIN. + export DEPLOY_WWW_SERVER=true + export DEPLOY_BTCPAY_SERVER=true + export SITE_PATH="$SITES_PATH/$DOMAIN_NAME" export PRIMARY_WWW_FQDN="$WWW_HOSTNAME.$DOMAIN_NAME" diff --git a/deployment/www/go.sh b/deployment/www/go.sh index 7b21f0c..49ccd63 100755 --- a/deployment/www/go.sh +++ b/deployment/www/go.sh @@ -114,12 +114,12 @@ if [ "$DEPLOY_ONION_SITE" = true ]; then # fi fi +# nginx gets deployed first since it "owns" the docker networks of downstream services. ./stub/nginx_yml.sh +# next run our application stub logic. These deploy the apps too if configured to do so. ./stub/ghost_yml.sh - ./stub/nextcloud_yml.sh - ./stub/gitea_yml.sh diff --git a/deployment/www/restore_path.sh b/deployment/www/restore_path.sh index ef5891c..44aa2a2 100755 --- a/deployment/www/restore_path.sh +++ b/deployment/www/restore_path.sh @@ -12,7 +12,7 @@ fi RESPONSE= read -r -p "Are you sure you want to restore the local path '$LOCAL_BACKUP_PATH' to the remote server at '$PRIMARY_WWW_FQDN' (y/n)": RESPONSE -if [ "$RESPONSE" != y ]; then +if [ "$RESPONSE" != "y" ]; then echo "STOPPING." exit 0 fi diff --git a/deployment/www/stop_docker_stacks.sh b/deployment/www/stop_docker_stacks.sh index ed6477c..a4dae82 100755 --- a/deployment/www/stop_docker_stacks.sh +++ b/deployment/www/stop_docker_stacks.sh @@ -60,10 +60,6 @@ if docker stack list --format "{{.Name}}" | grep -q reverse-proxy; then # wait for all docker containers to stop. # TODO see if there's a way to check for this. sleep 7 - - docker system prune -f - - sleep 2 fi # generate the certs and grab a backup diff --git a/deployment/www/stub/nginx_config.sh b/deployment/www/stub/nginx_config.sh index 0668f89..3c0106e 100755 --- a/deployment/www/stub/nginx_config.sh +++ b/deployment/www/stub/nginx_config.sh @@ -24,7 +24,6 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do source "$SITE_PATH/site_definition" source ../../../domain_env.sh - echo "Doing DOMAIN_NAME: $DOMAIN_NAME" if [ $iteration = 0 ]; then cat >>"$NGINX_CONF_PATH" < /dev/null && pwd )"