refactor(domain): inject domains via env vars, never hardcode or fall back #192
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-235-mokosh-domain-rebrand"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Supersedes the earlier
mokosh.systemsrebrand. The application runs on a different brand domain per environment (staging ona8n.systems, production onpsa.systems), so no single domain may be baked into code or used as a fallback. Every domain is injected at runtime via environment variables.This PR does two things: (1) removes the last hardcoded brand-domain literals from code, and (2) corrects all docs/comments/examples to the real staging/prod split and the canonical
api.msp.<tld>API scheme.Canonical names
a8n.systemspsa.systemsmsp.a8n.systemsmsp.psa.systemsapi.msp.a8n.systemsapi.msp.psa.systemsThe API host is
api.msp.<tld>(prependapi.to the SPA host), matching the e2e derivation and the router'sapi.msp.strip. The outdatedmsp-api.<tld>form is gone.Code changes (zero hardcoded brand domains remain)
src/api/router.rs:not_a_frontendno longer falls back to the literalhttps://a8n.systems. It now takes the env-injectedclient_origin(CLIENT_ORIGIN) as the fallback when theHostheader cannot be parsed; the host-derived link (stripapi.msp.) stays primary.e2e/lib/env.ts:E2E_BASE_URLis now required (added to the preflightREQUIREDlist) instead of defaulting to a hardcoded domain. CI already injects it from Forgejo secrets.e2e/scripts/health-check.mjs,e2e/scripts/wait-for-deploy.mjs: fail loud whenE2E_BASE_URLis unset instead of defaulting to a domain literal.Docs / comments / examples corrected
src/main.rs,src/modules/auth/oidc_rs.rs:CORS_ORIGIN/OIDC_ISSUER/OIDC_AUDIENCEdoc-comment and error-message examples now use the staging names.dev-docs/milestone-1-handoff.md: target-topology table, OAuth redirect URIs, Cloudflare DNS, and verification curls restored to the staging/prod split andapi.msp.<tld>scheme.e2e/.env.example,e2e/README.md,e2e/playwright.config.ts,e2e/tests/global.setup.ts: harness host comments and the requiredE2E_BASE_URLexample.Verification
just check(cargo check + clippy + fmt --check) passes green.git grep mokosh.systemsandgit grep msp-api.return nothing; noa8n.systems/psa.systemsstring literal remains in any.rsfile.Note
The branch name (
feat/pms-235-mokosh-domain-rebrand) still says "rebrand"; the work is no longer a rebrand. Left as-is to avoid recreating the PR, but the title/body now reflect the actual change.docs(domain): rebrand a8n.systems references to mokosh.systems (Bucket A)to refactor(domain): inject domains via env vars, never hardcode or fall back