From a5c881a4d0f9fd3ce500d2687a3095ab232a36a5 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Tue, 7 Apr 2026 15:36:43 +0200 Subject: [PATCH] fix: skip bootstrap on subsequent restarts if already complete Check for spaClientId and m2mClientSecret in the cached bootstrap file. If both exist, exit immediately instead of re-running all phases. Delete /data/logto-bootstrap.json to force a re-run. Co-Authored-By: Claude Opus 4.6 (1M context) --- docker/logto-bootstrap.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/logto-bootstrap.sh b/docker/logto-bootstrap.sh index 481d3ce..730515b 100644 --- a/docker/logto-bootstrap.sh +++ b/docker/logto-bootstrap.sh @@ -58,7 +58,12 @@ apk add --no-cache jq curl >/dev/null 2>&1 if [ -f "$BOOTSTRAP_FILE" ]; then CACHED_M2M_SECRET=$(jq -r '.m2mClientSecret // empty' "$BOOTSTRAP_FILE" 2>/dev/null) CACHED_TRAD_SECRET=$(jq -r '.tradAppSecret // empty' "$BOOTSTRAP_FILE" 2>/dev/null) + CACHED_SPA_ID=$(jq -r '.spaClientId // empty' "$BOOTSTRAP_FILE" 2>/dev/null) log "Found cached bootstrap file" + if [ -n "$CACHED_M2M_SECRET" ] && [ -n "$CACHED_SPA_ID" ]; then + log "Bootstrap already complete — skipping. Delete $BOOTSTRAP_FILE to force re-run." + exit 0 + fi fi # ============================================================