Authentication and admin keys¶
What it does¶
Optional auth for exposing the port (NAS, reverse proxy). Off by default.
Configure¶
Set both in .env:
DISCOVER_API_KEYS=key-for-app-1,key-for-app-2 # /api/v1 and the legacy read API
DISCOVER_ADMIN_KEY=a-long-random-admin-key # /api/admin/*, topic changes, Settings
Generate keys:
How it works¶
- Clients send
Authorization: Bearer <key>orX-API-Key: <key>. - With
DISCOVER_ADMIN_KEYset, Settings (and every button that changes something) redirects to/login, which sets a signed, HttpOnly, SameSite=Strict cookie for 30 days; the admin key also works as an API key. - Feed and story pages stay readable, and the id-only
/api/profiles/{slug}/streamand/publishedendpoints the pages use stay open. - Keys are compared in constant time, never logged and never stored; startup logs only whether auth is enabled.
- Put a TLS reverse proxy in front if the port leaves your LAN.