diff --git a/VPS_SETUP_FROM_SCRATCH.md b/VPS_SETUP_FROM_SCRATCH.md index 0657d84..66b1ebe 100644 --- a/VPS_SETUP_FROM_SCRATCH.md +++ b/VPS_SETUP_FROM_SCRATCH.md @@ -115,8 +115,8 @@ Create 2 files `admin_api_url` and `admin_base_path` with URL and secret path in **When you need to source it:** Only for one-off manual `docker compose` runs (e.g. first-time start in §2.6, or starting phpMyAdmin in §4.1). You do **not** need to source it for deployment: `scripts/rolling-update.sh` loads the password from the secret file automatically when `DB_ROOT_PASSWORD` is not set. **IMPORTANT** -`Change Java memory in docker-compose.prod.yml when you know the PROD VPS characteristics.` - +- `Change Java memory in docker-compose.prod.yml when you know the PROD VPS characteristics.` +- `Change the rolling-update.sh script to match sites-enabled nginx file name for PROD when you know the domain` ### 2.4 Logging (logback) and config dir Backend uses an external **logback** config so you can change log level without rebuilding. Create the config dir and put `logback-spring.xml` there: diff --git a/scripts/rolling-update.sh b/scripts/rolling-update.sh index 947b980..821080e 100644 --- a/scripts/rolling-update.sh +++ b/scripts/rolling-update.sh @@ -44,39 +44,39 @@ COMPOSE_FILE="${PROJECT_DIR}/docker-compose.prod.yml" # Priority: sites-enabled (what Nginx actually loads) > conf.d > custom paths NGINX_CONF="${NGINX_CONF:-}" if [ -z "$NGINX_CONF" ]; then - if [ -f "/etc/nginx/sites-enabled/honey.live" ]; then - NGINX_CONF="/etc/nginx/sites-enabled/honey.live" + if [ -f "/etc/nginx/sites-enabled/testforapp.website" ]; then + NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website" log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)" - elif [ -f "/etc/nginx/sites-enabled/honey.live.conf" ]; then - NGINX_CONF="/etc/nginx/sites-enabled/honey.live.conf" + elif [ -f "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then + NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website.conf" log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)" elif [ -f "/etc/nginx/conf.d/honey.conf" ]; then NGINX_CONF="/etc/nginx/conf.d/honey.conf" log "Using Nginx config: $NGINX_CONF (conf.d)" - elif [ -f "/opt/app/nginx/honey.live.conf" ]; then - warn "Found config at /opt/app/nginx/honey.live.conf" + elif [ -f "/opt/app/nginx/testforapp.website.conf" ]; then + warn "Found config at /opt/app/nginx/testforapp.website.conf" warn "Checking if it's symlinked to /etc/nginx/sites-enabled/..." - if [ -L "/etc/nginx/sites-enabled/honey.live" ] || [ -L "/etc/nginx/sites-enabled/honey.live.conf" ]; then + if [ -L "/etc/nginx/sites-enabled/testforapp.website" ] || [ -L "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then # Find the actual target - local target=$(readlink -f /etc/nginx/sites-enabled/honey.live 2>/dev/null || readlink -f /etc/nginx/sites-enabled/honey.live.conf 2>/dev/null) + local target=$(readlink -f /etc/nginx/sites-enabled/testforapp.website 2>/dev/null || readlink -f /etc/nginx/sites-enabled/testforapp.website.conf 2>/dev/null) if [ -n "$target" ]; then NGINX_CONF="$target" log "Using Nginx config: $NGINX_CONF (symlink target)" else - NGINX_CONF="/opt/app/nginx/honey.live.conf" + NGINX_CONF="/opt/app/nginx/testforapp.website.conf" warn "Using custom path - will update this file, but you may need to copy to sites-enabled" fi else - NGINX_CONF="/opt/app/nginx/honey.live.conf" + NGINX_CONF="/opt/app/nginx/testforapp.website.conf" warn "Using custom path - will update this file, but you may need to copy to sites-enabled" fi else error "Cannot find Nginx config file." error "Searched:" - error " - /etc/nginx/sites-enabled/honey.live" - error " - /etc/nginx/sites-enabled/honey.live.conf" + error " - /etc/nginx/sites-enabled/testforapp.website" + error " - /etc/nginx/sites-enabled/testforapp.website.conf" error " - /etc/nginx/conf.d/honey.conf" - error " - /opt/app/nginx/honey.live.conf" + error " - /opt/app/nginx/testforapp.website.conf" error "" error "Please set NGINX_CONF environment variable with the correct path." exit 1 diff --git a/scripts/rolling-update.staged.sh b/scripts/rolling-update.staged.sh index 82bdb74..a6f8949 100644 --- a/scripts/rolling-update.staged.sh +++ b/scripts/rolling-update.staged.sh @@ -44,39 +44,39 @@ COMPOSE_FILE="${PROJECT_DIR}/docker-compose.staged.yml" # Priority: sites-enabled (what Nginx actually loads) > conf.d > custom paths NGINX_CONF="${NGINX_CONF:-}" if [ -z "$NGINX_CONF" ]; then - if [ -f "/etc/nginx/sites-enabled/honey.live" ]; then - NGINX_CONF="/etc/nginx/sites-enabled/honey.live" + if [ -f "/etc/nginx/sites-enabled/testforapp.website" ]; then + NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website" log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)" - elif [ -f "/etc/nginx/sites-enabled/honey.live.conf" ]; then - NGINX_CONF="/etc/nginx/sites-enabled/honey.live.conf" + elif [ -f "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then + NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website.conf" log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)" elif [ -f "/etc/nginx/conf.d/honey.conf" ]; then NGINX_CONF="/etc/nginx/conf.d/honey.conf" log "Using Nginx config: $NGINX_CONF (conf.d)" - elif [ -f "/opt/app/nginx/honey.live.conf" ]; then - warn "Found config at /opt/app/nginx/honey.live.conf" + elif [ -f "/opt/app/nginx/testforapp.website.conf" ]; then + warn "Found config at /opt/app/nginx/testforapp.website.conf" warn "Checking if it's symlinked to /etc/nginx/sites-enabled/..." - if [ -L "/etc/nginx/sites-enabled/honey.live" ] || [ -L "/etc/nginx/sites-enabled/honey.live.conf" ]; then + if [ -L "/etc/nginx/sites-enabled/testforapp.website" ] || [ -L "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then # Find the actual target - local target=$(readlink -f /etc/nginx/sites-enabled/honey.live 2>/dev/null || readlink -f /etc/nginx/sites-enabled/honey.live.conf 2>/dev/null) + local target=$(readlink -f /etc/nginx/sites-enabled/testforapp.website 2>/dev/null || readlink -f /etc/nginx/sites-enabled/testforapp.website.conf 2>/dev/null) if [ -n "$target" ]; then NGINX_CONF="$target" log "Using Nginx config: $NGINX_CONF (symlink target)" else - NGINX_CONF="/opt/app/nginx/honey.live.conf" + NGINX_CONF="/opt/app/nginx/testforapp.website.conf" warn "Using custom path - will update this file, but you may need to copy to sites-enabled" fi else - NGINX_CONF="/opt/app/nginx/honey.live.conf" + NGINX_CONF="/opt/app/nginx/testforapp.website.conf" warn "Using custom path - will update this file, but you may need to copy to sites-enabled" fi else error "Cannot find Nginx config file." error "Searched:" - error " - /etc/nginx/sites-enabled/honey.live" - error " - /etc/nginx/sites-enabled/honey.live.conf" + error " - /etc/nginx/sites-enabled/testforapp.website" + error " - /etc/nginx/sites-enabled/testforapp.website.conf" error " - /etc/nginx/conf.d/honey.conf" - error " - /opt/app/nginx/honey.live.conf" + error " - /opt/app/nginx/testforapp.website.conf" error "" error "Please set NGINX_CONF environment variable with the correct path." exit 1