From 34711550fcfca4b78065d44a15d61c5706b8cec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Sun, 3 May 2026 22:38:38 +0200 Subject: [PATCH 1/2] Move persistent staging off port 3100 to avoid Loki conflict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Loki binds 10.0.0.2:3100 on the vSwitch interface so the BRouter host can ship logs in. Persistent staging was trying to publish 0.0.0.0:3100 which conflicts because Linux refuses 0.0.0.0:

when any specific-interface :

is already in use. Move staging journal to 3110, planner to 3111. PR previews are unaffected — they're already on 3200+2N. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/cd-staging.yml | 7 +++++-- CLAUDE.md | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd-staging.yml b/.github/workflows/cd-staging.yml index 5169f55..39e22f7 100644 --- a/.github/workflows/cd-staging.yml +++ b/.github/workflows/cd-staging.yml @@ -106,8 +106,11 @@ jobs: { echo "DOMAIN=staging.trails.cool" echo "STAGING_DATABASE=trails_staging" - echo "JOURNAL_HOST_PORT=3100" - echo "PLANNER_HOST_PORT=3101" + # Loki binds 10.0.0.2:3100 on the vSwitch interface, so the + # staging stack can't share 3100 — see CLAUDE.md "Staging & + # Previews" port table. + echo "JOURNAL_HOST_PORT=3110" + echo "PLANNER_HOST_PORT=3111" echo "JOURNAL_IMAGE_TAG=staging" echo "PLANNER_IMAGE_TAG=staging" echo "SENTRY_RELEASE=${{ github.sha }}" diff --git a/CLAUDE.md b/CLAUDE.md index 5d99430..a1332cf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -229,8 +229,8 @@ A persistent staging stack and ephemeral PR previews share the flagship server w PR previews are **journal-only** — their `PLANNER_URL` points at the persistent staging planner so we don't pay 256MB per preview for an extra planner. The persistent staging planner's CSP allows `connect-src wss://*.staging.trails.cool` so PR-preview journals can talk to it. -**Port scheme** (host's loopback, reverse-proxied by Caddy via `host.docker.internal`): -- Persistent staging: journal `3100`, planner `3101` +**Port scheme** (host-published, reverse-proxied by Caddy via `host.docker.internal`): +- Persistent staging: journal `3110`, planner `3111` (3100 collides with Loki on the vSwitch interface) - PR `` preview: journal `3200 + 2N`, planner `3201 + 2N` (planner unused for previews) **Compose project namespacing** keeps each preview isolated: From e93cfd2adb90dae1093dd6c0448f746a0811773e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Sun, 3 May 2026 22:39:16 +0200 Subject: [PATCH 2/2] Trigger cd-staging on its own config changes + workflow_dispatch So a port bump or compose edit doesn't sit unapplied until the next apps/ push, and so persistent staging can be redeployed manually without forcing a no-op apps/ change. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/cd-staging.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-staging.yml b/.github/workflows/cd-staging.yml index 39e22f7..265a0b3 100644 --- a/.github/workflows/cd-staging.yml +++ b/.github/workflows/cd-staging.yml @@ -12,6 +12,10 @@ on: - "apps/**" - "packages/**" - "pnpm-lock.yaml" + # Also redeploy when the staging plumbing itself changes, so a port + # bump or compose edit doesn't sit unapplied until the next apps/ push. + - "infrastructure/docker-compose.staging.yml" + - ".github/workflows/cd-staging.yml" pull_request: types: [opened, synchronize, reopened, closed] paths: @@ -88,10 +92,10 @@ jobs: secrets: | SENTRY_AUTH_TOKEN=/tmp/sentry_token - # ── Deploy persistent staging (main push) ──────────────────────────── + # ── Deploy persistent staging (main push or manual dispatch) ───────── deploy-staging: name: Deploy Staging - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' needs: [build-images] runs-on: ubuntu-latest environment: production