From 0a6cb5510c035fdc75a7b6d7ac4de20b9b077565 Mon Sep 17 00:00:00 2001 From: kitos Date: Thu, 23 Jul 2026 10:38:13 +0200 Subject: [PATCH] fix(install): generate PLATFORM_URL in install.sh, backfill on existing .env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fresh installs failed at 'docker compose up' with 'required variable PLATFORM_URL is missing a value' — the install script computes ORIGIN_URL for CORS_ORIGINS already but never wrote PLATFORM_URL, which the backend now requires with no default. Also backfills it into an existing .env (from CORS_ORIGINS) when the user chooses to keep their current config, so upgrading an older install in place doesn't hit the same error. --- scripts/install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index 7b5dd28..9d1e486 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -117,6 +117,17 @@ if [ -f "$ENV_FILE" ]; then if [[ ! $REPLY =~ ^[Yy]$ ]]; then print_info "Keeping existing configuration." SKIP_CONFIG=true + + # Older installs predate PLATFORM_URL (added when email links moved + # off the dev default) — backfill it from CORS_ORIGINS so upgrading + # in place doesn't break the backend's required-env-var check. + if ! grep -q '^PLATFORM_URL=' "$ENV_FILE" 2>/dev/null; then + EXISTING_ORIGIN=$(grep '^CORS_ORIGINS=' "$ENV_FILE" 2>/dev/null | cut -d= -f2-) + if [ -n "$EXISTING_ORIGIN" ]; then + echo "PLATFORM_URL=${EXISTING_ORIGIN}" >> "$ENV_FILE" + print_info "Added missing PLATFORM_URL=${EXISTING_ORIGIN} to existing .env" + fi + fi fi fi @@ -314,6 +325,10 @@ MINIO_BUCKET=evidence # ── CORS (allowed frontend origins) ───────────────────────────────────────── CORS_ORIGINS=${ORIGIN_URL} +# ── Emails ──────────────────────────────────────────────────────────────────── +# Base URL used to build links in outbound emails (set-password, etc). +PLATFORM_URL=${ORIGIN_URL} + # ── Frontend ───────────────────────────────────────────────────────────────── FRONTEND_PORT=${FRONTEND_PORT}