Repository navigation
Description
Not a missing pattern — one missing hostname
The staging stack from epic #923 Phase 6 is in place and working. Confirmed in DNS:
| host | record | serves |
|---|---|---|
api-test.nemar.org |
AAAA 100:: |
nemar-cli Worker (dev) |
data-test.nemar.org |
AAAA 100:: |
nemar-cli Worker (dev) |
zarr-test.nemar.org |
AAAA 100:: |
nemar-cli Worker (dev) |
test.nemar.org |
CNAME -> nemar-website-test.pages.dev |
website staging |
The gap is narrower than "staging can't test routing". Production runs two website hosts — nemar.org (marketing) and app.nemar.org (app) — while staging runs one. The two-host split (#46) and the apex cutover (#190) landed on a different axis than the staging epic, so nothing here was missed at the time; staging is simply one hostname short of mirroring production's shape.
Consequence
hostMode() in src/lib/host.ts returns "app" for APP_HOSTS, "marketing" for MARKETING_HOSTS, and "single" for everything else. test.nemar.org is in neither set, so staging always resolves to single-host mode and the entire two-host layer is inert there:
getCrossHostRedirectreturnsnullunconditionally.- The session-cookie redirect suppression from Signed-in users lose their session when following a marketing link #210 cannot be exercised.
canonicalOriginForcollapses toMARKETING_BASE_URLfor every route, so an app-vs-marketing canonical divergence is invisible by construction.
*.pages.dev previews share the property, so neither staging nor previews cover it.
Why it is worth closing
This is the class of change that broke twice on 2026-07-29:
- Apex cutover: ww2 becomes nemar.org, legacy moves to ww1, legacy URLs must keep resolving #190 —
MARKETING_BASE_URLwas flipped to the apex ahead of the DNS cutover (via Cover the rest of the legacy paths #193), so every signed-in user clicking a marketing link was 301'd onto the legacy HUBzero site. Live about four days. - Signed-in users lose their session when following a marketing link #210 / Keep marketing routes on the app host when signed in #211 — the fix could not be verified anywhere before production: not on the preview (single-host), not locally (Vite's DNS-rebinding protection rejects a spoofed
Host). It shipped on unit tests plus a post-merge check against the real hosts. A canonical/JSON-LD divergence was also caught in review by reading rather than testing, precisely because single-host mode hides it.
Ask
Add the app-host counterpart on staging, mirroring what already exists:
app-test.nemar.org(name open to preference) as a DNS record plus a custom domain on the existingnemar-website-testPages project — the same project, a second domain, exactly as production serves both hosts from one project.- Teach
host.tsabout the staging pair.APP_HOSTS/MARKETING_HOSTSare plain literals today and several helpers key off them, so prefer environment-aware host sets over hardcoding staging names into the production constants. Staging must stay non-production forisProductionHost, sonoindexandrobots.txtDisallow: /are unchanged. - Scope the staging session cookie to the new app host, mirroring production's
Domain=app.nemar.org. - Cover the staging pair in
host.test.tsalongside the production-host cases.
Out of scope
Local dev. Cross-host routing against astro dev would need server.allowedHosts plus hosts-file entries; a working staging pair is the higher-value target and needs no dev-config change.
Activity
[-]Staging can't test two-host routing: test.nemar.org resolves to single-host mode[/-][+]Staging needs an app-host counterpart so two-host routing resolves[/+]