Skip to main content

Operations

Imported component documentation. Source: melodee-project/melodee-auth-ui at commit 0bf9bd04697609fc3d8b82eb933b1d1d29e84059. Version 2026.11.0-rc.0. License MIT. Status: A0–A10 implemented and verified on a disposable real API 1.0.0 stack; not published, tagged or deployed. This is the component's committed documentation, not proof of a distribution release or production qualification.

This page is operator guidance for the Melodee Auth UI. It assumes the API owns identity, sessions and policy; the UI is a static same-origin front end.

Serve the right topology​

browser ── HTTPS ── nginx (this image) ─┬─ /auth/* and assets → static bundle
├─ /api/* → melodee-api
├─ /rest, /System, /Users, /Items,
│ /Audio, /Sessions, /Playlists →
│ compatibility adapters
└─ /healthz → melodee-api

Requirements:

  • one public HTTPS origin for the UI and API (MELODEE_PUBLIC_BASE_URL must match it byte-for-byte);
  • the proxy must preserve Origin, Sec-Fetch-*, cookies and the client IP chain; rewriting or stripping Origin/Sec-Fetch-* downgrades a browser to the native bearer response shape;
  • no CORS fallback and no cross-origin API base URL;
  • unknown /api/ paths must remain API responses, never the SPA shell;
  • /rest/ and the other compatibility paths must not fall through to the SPA if OpenSubsonic/Jellyfin players are expected on this origin.

The shipped deploy/nginx/default.conf.template implements this. Review it against your own front door.

Required API configuration​

MELODEE_PUBLIC_BASE_URL=https://auth.example.test
MELODEE_DATABASE_URL=postgres://...
MELODEE_SMTP_HOST=...
MELODEE_SMTP_FROM=...
# Passkeys
MELODEE_WEBAUTHN_RP_ID=example.test
MELODEE_WEBAUTHN_ORIGIN=https://auth.example.test
MELODEE_WEBAUTHN_RP_NAME="Melodee"
# Optional Google
MELODEE_GOOGLE_CLIENT_ID=...
MELODEE_GOOGLE_CLIENT_SECRET=...
MELODEE_GOOGLE_REDIRECT_URI=https://auth.example.test/api/v1/auth/google/sign-in/callback
MELODEE_AUTH_BROWSER_RETURN_URL=https://auth.example.test/auth/account?google=signedin

The API must have a writable storage volume for passkey protected objects. Capability discovery reports passkey.protectedStorageWritable, and the UI disables enrollment with an operator message when it is false.

The Auth UI build accepts the public Google client ID:

docker build --build-arg VITE_GOOGLE_CLIENT_ID="$MELODEE_GOOGLE_CLIENT_ID" ...

It never embeds the client secret. If the build omits the client ID, Google browser sign-in still works when the API is configured, but browser identity linking is unavailable and the page explains why.

TLS and headers​

Terminate TLS at the nginx image or at an upstream proxy. If an upstream proxy terminates TLS, ensure it preserves the headers and that the Auth UI origin still matches MELODEE_PUBLIC_BASE_URL.

The image sends these actual response headers:

  • Content-Security-Policy with default-src 'self', frame-ancestors 'none', no unsafe-eval, and narrowly scoped Google Identity Services origins for the explicit linking action;
  • X-Frame-Options: DENY;
  • X-Content-Type-Options: nosniff;
  • Referrer-Policy: no-referrer;
  • a narrow Permissions-Policy;
  • Cross-Origin-Opener-Policy: same-origin-allow-popups (required by the Google prompt; cross-origin popups cannot read this document);
  • Cross-Origin-Resource-Policy: same-origin;
  • Cache-Control: no-store on auth pages and API responses; immutable caching only for content-hashed /assets/.

style-src 'unsafe-inline' is required by Mantine runtime style props. Scripts remain same-origin apart from Google's documented GIS origin.

HSTS is intentionally left to the site-wide proxy policy after the public hostname and renewal plan are settled.

Logging and privacy​

  • nginx access logs use $uri, not $request_uri, so magic-link tokens, device codes, recovery tokens and query strings are not written.
  • Do not add a log format that records query strings, request bodies, cookies or authorization headers.
  • The API must not log request bodies, provider responses or one-time secrets.
  • Error-reporting/telemetry must not capture URLs with tokens or DOM content from secret-reveal dialogs. The UI itself has no analytics, external fonts, CDNs or service worker.
  • Browser traces/screenshots should be off for sensitive flows; the integration harness records only sanitized JSON summaries.

Installation bootstrap​

An empty installation has no sign-in path. Provision the first administrator with the local melodee-api bootstrap command, then complete the one-time challenge at /auth/bootstrap. The challenge is shown once and stored only as a digest. Do not paste it into tickets, chat, CI logs or shell history. Immediately enroll a passkey or verify a contact. See recovery and bootstrap.

Google​

Browser Google sign-in requires:

  • MELODEE_GOOGLE_CLIENT_ID and MELODEE_GOOGLE_CLIENT_SECRET,
  • MELODEE_GOOGLE_REDIRECT_URI pointing at /api/v1/auth/google/sign-in/callback,
  • MELODEE_AUTH_BROWSER_RETURN_URL on the same origin.

Browser Google linking additionally requires the UI to be built with the same public client ID (VITE_GOOGLE_CLIENT_ID) and relies on Google Identity Services. See Google and the recorded upstream limitations in contracts/API-BASELINE.md.

Provider requests and callback failures are visible to the API; the UI surfaces what it can and never invents a linked identity. Keep live Google qualification and client-secret custody in the normal operator secret process.

Compatibility credentials​

OpenSubsonic/Jellyfin players authenticate with a per-device credential created and revoked in /auth/account/compatibility. These are not interactive sessions. The shipped proxy forwards the compatibility protocol paths to the API; if your front door does not, players must use an origin that does.

Sessions, recovery and revocation​

  • Browser sessions are HttpOnly cookies; the UI refreshes once on 401 and treats a second 401 as re-authentication.
  • Users can revoke other sessions or sign out other session families.
  • Account recovery revokes every existing session family and issues a fresh one.
  • The current session stays signed in after revoking others.
  • Automation credentials are independent of browser sessions; revoking an automation credential does not sign out a browser, and vice versa.

Versioning and release metadata​

The application version is CalVer YYYY.M.PATCH (current candidate 2026.11.0-rc.0). The API contract range is declared separately in release-metadata.json (>=1.0.0 <2.0.0). /version.json and the OCI labels report the application version, release status, contract range and source revision. The footer displays the application version and supported API range.

Verify an image:

docker inspect melodee-auth-ui:2026.11.0-rc.0 --format '{{json .Config.Labels}}'
docker run --rm --entrypoint sh melodee-auth-ui:2026.11.0-rc.0 \
-c 'cat /usr/share/nginx/html/version.json'

Upgrade and rollback​

The UI is stateless. An upgrade is a new image and a restart; a rollback is the previous image. Cookie/session compatibility is owned by the API. Before upgrading:

  1. confirm the new image's declared API contract includes the API in service;
  2. take a database backup and confirm the API's protected-object volume is backed up;
  3. deploy the UI and API together if the API contract changed;
  4. verify /version.json, headers, sign-in and one account mutation;
  5. keep the previous image digest available for rollback.

Do not roll back only one side of an incompatible API/UI contract change. See release and upgrade.

Qualification boundary​

Passing the ordinary gate and the disposable suite is not production qualification. Independent security review, live Google, physical/synchronized passkeys, real client platforms and owner release authorization remain external.