Configuration

All Cerberus API settings — required and optional — and the Cerberus UI build settings.

How settings are read

Every API setting is read as the environment variable CERBERUS_<NAME> first, falling back to Cerberus:<Property> in appsettings.json. Environment variables win. Keep nonsecret values in appsettings.json (see docs/operations/appsettings.example.json) and supply credentials through protected configuration.

flowchart LR
    Env["CERBERUS_* environment variables"] -->|wins| Opt["CerberusOptions"]
    Json["appsettings.json<br/>Cerberus:Property"] -->|fallback| Opt
    Opt --> Val{"CerberusOptionsValidator"}
    Val -- valid --> Run([start])
    Val -- invalid --> Fail(["exit — prints the failing<br/>setting names only"])

Run --validate-configuration to check a configuration without starting the API.

Required settings

SettingRule
CERBERUS_DATA_DATABASETYPEMust be PostgreSql.
CERBERUS_DATA_CONNECTIONSTRINGThe PostgreSQL connection string.
CERBERUS_HEIMDALL_BASE_URLHTTPS, no user info. Loopback HTTP is allowed only outside production.
CERBERUS_HEIMDALL_SCOPE_IDThe GUID of the Heimdall scope Cerberus uses.
CERBERUS_HEIMDALL_SERVICE_CREDENTIALThe narrow scope-owner service credential (registration, readiness, restore checks).
CERBERUS_AUTH_ISSUERExpected issuer of Heimdall tokens.
CERBERUS_AUTH_AUDIENCEExpected audience of person tokens.
CERBERUS_AUTH_APPLICATION_AUDIENCEExpected audience of application tokens. Must differ from the person audience.
CERBERUS_AUTH_VALIDATION_SECRETThe HS256 token-validation secret. At least 32 printable ASCII characters.
CERBERUS_REGISTRATION_FINGERPRINT_KEYHMAC key for registration retries. At least 32 printable ASCII characters, different from the auth secrets. Keep it durable across replicas, restores and signing-key rotation.
CERBERUS_BACKUP_RETENTIONHow long backups are kept. TimeSpan, positive.
CERBERUS_LOG_RETENTIONHow long logs are kept. TimeSpan, positive.
CERBERUS_SYNC_RETENTIONLifetime of a synchronization stream. TimeSpan, positive.
CERBERUS_RETENTION_INTERVALHow often the retention worker runs. TimeSpan, between 1 ms and 4 294 967 294 ms.
CERBERUS_BACKUP_PATHFully qualified backup directory.
CERBERUS_ERASURE_LEDGER_PATHFully qualified erasure-ledger directory, not inside the backup path.
CERBERUS_MAX_REQUEST_BYTESMaximum request body size, > 0. Larger requests get an empty 413.
CERBERUS_MAX_PAGE_SIZEMaximum page size for list and sync endpoints, > 0.

TimeSpans use the invariant c format: d.hh:mm:ss, e.g. 7.00:00:00 or 00:05:00.

Optional settings

SettingEffect
CERBERUS_AUTH_VALIDATION_SECRET_PREVIOUSThe previous validation secret, accepted during a key rotation.
CERBERUS_OFFLINE_LEASE_ISSUER and CERBERUS_OFFLINE_LEASE_PRIVATE_KEY_PEMThe issuer and P-256 private key that sign offline leases. Both or neither: without them, POST /api/offline-authorizations answers 503.
CERBERUS_OPERATIONAL_PERSON_IDSComma-separated canonical UUIDs of persons allowed to read /health/details. Empty means nobody.
CERBERUS_OPERATIONAL_APPLICATION_IDSThe same, for application identities.
CERBERUS_RESTORE_REQUIREDtrue on an instance restored from backup: traffic is refused until reconciliation passes. Absent means false; an invalid value fails validation.

Example values

The approved beta inputs (not defaults):

{
  "Cerberus": {
    "BackupRetention": "7.00:00:00",
    "LogRetention": "7.00:00:00",
    "SyncRetention": "30.00:00:00",
    "RetentionInterval": "00:05:00",
    "BackupPath": "/srv/cerberus/backups",
    "ErasureLedgerPath": "/srv/cerberus-erasure-ledger",
    "MaxRequestBytes": 1048576,
    "MaxPageSize": 100
  }
}

Fixed rules

These are not configurable:

RuleValue
Trash and closure windows720 hours (30 days), checked against database time
Proof challenge validity60 seconds, single use
Fresh authenticationA token signed less than 60 seconds ago
Initial offline renewal24 hours, enabled (changeable per account)
Heimdall response bound10 seconds for the whole response; no redirects
Readiness probe budget5 seconds per component

Client settings

The Cerberus UI is configured at build time:

SettingWhereEffect
CERBERUS_API_BASE_URL--dart-define or the Docker build argumentThe API instance. Empty: the app starts at /setup. Public — never a secret.
Build modeflutter build / flutter runPlain HTTP only in debug builds.

User choices — instance override, storage mode, device profile, theme, auto-lock (default 5 minutes) and clipboard clearing (default 30 seconds) — are preferences on native targets and memory on the web. The local, homologation and production environments differ only in the API address and the build mode; no code branches on the environment.