From 45287d66b322fe532fbd6c1bcb9c888a6cf3fe7e Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Wed, 18 Feb 2026 12:45:21 -0700 Subject: [PATCH] feat: add fungiswag.jeffemmett.com as custom domain for Fungi Flows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- backend/app/main.py | 2 +- docker-compose.yml | 4 ++-- frontend/middleware.ts | 4 +++- spaces/fungiflows/space.yaml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/app/main.py b/backend/app/main.py index ba4529c..96bb77e 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -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=["*"], diff --git a/docker-compose.yml b/docker-compose.yml index 05d135e..f5ffff4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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" diff --git a/frontend/middleware.ts b/frontend/middleware.ts index ccebeba..c74f5f1 100644 --- a/frontend/middleware.ts +++ b/frontend/middleware.ts @@ -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") { diff --git a/spaces/fungiflows/space.yaml b/spaces/fungiflows/space.yaml index 86f640c..c892412 100644 --- a/spaces/fungiflows/space.yaml +++ b/spaces/fungiflows/space.yaml @@ -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: