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:
parent
54ccbbc350
commit
45287d66b3
|
|
@ -35,7 +35,7 @@ app = FastAPI(
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
allow_origins=settings.cors_origins_list,
|
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_credentials=True,
|
||||||
allow_methods=["*"],
|
allow_methods=["*"],
|
||||||
allow_headers=["*"],
|
allow_headers=["*"],
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ services:
|
||||||
- traefik-public
|
- traefik-public
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "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.routers.rswag-api.entrypoints=web"
|
||||||
- "traefik.http.services.rswag-api.loadbalancer.server.port=8000"
|
- "traefik.http.services.rswag-api.loadbalancer.server.port=8000"
|
||||||
- "traefik.docker.network=traefik-public"
|
- "traefik.docker.network=traefik-public"
|
||||||
|
|
@ -85,7 +85,7 @@ services:
|
||||||
- traefik-public
|
- traefik-public
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "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.routers.rswag-web.entrypoints=web"
|
||||||
- "traefik.http.services.rswag-web.loadbalancer.server.port=3000"
|
- "traefik.http.services.rswag-web.loadbalancer.server.port=3000"
|
||||||
- "traefik.docker.network=traefik-public"
|
- "traefik.docker.network=traefik-public"
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,12 @@ export function middleware(request: NextRequest) {
|
||||||
const host = request.headers.get("host") || "";
|
const host = request.headers.get("host") || "";
|
||||||
const hostname = host.split(":")[0].toLowerCase();
|
const hostname = host.split(":")[0].toLowerCase();
|
||||||
|
|
||||||
// Determine space from subdomain
|
// Determine space from subdomain or custom domain
|
||||||
let spaceId = "default";
|
let spaceId = "default";
|
||||||
if (hostname.endsWith(".rswag.online")) {
|
if (hostname.endsWith(".rswag.online")) {
|
||||||
spaceId = hostname.replace(".rswag.online", "");
|
spaceId = hostname.replace(".rswag.online", "");
|
||||||
|
} else if (hostname === "fungiswag.jeffemmett.com") {
|
||||||
|
spaceId = "fungiflows";
|
||||||
}
|
}
|
||||||
// Local dev: check for space query param as override
|
// Local dev: check for space query param as override
|
||||||
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ id: fungiflows
|
||||||
name: "Fungi Flows"
|
name: "Fungi Flows"
|
||||||
tagline: "If Hip Hop Ate Magic Mushrooms"
|
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."
|
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."
|
footer_text: "Fungi Flows. Spreading spores of consciousness."
|
||||||
|
|
||||||
theme:
|
theme:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue