feat(cloudflared): split auth.mana.how — /api/* → mana-auth, rest → mana-auth-web

Auth portal is now live: API calls (Better Auth endpoints) still hit
mana-auth (:3001) directly; all UI routes (login, register, reset,
verify-email) are served by the new mana-auth-web SvelteKit app on
host port 3042.

Also updates the duplicate-hostname validator to allow path-based split
routing rules for the same hostname.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-05-11 18:49:49 +02:00
parent bf8353ea8a
commit d3d9271426
2 changed files with 17 additions and 6 deletions

View file

@ -131,11 +131,15 @@ if (!Array.isArray(ingress)) {
err(
`${where}: hostname "${r.hostname}" looks invalid (lowercase, dot-separated, no spaces)`
);
} else if (seen.has(r.hostname)) {
err(
`${where}: duplicate hostname "${r.hostname}" (also at ingress[${seen.get(r.hostname)}])`
);
} else {
} else if (seen.has(r.hostname) && !r.path) {
// Duplicate hostnames are allowed when the earlier rule uses a `path:`
// matcher (path-based split routing, e.g. /api/* → backend, rest → UI).
// Only flag true duplicates: same hostname, neither rule has a path.
const prevIdx = seen.get(r.hostname);
if (!ingress[prevIdx].path) {
err(`${where}: duplicate hostname "${r.hostname}" (also at ingress[${prevIdx}])`);
}
} else if (!seen.has(r.hostname)) {
seen.set(r.hostname, i);
}
}