Deployment and reverse proxy
e0ed63ec61a069159a1482d1ecd11dd480a6a60f. Version 2026.11.0-rc.0. License MIT. Status: release candidate; not published, deployed, production-qualified or security-reviewed. This is the component's committed documentation, not proof of a distribution release or production qualification.
This document describes a supportable deployment shape. It does not authorize a deployment: the release candidate has not been published, production-qualified or security-reviewed.
Same-origin shape
Serve three applications on one HTTPS origin:
| Path | Service |
|---|---|
/api/… | melodee-api |
/auth/… | separately built melodee-auth-ui |
/admin/… | this application |
The API deployment examples already provision /auth/ and /admin/ on the same
origin. Cookies, CSRF origin checks and the browser session therefore remain
same-origin. Do not build a cross-origin API URL into the bundle and do not add a
credentialed CORS fallback.
Build
npm ci
npm run gate
npm run build
The build emits dist/ with index.html, hashed assets and version.json.
VITE_BASE_PATH defaults to /admin/; the router basename follows Vite's base.
SOURCE_REVISION is recorded in version.json and the System Status screen.
Configuration
| Variable | Default | Use |
|---|---|---|
VITE_API_PROXY | http://127.0.0.1:8080 | Development proxy target only |
VITE_AUTH_UI_BASE | /auth | Same-origin Auth UI path used for sign-in links |
VITE_ENVIRONMENT_LABEL | unset | Optional visible environment label; never invent one |
VITE_BASE_PATH | /admin/ | Public base path |
SOURCE_REVISION | development | Build provenance string |
No API secret, provider key, account identifier or token belongs in a VITE_*
variable; Vite variables are public.
Reverse proxy requirements
- Serve
/admin/with SPA fallback to/admin/index.html. - Proxy
/api/to the API unchanged, preservingOrigin,Sec-Fetch-*andX-Forwarded-*as required by the API's same-origin checks. - Do not cache
index.html,version.jsonor API responses with credentials. - Cache hashed
/admin/assets/*immutably. - Terminate TLS with a valid certificate. HSTS is required for production.
- Apply a restrictive Content-Security-Policy. The current build needs
default-src 'self',img-src 'self' data:,style-src 'self' 'unsafe-inline'(Mantine runtime styles),script-src 'self',connect-src 'self',font-src 'self',frame-ancestors 'none',base-uri 'self'andform-action 'self'. Re-verify after any dependency change; do not add a remote font/CDN or wildcard connect source. - Set
X-Content-Type-Options: nosniff,Referrer-Policy: no-referrerandX-Frame-Options: DENY/frame-ancestors 'none'. - Do not strip or rewrite the CSRF or session cookies.
Operational verification
After a candidate deployment:
GET /healthzreturns the expected service/version./admin/loads with assets and no console errors.- Unauthenticated access redirects to the Auth UI handoff; no sign-in form is rendered by the admin app.
- Sign in through the Auth UI, return to
/admin/, and verify the session status and capability probes. - Open System Status; the served OpenAPI hash/version must match the pinned artifact. Treat a mismatch as a release blocker.
- Verify a safe read and a non-destructive mutation in a disposable environment. Never test destructive actions against production data.
- Confirm CSP/security headers and that no secrets appear in the page, network
log or
version.json.
Rollback
Keep the previous static artifact by content hash. Because this UI owns no server-side state, rollback is a static artifact switch; do not roll back the API contract independently of the pinned artifact without re-running the drift gate.
Known deployment blockers
- Auth UI post-sign-in continuation to
/admin/…is not implemented upstream. - Independent security review and production qualification are outstanding.
- No publication, registry push, image publication or deployment is authorized by the repository state.