feat: add fungiswag.jeffemmett.com as custom domain for Fungi Flows

Map fungiswag.jeffemmett.com to the fungiflows space so it can be used
independently of the rswag.online domain.

- Middleware: detect fungiswag.jeffemmett.com → fungiflows space
- Traefik: add Host rule for fungiswag.jeffemmett.com
- CORS: allow fungiswag.jeffemmett.com origin
- Space config: update domain field

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-02-18 12:45:21 -07:00
parent 54ccbbc350
commit 45287d66b3
4 changed files with 7 additions and 5 deletions

View File

@ -35,7 +35,7 @@ app = FastAPI(
app.add_middleware(
CORSMiddleware,
allow_origins=settings.cors_origins_list,
allow_origin_regex=r"https?://([\w-]+\.)?rswag\.online",
allow_origin_regex=r"https?://(([\w-]+\.)?rswag\.online|fungiswag\.jeffemmett\.com)",
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],

View File

@ -61,7 +61,7 @@ services:
- traefik-public
labels:
- "traefik.enable=true"
- "traefik.http.routers.rswag-api.rule=(Host(`rswag.online`) || HostRegexp(`{subdomain:[a-z0-9-]+}.rswag.online`)) && PathPrefix(`/api`)"
- "traefik.http.routers.rswag-api.rule=(Host(`rswag.online`) || Host(`fungiswag.jeffemmett.com`) || HostRegexp(`{subdomain:[a-z0-9-]+}.rswag.online`)) && PathPrefix(`/api`)"
- "traefik.http.routers.rswag-api.entrypoints=web"
- "traefik.http.services.rswag-api.loadbalancer.server.port=8000"
- "traefik.docker.network=traefik-public"
@ -85,7 +85,7 @@ services:
- traefik-public
labels:
- "traefik.enable=true"
- "traefik.http.routers.rswag-web.rule=Host(`rswag.online`) || HostRegexp(`{subdomain:[a-z0-9-]+}.rswag.online`)"
- "traefik.http.routers.rswag-web.rule=Host(`rswag.online`) || Host(`fungiswag.jeffemmett.com`) || HostRegexp(`{subdomain:[a-z0-9-]+}.rswag.online`)"
- "traefik.http.routers.rswag-web.entrypoints=web"
- "traefik.http.services.rswag-web.loadbalancer.server.port=3000"
- "traefik.docker.network=traefik-public"

View File

@ -5,10 +5,12 @@ export function middleware(request: NextRequest) {
const host = request.headers.get("host") || "";
const hostname = host.split(":")[0].toLowerCase();
// Determine space from subdomain
// Determine space from subdomain or custom domain
let spaceId = "default";
if (hostname.endsWith(".rswag.online")) {
spaceId = hostname.replace(".rswag.online", "");
} else if (hostname === "fungiswag.jeffemmett.com") {
spaceId = "fungiflows";
}
// Local dev: check for space query param as override
if (hostname === "localhost" || hostname === "127.0.0.1") {

View File

@ -2,7 +2,7 @@ id: fungiflows
name: "Fungi Flows"
tagline: "If Hip Hop Ate Magic Mushrooms"
description: "Psychedelic mushroom merch for the Fungi Flows movement. Hoodies, tees, stickers, and prints — spreading spores of consciousness."
domain: "fungiflows.rswag.online"
domain: "fungiswag.jeffemmett.com"
footer_text: "Fungi Flows. Spreading spores of consciousness."
theme: