Skip to content

Commit ec92c3a

Browse files
tridgeclaude
andcommitted
scripts/migrate_to_systemd.sh: SP_SKIP_NGINX flag
For hosts where nginx + /dashboard + certbot-via-nginx are already configured correctly AND the existing vhost has custom directives that must NOT be overwritten (e.g. support.ardupilot.org's ^/$ -> ardupilot.org/dev/docs/support_proxy.html redirect), pass SP_SKIP_NGINX=1 to run only the webui.json + systemd + verify steps. Skips apache stop, nginx apt install, vhost write, landing page write, nginx -t/reload, and the certbot renewer migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d21a293 commit ec92c3a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

scripts/migrate_to_systemd.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919
# away. Re-run with this flag once the new
2020
# stack has bedded in for a day or two.
2121
#
22+
# SP_SKIP_NGINX=1 — skip everything web-server-related (steps
23+
# 1-6: apache stop, nginx install, vhost
24+
# write, landing page, nginx reload, certbot
25+
# renewer migration). Use on hosts where
26+
# nginx + /dashboard are already configured
27+
# correctly AND have a custom vhost (e.g. a
28+
# root redirect) that must be preserved.
29+
# Run only the webui.json / systemd / verify
30+
# steps.
31+
#
2232
# What it does:
2333
# 1. Sanity-check the user, home dir, source dir, data dir, cert dir.
2434
# 2. Stop + disable apache2 (preserves binary + config for rollback).
@@ -62,6 +72,10 @@ SUDO=
6272
echo "===== migrate $SP_DOMAIN (user=$SP_USER home=$HOMEDIR) ====="
6373
echo
6474

75+
if [ "${SP_SKIP_NGINX:-}" = "1" ]; then
76+
echo "--- SP_SKIP_NGINX=1: skipping steps 1-6 (apache stop, nginx install, vhost, landing page, reload, certbot renewer migration) ---"
77+
else
78+
6579
# ----- 1. Stop + disable apache2 -------------------------------------
6680
echo "--- step 1/9: stop and disable apache2 (preserved on disk for rollback) ---"
6781
if systemctl is-enabled apache2 >/dev/null 2>&1 \
@@ -186,6 +200,8 @@ else
186200
echo "no $RENEW_CONF — cert may have been issued differently; check certbot manually"
187201
fi
188202

203+
fi # end of SP_SKIP_NGINX guard
204+
189205
# ----- 7. webui.json -------------------------------------------------
190206
echo
191207
echo "--- step 7/9: update $DATA/webui.json (host=127.0.0.1 + behind_proxy) ---"

0 commit comments

Comments
 (0)