Authentication¶
By default (authentication required, set in the GUI) every business request needs an Authorization: Bearer <token> header. Otherwise it is rejected with 401 (missing_token or invalid_token). No token exists after the first start; business API access stays denied until the admin creates one in the GUI.
Administration login¶
The root page redirects to login. The first start generates a one-time password for admin (8 characters, exactly one special character) and prints it in clear text in the boxed FIRST START block on stdout, so it can be copied from the console. It appears only on this initial bootstrap, never on later restarts; if missed, reset the admin account (there is no file to read it from). Console output is persisted and centrally collected (systemd, Docker, Kubernetes), so the password may remain in log history, a deliberately accepted tradeoff.
The first login permits only password change (at least 8 characters) and logout. Admin sessions use HttpOnly cookies, CSRF protection and login throttling. Disabling API authentication never disables GUI authentication. No token is issued automatically; PATs are created only by the admin in the GUI.
Under Settings → Session, set the GUI session lifetime to 0–7 days. The factory default is 1 day from sign-in. 0 disables automatic server-side expiry for new GUI logins; the browser still controls how long it keeps the session cookie, and logout or a password change invalidates the session. Shortening the lifetime also limits existing sessions from their original sign-in time. Increasing it or choosing 0 does not revive an expired session or extend the cookie or original expiry of an existing finite session; sign in again to use the new duration. This setting does not affect PATs or their separate expiry choices.
Personal access tokens¶
A PAT has the form pat_ followed by 40 base62 characters and a 6 character CRC32 checksum (base62), so a mistyped token is rejected without a lookup. The administration API (/admin/api/...) accepts a session or a PAT. read tokens get 403 on the settings and token endpoints and on every change; listing, creating or deleting tokens needs a signed-in session.
GET /admin/api/settings is readable with a read/write PAT but omits the session-only values. A real change of the following needs a signed-in session; a PAT gets 403 (re-sending the current value is accepted):
- authentication and proxy trust:
auth_required,session_max_days,trusted_proxies,bind_address,behind_reverse_proxy,forwarded_header,metrics_require_token,metrics_trusted_sources,docs_public; enable_write_support,devices,bind_port,log_level;- export target and credentials:
db_type, the InfluxDB/QuestDB host, port, TLS and credential settings, and the QuestDB retention days (a PAT must not redirect metrics or shorten retention). These stay readable for a PAT; enable_metrics_endpointwhile scrapes would not require a token.
Create named PATs on the API tokens page with a read or read/write role and an expiry of 30 days, 90 days (preselected), 1 year or never. Copy the secret with Copy when it is shown: it cannot be retrieved later, and Done and the close button stay disabled until the copy succeeded. The list shows role badge, creation, last use (at most once per minute; Never if unused) and expiry; revoke tokens there. Records live in the encrypted SQLite admin database; raw secrets are not stored.
| Role | Permits |
|---|---|
read | Reading values, metrics, devices, readiness |
read/write | Everything above, plus writes, actions and the vendor diagnostics area |
Tokens are looked up by a keyed digest and appear in logs only as a short non-reversible id. The business rate limit counts per token id and source address. Admin GUI requests of a logged-in browser session are counted separately (ADMIN_SESSION_RATE_LIMIT_*, see Environment), so GUI polling and API clients never share a budget.
Opt-out¶
Disabling authentication in the GUI is an explicit operator opt-out. A request without a token is then accepted with the role read/write; a request that sends a token must still be valid. The server logs a SECURITY warning at every start.
Danger
Everyone who can reach the port may read all values and, with write support enabled, write every metric in the allowlist. Use the opt-out only on loopback or behind a reverse proxy that authenticates callers.