Setting ENVIRONMENT_NAME (and optionally ENVIRONMENT_COLOR, a name or hex
value) gives the sidebar that colour, adds a name badge next to the title and
on the sign-in page, and prefixes the browser tab title, so a dev copy can't
be taken for production. Unset, nothing changes. The colour is validated to a
plain #rrggbb before it reaches the page's styles. A public
GET /api/environment lets the sign-in page use it too.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
From an audit of the Authentik login, run against a fake OIDC provider:
- Session fixation: the session id wasn't changed at sign-in, so one planted beforehand
(from another page on the domain) became signed in as the victim. It is regenerated now.
- Requests from another origin: SameSite=Lax doesn't stop another app on the same parent
domain, and a body-less POST (stop a guest, rotate a token) needs no preflight. Every
POST/PUT/PATCH/DELETE, and GET /auth/logout, is refused when Sec-Fetch-Site (or, for older
browsers, Origin) says it came from elsewhere. The agent endpoint is exempt: it uses a token.
- ID token signature: openid-client checks a token's claims but, as OIDC allows for a token
from the token endpoint, not its signature, so the login rested on HTTPS to Authentik
alone. The signature is now verified against the provider's published keys (jose, now a
declared dependency).
- SESSION_SECRET: production refuses to start without one (the fallback is in the source
code) and warns when it is the .env.example placeholder or short.
- Response headers: frame-ancestors 'none', X-Frame-Options, nosniff, Referrer-Policy; the
framework name is no longer sent.
- A failed sign-in shows a plain page and is audited (session / login_failed, with address
and reason, no tokens); sign-in is limited to 20 attempts a minute per address so the
audit log and session store can't be flooded.
- A failed OIDC discovery (provider down at the first sign-in) was remembered until restart;
it is retried now.
Tests run the real app against the fake provider; switching each fix off in turn makes
the matching tests fail.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Gotify and ntfy tokens, the SMTP password and the webhook secret were stored
as plain text in the settings table. They are now encrypted with the same key as
integration credentials (CREDENTIALS_ENCRYPTION_KEY), marked with an "enc:v1:"
prefix. Settings are decrypted when read and encrypted when written, so nothing
else changes; values saved before this are converted at startup.
An edit that doesn't touch a credential keeps its stored ciphertext, so a wrong or
missing key (which reads as empty) can't be made permanent by an unrelated edit.
Without a key new credentials fall back to plain storage, and the startup warning,
.env.example and the Privacy page say so.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Settings page was a "coming soon" placeholder. Port Sloth Manager's
settings feature set: Gotify/ntfy/SMTP/webhook notification channels
(each with its own test-send button), per-event toggles (DNS record
added/updated/deleted, a daily secret-expiry digest with configurable
time/timezone), and per-provider DNS badge color customization.
Settings persist in the existing `settings` key/value table via a new
settingsStore service; a notify service fans a message out to every
enabled channel. DNS record add/update/delete now fire notifications,
and a node-schedule job re-arms itself whenever the notification
settings change. Removed the now-superseded GOTIFY_URL/GOTIFY_TOKEN
env vars in favor of in-app configuration.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Monorepo (Express+TS+Drizzle/libSQL server, React+Vite+Tabler web) matching
the stack used by ScheduleTaskManager and Sloth Manager. Includes Authentik
OIDC login with local admin/operator/viewer roles (first user becomes admin),
a generalized audit log, encrypted-at-rest storage for future integration API
tokens, the DB schema for all planned modules, and the Tabler-styled app
shell/nav. Also ports the Secrets (expiry tracker) and IP Addresses (IPAM)
modules from Sloth Manager onto the new stack.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>