Skip to content

Commit 33f5658

Browse files
tridgeclaude
andcommitted
migrate_to_systemd.sh: skip LE cert dir check when SP_SKIP_NGINX=1
The cert dir is only referenced when the script writes a new nginx vhost. With SP_SKIP_NGINX=1 the existing nginx config is the source of truth and the cert may live at a different LE name (e.g. support.ardupilot.org's cert is at live/neon.ardupilot.org/ because that's the host that originally requested it). Conditional the check on SP_SKIP_NGINX so support.ardupilot.org doesn't fail preflight. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ec92c3a commit 33f5658

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

scripts/migrate_to_systemd.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,15 @@ CERT="/etc/letsencrypt/live/$SP_DOMAIN"
6060

6161
[ -d "$SRC" ] || { echo "missing source dir $SRC" >&2; exit 1; }
6262
[ -d "$DATA" ] || { echo "missing data dir $DATA — keys.tdb must live there" >&2; exit 1; }
63-
[ -d "$CERT" ] || { echo "missing LE cert dir $CERT" >&2; exit 1; }
63+
# Only require the cert when we're going to write the nginx vhost
64+
# (which references $CERT/fullchain.pem + privkey.pem). With
65+
# SP_SKIP_NGINX=1 nginx is already correctly configured and the cert
66+
# may live at a different LE name (e.g. live/neon.ardupilot.org/
67+
# rather than live/$SP_DOMAIN/), so the existing nginx config is the
68+
# source of truth.
69+
if [ "${SP_SKIP_NGINX:-}" != "1" ]; then
70+
[ -d "$CERT" ] || { echo "missing LE cert dir $CERT" >&2; exit 1; }
71+
fi
6472
[ -f "$SRC/systemd/supportproxy.service" ] \
6573
|| { echo "missing $SRC/systemd/supportproxy.service — run scripts/update_server.sh first" >&2; exit 1; }
6674
[ -f "$SRC/start_webadmin.sh" ] \

0 commit comments

Comments
 (0)