From 7f6be51e7dc41ada7c4e0c62766420898c650349 Mon Sep 17 00:00:00 2001 From: James Lal Date: Wed, 10 Jun 2026 18:24:31 -0600 Subject: [PATCH] Guard staging env against inheriting the production route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wrangler v3 inherits top-level [[routes]] into named environments — a staging deploy on 2026-06-10 attached relay.attn.sh to attn-relay-staging, contradicting the comment that claimed routes are not inherited. Explicit routes = [] opts staging out; production reclaimed the domain on its next deploy. Co-Authored-By: Claude Fable 5 --- relay/wrangler.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/relay/wrangler.toml b/relay/wrangler.toml index a790e4f..62e1418 100644 --- a/relay/wrangler.toml +++ b/relay/wrangler.toml @@ -56,13 +56,16 @@ ALLOWED_BROWSER_ORIGINS = "https://attn.sh,https://staging.attn.sh" # Staging deploys to a DISTINCT worker so `wrangler deploy --env staging` can # NEVER overwrite the production "attn-relay" worker or take its relay.attn.sh -# route. Named-environment routes are not inherited from the top level, so -# staging is workers.dev-only. Durable Object namespaces are per-worker, so +# route. CAUTION: wrangler v3 DOES inherit top-level `routes` into named +# environments (observed 2026-06-10: a staging deploy attached relay.attn.sh +# to attn-relay-staging) — the explicit `routes = []` below opts staging out, +# keeping it workers.dev-only. Durable Object namespaces are per-worker, so # staging rooms are isolated from prod. (The R2 bucket is shared by name, but # blobs are keyed by roomId, so staging + prod objects never collide.) [env.staging] name = "attn-relay-staging" workers_dev = true +routes = [] [env.staging.vars] # vars are NOT inherited by named environments, so the full set is repeated