fix(admin): port-override AFTER infisical injection (was hijacking backend port)
Bug: admin-app PM2-service kaperte port 3016 vom backend-staging. Backend ging in crash-loop (22 restarts), nginx routete /api auf admin Nuxt-app → HTTP 302 redirect zu /login → Frontend „JSON Parse error: Unexpected character: <". Root cause: backend-staging-Infisical-env hat PORT=3016, NITRO_PORT=3016 als secrets. Admin-Script exportierte PORT=3017 VOR `infisical run` — aber Infisical overrode mit den 3016-secrets innerhalb seines bash-c block. Fix: PORT/NITRO_PORT/NITRO_HOST exports MOVED inside `bash -c` block, AFTER infisical-env-injection. Hard-override gewinnt jetzt. Verified manual: - pm2 stop+delete rebreak-admin-staging → port 3016 frei - pm2 restart rebreak-staging → online auf 3016 - curl /api/auth/me → HTTP 401 JSON (war 302 HTML) - Backend wieder healthy Pending: nächster admin-deploy via GH-Actions wird sich mit fixed script auf 3017 starten. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1d8da7d547
commit
59e97e004d
@ -40,6 +40,15 @@ exec infisical run \
|
||||
--token="$INFISICAL_TOKEN" \
|
||||
-- bash -c '
|
||||
set -e
|
||||
# ─── KRITISCH: Port-Override NACH Infisical-Injection ──────────────────
|
||||
# Backend-staging-Infisical-env hat PORT=3016, NITRO_PORT=3016. Wenn admin-app
|
||||
# selbe Infisical-vars erbt → kollidiert mit Backend (port-hijack, 22 restarts).
|
||||
# Lösung: nach infisical-env-injection Port HARD overriden auf 3017.
|
||||
export PORT=3017
|
||||
export NITRO_PORT=3017
|
||||
export NITRO_HOST=127.0.0.1
|
||||
export NODE_ENV=production
|
||||
|
||||
# ─── Infisical-Vars auf Nuxt-runtimeConfig-Namen mappen ──────────────
|
||||
# Supabase (public -- aus Infisical staging geladen, selbe Keys wie backend)
|
||||
[[ -n "${SUPABASE_URL:-}" ]] && export NUXT_PUBLIC_SUPABASE_URL="$SUPABASE_URL"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user