Storage backend configuration reference
This reference targets Caddy Security v1.8.1 and the pinned storage companions.
Each Caddyfile declaration goes inside the global security block. The
declaration registers a named backend. The portal, provider, policy or worker
selects that name separately.
Declarations and consumers
Use sqlite, consul or dynamodb for DRIVER where the capability is
listed in the companion inventory. Declaration
fields receive literal values after Caddy's {$ENV_VAR} substitution.
Quote paths and values containing spaces. Keep the store name, realm, record and
deployment namespace distinct. Define each field once.
| Caddyfile declaration | Native JSON list under apps.security | Consumer |
|---|---|---|
identity store DRIVER NAME | identity_stores | enable identity store NAME on the portal |
identity provider DRIVER NAME | identity_providers | enable identity provider NAME on the portal. The trusted ticket issuer opens compatible storage separately. |
credential authenticator DRIVER NAME | credential_authenticators | with api key auth portal NAME realm REALM on the policy |
secrets DRIVER NAME | secrets_managers | secrets:NAME:FIELD in a supported provisioning field |
messaging DRIVER provider NAME | messaging_providers | email_provider NAME for an email-confirmed workflow, plus a delivery worker |
user registration DRIVER NAME | registration_workflows | enable user registration NAME on the portal |
oauth login store DRIVER NAME | oauth_login_stores | login store NAME namespace DEPLOYMENT on the upstream OAuth provider |
token refresh store DRIVER NAME | refresh_stores | store NAME inside the portal's token refresh block |
documents store NAME with driver DRIVER in the block | documents_stores | enable documents api and documents api store NAME on the portal |
Each native list entry has name and driver. SQLite and Consul use flat
category fields, such as realm, capacity and string timeout. DynamoDB
places the connection fields in a dynamodb object. DynamoDB File Vault adds
an s3 object. Durations in those two AWS objects are integers in nanoseconds.
Caddy writes refresh limits as max_sessions and max_rotations in JSON
for all drivers. Compare the exact output of authcrunch adapt --adapter caddyfile --config Caddyfile --pretty
when maintaining native JSON. Run validation in an isolated environment before
provisioning these resources. Caddy app module declarations.
SQLite fields
All nine adapters require an absolute path on a supported local Unix
filesystem. Use a private service-owned directory and mode-0600 database and
sidecar files. timeout accepts 1ms through 30s. The default is 1s,
except File Vault defaults to 5s.
| Backend | Additional required fields | Additional optional fields and defaults |
|---|---|---|
| Accounts | realm | None |
| Application tickets | realm, public_origin, issuer_url | base_path /auth, cookie_name AUTHP_PROVIDER_SESSION_ID, attach to local identity store NAME |
| API keys | realm | None |
| Secrets | record | None |
| Outbox | None | delivery NAME selects a named SMTP provider. Omission leaves delivery to an external worker. |
| Registration | identity_store, realm, email_provider, public_origin | base_path /auth |
| Pending OAuth | None | capacity 10000, range 1–100000 across the database |
| Refresh | None | max sessions 10000, max rotations 1024, each 1–100000 |
| File Vault | driver sqlite | None |
Provision account, API-key and secret databases before serving. The workflow, outbox, pending OAuth, tickets, refresh and vault adapters can initialize their own storage. SQLite account rows, secret values, queued messages and transaction evidence need private backups. Passwords are hashed. File Vault files and private vault material are encrypted by its browser client.
The ticket database caps outstanding rows at 1024. API keys have a fixed 10000-row cap. The outbox holds at most 1000 messages. Registration retains up to 10000 enrollment IDs including completed or spent history. Secret records allow up to 64 KiB of encoded payload and 128 top-level fields, with at most 1024 records in a database. Rate, expiry and capacity checks are separate. See the SQLite bundle guide and engine configuration for the release-specific contracts.
Consul fields
All six adapters borrow the ready Consul client, global key prefix and AES key
from storage consul. Each accepts an optional relative prefix and
timeout from 1ms through 30s, default 3s. The backend prefixes below
sit under the global Caddy prefix.
| Backend | Default backend prefix | Additional required fields | Additional optional fields and defaults |
|---|---|---|---|
| Accounts | security/identities | realm | capacity 1000, range 1–10000 |
| Application tickets | security/tickets | realm, public_origin, issuer_url | capacity 1024, range 1–10000. base_path /auth, cookie_name AUTHP_PROVIDER_SESSION_ID, attach to local identity store NAME. |
| API keys | security/credentials | realm | capacity 1000, range 1–10000 |
| Secrets | security/secrets | record | None |
| Pending OAuth | security/oauth-logins | None | capacity 1000, range 1–1000 |
| Refresh | security/refresh | None | max sessions 1000, max rotations 128, each 1–10000 |
Match names, limits, key material and effective KV prefixes across replicas. The account, ticket, API-key, refresh and secret backends also have a 384 KiB plaintext document ceiling. A whole-document update can hit its byte ceiling before the entry limit. Pending OAuth has an independent record/index model. See Consul deployment for provisioning and recovery.
DynamoDB and S3 fields
All nine DynamoDB adapters require table. Optional shared fields are
namespace (default authcrunch), region, endpoint and timeout
(default 5s, range 1ms–1m). Use the SDK's normal region and credential
sources when you omit the region. An endpoint accepts HTTPS, or HTTP to a
numeric loopback address for local tests. Use a direct endpoint with no URL
credentials, query, fragment or path prefix.
| Backend | Additional required fields | Additional optional fields and defaults |
|---|---|---|
| Accounts | realm | None |
| Application tickets | realm, public_origin, issuer_url | base_path /auth, cookie_name AUTHP_PROVIDER_SESSION_ID. Caddy uses a per-instance attachment. |
| API keys | realm | None |
| Secrets | record | None |
| Outbox | None | The separate worker selects the queue and SMTP configuration. |
| Registration | identity_store, realm, email_provider, public_origin | base_path /auth |
| Pending OAuth | None | capacity 10000, range 1–100000 |
| Refresh | None | max_sessions 10000, max_rotations 1024, each 1–100000. The portal refresh block still uses max sessions and max rotations. |
| File Vault | driver dynamodb, s3_bucket | s3_prefix authcrunch-documents, s3_timeout 10s (range 1ms–1m), s3_region, s3_endpoint, s3_expected_bucket_owner |
Specify the 12-digit S3 account with s3_expected_bucket_owner for AWS
deployments. The S3 region defaults to the one selected by the SDK. A custom
S3 endpoint uses path-style requests and must implement the required checksum,
conditional-write and versioning operations. Use numeric loopback for plain
HTTP tests. The Caddy DynamoDB ticket adapter does not accept the Go parser's
explicit local attachment option. See the DynamoDB deployment guide
and the S3 bucket requirements.
Check name and storage boundaries
- Use literal module settings or Caddyfile
{$NAME}substitution. Use provisioning placeholders only in supported consumer fields. A manager needs its connection settings before it can supply secret values. - Ticket and registration URLs refer to the browser-facing portal mount and
HTTPS origin. Use a lowercase canonical host without the implicit
:443suffix. End the origin at the hostname or explicit nondefault port. Ticket issuers include their own HTTPS path and must differ from the callback. - Match the refresh backend's limits in the portal. Match the OAuth backend and provider transaction namespace across peers. Starting a new namespace affects lookup of existing pending records.
- Enabling Documents requires a declared store. Each selected store name belongs to one enabled portal. An unused declaration opens no Documents backend, although its driver and settings still have to load. A distinct name does not make the same SQLite file or the same bound vault safe to reuse.
- Keep a named SQLite vault independent of all other state paths and sidecars. Where a companion explicitly supports sharing a file, compatible consumers need the same format, feature settings and limits. Preserve names, realms, IDs, paths and keys when moving a compatible deployment.
- CLI operations that create keys, slots, accounts or queue entries can have uncertain outcomes. Reconcile through trusted reads or feature-specific recovery before issuing a replacement.
Reuse a SQLite file only where supported
A SQLite file and its -journal, -wal and -shm names form a storage
namespace. Caddy compares resolved paths and existing file identities.
A hard link with a different name can still collide because SQLite derives
different sidecar names from the aliases. Use a single canonical opening path.
Compatible pending OAuth declarations can share one canonical file when their capacities match. Compatible refresh declarations can share it when both session and rotation limits match. Both features still enforce their own namespaces and authority. A named SQLite vault file cannot be selected by two different portals, and must not overlap any other managed database, key read or managed state or OAuth-registration directory. A compatible stateless replacement may reopen the same canonical vault file with the same vault binding. Persistent roots retain their independent stop/start requirement. Review storage recovery before changing a path shared by a running process. File and sidecar admission.
Agentic Prompts
Trace a declaration to its consumer
Read the upstream root AGENTS.md files first:
https://github.com/greenpau/caddy-security/blob/v1.8.1/AGENTS.md
https://github.com/greenpau/go-authcrunch/blob/v1.7.1/AGENTS.md
Read applicable scoped AGENTS.md files, then the relevant skills and linked
implementation and tests under:
https://github.com/greenpau/caddy-security/tree/v1.8.1/.codex/skills
https://github.com/greenpau/go-authcrunch/tree/v1.7.1/.codex/skills
Distinguish main from the versions I deploy. Resolve disagreements using
versioned code and tests. Ask me to paste an inaccessible source. Use synthetic
or redacted inputs and flag unverified behavior.
Secondary context: https://docs.authcrunch.com/docs/operations/backend-configuration
Map one existing deployment from its Caddyfile declaration to the adapted JSON and selected consumer. Explain the difference between the driver, backend name, realm and namespace.
Compare refresh grammar
Read the upstream root AGENTS.md files first:
https://github.com/greenpau/caddy-security/blob/v1.8.1/AGENTS.md
https://github.com/greenpau/go-authcrunch/blob/v1.7.1/AGENTS.md
Read applicable scoped AGENTS.md files, then the relevant skills and linked
implementation and tests under:
https://github.com/greenpau/caddy-security/tree/v1.8.1/.codex/skills
https://github.com/greenpau/go-authcrunch/tree/v1.7.1/.codex/skills
Distinguish main from the versions I deploy. Resolve disagreements using
versioned code and tests. Ask me to paste an inaccessible source. Use synthetic
or redacted inputs and flag unverified behavior.
Secondary context: https://docs.authcrunch.com/docs/operations/backend-configuration
Compare SQLite, Consul and DynamoDB refresh store limits and lexical grammar. Show how the portal matches each backend and what still depends on root state.
Diagnose an unavailable named vault
Read the upstream root AGENTS.md files first:
https://github.com/greenpau/caddy-security/blob/v1.8.1/AGENTS.md
https://github.com/greenpau/go-authcrunch/blob/v1.7.1/AGENTS.md
Read applicable scoped AGENTS.md files, then the relevant skills and linked
implementation and tests under:
https://github.com/greenpau/caddy-security/tree/v1.8.1/.codex/skills
https://github.com/greenpau/go-authcrunch/tree/v1.7.1/.codex/skills
Distinguish main from the versions I deploy. Resolve disagreements using
versioned code and tests. Ask me to paste an inaccessible source. Use synthetic
or redacted inputs and flag unverified behavior.
Secondary context: https://docs.authcrunch.com/docs/operations/backend-configuration
Given an unavailable File Vault using a synthetic configuration, determine whether the driver registration, named selection, database path, realm or portal binding failed.
Size pending login storage
Read the upstream root AGENTS.md files first:
https://github.com/greenpau/caddy-security/blob/v1.8.1/AGENTS.md
https://github.com/greenpau/go-authcrunch/blob/v1.7.1/AGENTS.md
Read applicable scoped AGENTS.md files, then the relevant skills and linked
implementation and tests under:
https://github.com/greenpau/caddy-security/tree/v1.8.1/.codex/skills
https://github.com/greenpau/go-authcrunch/tree/v1.7.1/.codex/skills
Distinguish main from the versions I deploy. Resolve disagreements using
versioned code and tests. Ask me to paste an inaccessible source. Use synthetic
or redacted inputs and flag unverified behavior.
Secondary context: https://docs.authcrunch.com/docs/operations/backend-configuration
Choose defaults and bounds for each upstream OAuth storage driver. Identify which capacity applies and what requirements a peer must match.
Prepare a native JSON review
Read the upstream root AGENTS.md files first:
https://github.com/greenpau/caddy-security/blob/v1.8.1/AGENTS.md
https://github.com/greenpau/go-authcrunch/blob/v1.7.1/AGENTS.md
Read applicable scoped AGENTS.md files, then the relevant skills and linked
implementation and tests under:
https://github.com/greenpau/caddy-security/tree/v1.8.1/.codex/skills
https://github.com/greenpau/go-authcrunch/tree/v1.7.1/.codex/skills
Distinguish main from the versions I deploy. Resolve disagreements using
versioned code and tests. Ask me to paste an inaccessible source. Use synthetic
or redacted inputs and flag unverified behavior.
Secondary context: https://docs.authcrunch.com/docs/operations/backend-configuration
Take a backend of my choice and identify the Caddy native JSON list, required fields and duration representation. Illustrate how to confirm the output of adapt without opening storage.
Source Code References
- Search the core library and Caddy host for the corresponding runtime and host contracts.
- Host app module definitions lists the native JSON namespaces and module drivers.
- SQLite release guide lists SQLite adapter registration and declaration shapes.
- Consul release guide lists storage borrowing and Consul prefix/limit configuration.
- DynamoDB release guide covers the DynamoDB and S3 grammar at the released tag.