Skip to content

Settings

Most configuration is stored in the database and edited on the Settings page. The environment holds only what has to be read before the database can be: the session key, the connection string, and what Docker Compose itself needs. The full list of both is in the README.

The search field at the top of the Settings overview finds a setting by what it is called or by the words someone might use for it: smtp finds Email, prometheus finds Metrics & monitoring, redis finds the HTTP cache storage, mfa finds Two-factor sign-in. It also reaches the pages that configure the instance outside the settings sections - Backup and restore and its portable configuration, audit streaming, settings history, the WAF’s tuning, per-host modes and exclusions, blocked sources and the sign-in overview - and the environment variables each section reads. The same index answers the command palette (Ctrl/Cmd+K) from any page.

Stored value → environment variable → default, in that order. Until a deployment has been through setup nothing is stored, so every setting resolves from the variable it always did and an upgrade changes nothing. Once a value is saved it wins, and the variable can come out of .env. Each field shows which layer its current value came from, and the Settings overview marks the ones still set in the environment.

A stored value that no longer validates is ignored with a warning and falls through to the next layer, rather than taking the app down.

SETTINGS_ENV_OVERRIDE names variables that override a stored value instead of only filling in for a missing one. It exists for the two settings that can lock you out of the instance holding them - OIDC-only mode saved on before OAuth works, and a public URL that no longer matches the registered redirect URI. Set it, restart, fix the value in Settings, and take the variable off the list.

Saving a form does not reach Caddy. It stages the change, and the header of every settings screen says how many changes are pending and in which sections, because one change set spans them all: DNS edited on one page and geo blocking on another is one apply, not two. The staged set belongs to the account that made it - another administrator’s pending edits are neither shown nor applied with yours.

Review lists what is staged and shows the diff of the Caddy config it would produce, rendered from the staged values with credentials masked. Settings that do not touch the Caddy config say so instead. Any change can be undone from the sheet, or the whole set discarded. Applying writes the values to the database and reloads Caddy once, however many forms were touched. A few forms save straight away instead, because their real work is not a settings write: a Caddy rebuild, starting ClickHouse, the favicon, and the instance, sign-in and agent fields that never reach the Caddy config.

Every apply is a revision. It records each committed key’s value before and after, who applied it, and whether Caddy accepted the config - a refused apply is kept too, marked failed. The review sheet shows the most recent ones; Settings → History lists them all, newest first.

Pick any two revisions to compare. The page shows which settings differ and the Caddy config diff between them, rendered against today’s hosts so that only the settings differ between the two sides. Restore stages the values a revision had, on top of anything already pending, and sends them through the same review as any other change - so the config diff is seen before anything reaches Caddy, and history only ever grows.

Revisions applied before values were recorded are listed but cannot be compared or restored.

Settings → Backup downloads the whole configuration as one file: hosts, certificates and their keys, access lists, users and their two-factor secrets, groups, API tokens, agents and every setting. The audit log and the settings history can be included too; the settings history brings the host history with it.

  • The passphrase is the only protection. Everything the database keeps encrypted is decrypted into the file, and the file is sealed with the passphrase - at least 12 characters - using scrypt and AES-256-GCM. That lets it restore onto a new machine whose SESSION_SECRET is different, and it also makes losing the passphrase the same as losing the backup.
  • Restoring replaces everything, after showing what the file holds and when it was made. The configuration being replaced is saved first, under the same passphrase, to backups/ on the controller’s data volume. Everyone is signed out afterwards, and restoring needs a sign-in from the last ten minutes.
  • Moving to a new machine? Turn off Keep the agent pairings: the new machine’s agents pair afresh, and hosts that were pinned to the old agents are served by every agent.
  • Not in the file: who is signed in, the certificates Caddy has issued (it issues them again - mind your certificate authority’s rate limits with many hosts), analytics, and the GeoIP databases.
  • A backup from a newer version is refused. An older one restores onto a newer version, with anything added since taking its default.

Backups can also run on a schedule, to an S3-compatible bucket or a local folder, and be restored from there: see Backups. For a script of your own, POST /api/v1/backup with an admin API token and {"passphrase": "..."} returns the same file; add "auditLog": true or "settingsHistory": true to include those. Restoring is only in the dashboard.

Under the backup on the same page, Export configuration writes the configuration as a JSON file you can read, review or keep in a repository, rather than one sealed blob. Pick the parts:

  • proxy and L4 hosts, with their agent pins, mTLS rules and sign-in grants;
  • access lists, their users and their rules;
  • certificates (imported ones with their keys), CAs, client certificates and mTLS roles;
  • groups, their members, IdP mappings and grants;
  • WAF presets, CRS plugins, WAF exclusions and blocked sources;
  • settings, except the dashboard host, which is this instance’s own address.

Users, API tokens, sessions, agents, the audit log and saved analytics views stay behind. Each secret in the file (certificate keys, access-list password hashes, credentials in settings and host options) is sealed on its own with the passphrase, by the same scrypt and AES-256-GCM scheme as a backup, and bound to the row, column and place it was sealed in.

The rest stays readable, but not editable: the file carries an HMAC over everything in it under a key derived from the same passphrase, so a file changed by anyone without the passphrase - a provider’s endpoint repointed, a group member added, the version it claims - is refused before anything in it is read. Edit the source and export again instead.

Import configuration merges instead of replacing:

  • A dry run comes first. It lists every row it would create, update or skip and why, and writes nothing. Importing plans again against what is there by then.
  • Rows match by what identifies them: hosts, lists, certificates and groups by name, client certificates by fingerprint, exclusions by rule and scope, settings by key. Ids are remapped, including those inside host options (WAF presets, CRS plugins, location rules’ access lists, trusted mTLS roles and certificates).
  • Grants map to users by email, and agent pins to agents by their agent ID. An agent re-paired under a new ID is still found by name, but only when one agent here and one in the file have it.
  • A shared name matches nothing. Two lists called office, here or in the file, are both skipped as ambiguous, and so is whatever points at them, rather than one being picked by id.
  • Rows are checked as a save checks them: host names, upstreams and options (the WAF directive lint and raw JSON included), access-list rules and denial responses, blocked sources and WAF exclusions. A row that fails is skipped with the reason the form would give, and two hosts in the file claiming one domain are a conflict like any other. A DNS credential carried in the clear is encrypted on arrival.
  • Revocation is one-way. A client certificate revoked here stays revoked, whatever an older export says; the preview lists the field as kept.
  • The preview shows each change: the fields before and after, credentials masked as in the audit log, with references named rather than numbered, for creates as well as updates.
  • Nothing is overwritten silently. A host whose domain another host here already serves is skipped and named. So is a host pinned to an agent, or protected by a list, this instance does not have: dropping the reference would widen where it is served or who gets in. A group member or grant naming someone missing is left out and listed.
  • Limits: 50 MiB, administrators only, and both the export and the import are audited. The export and the import itself, not the dry run, need a sign-in from the last 10 minutes, as a restore does; over the API they need a token with the Same as my role scope.

GraphQL has the same operations: exportConfig, previewConfigImport and applyConfigImport, with the file as base64.