Configuration
Every ferrite.toml section and key with its default, the FERRITE_* environment overrides and secrets from files.
A site is configured by ferrite.toml in its data folder. ferrite init writes one with the common keys and comments; every key not written has the default below. Unknown keys are an error, so a typo stops the site from starting rather than being ignored.
Check the file, with the environment applied exactly as serve applies it, without touching the database or the media:
ferrite config check --data ./mysite
It prints ok: mode=… database=… media=… workers=… mail=… metrics=… tls=… backup=… webhooks=… and exits 0, or lists every problem and exits 1.
Values
Sizes are a number of bytes or a string such as
"256MB","32MiB","512KB"or"1GB".KB,MBandGBmean the same asKiB,MiBandGiB(powers of 1024).Durations are a number of seconds or a string such as
"90s","10m"or"2h".Secrets (
database.url,auth.secret_key,mail.smtp_url,media.s3.access_key_idandmedia.s3.secret_access_key) can also be read from a file: writeurl_file = "/run/secrets/db_url"instead ofurl = "…". One trailing newline is removed. Setting both forms is an error.Relative paths are relative to the data folder.
Environment overrides
Every key can be set with a FERRITE_ variable: the section and key in upper case, joined by a double underscore.
FERRITE_SERVER__LISTEN=127.0.0.1:0 ferrite serve --data ./mysite
FERRITE_DATABASE__MAX_CONNECTIONS=32 ferrite config check --data ./mysite
An unknown key is an error from the environment too: FERRITE_SITE__NOPE=1 gives env:FERRITE_SITE__NOPE: unknown key.
A variable wins over the file. Its value is read as a TOML value when it is one (true, 16, ["a", "b"]), else as text; for keys that take text, the raw text is used. server.trusted_proxies and server.tls.domains also take a comma-separated list. FERRITE_LOG (the log level, for example debug; default info) and variables starting with FERRITE_TEST_ are not configuration and are never read as keys.
[site]
Key | Default | |
|---|---|---|
| required | the public URL, |
|
| used until a title is set in the admin's Settings, which wins |
|
| the same: a fallback for the Settings value |
|
| an IANA name such as |
[server]
Key | Default | |
|---|---|---|
|
| the plain HTTP address |
|
| CIDRs or addresses of reverse proxies whose |
| not set | an address for |
[server.tls]
Built-in HTTPS for solo sites (HTTPS).
Key | Default | |
|---|---|---|
|
|
|
| required with | a |
| the host of | DNS names for the certificate; must include that host |
|
|
|
|
| the HTTPS address |
| not set | an address that answers every request with a |
With mode = "off" the other keys are accepted but have no effect; config check warns about them.
[database]
Key | Default | |
|---|---|---|
|
|
|
| not set | Postgres only: keep every table in this schema (letters, digits and |
|
| |
|
| apply pending migrations when |
|
| Postgres: also apply migrations that remove things, at start |
SQLite URLs take no ? options.
[media]
Key | Default | |
|---|---|---|
|
|
|
|
| local only: the folder for the files |
|
| local only: the folder is a volume shared by every node of a cluster |
|
| the largest upload, at most |
|
| image size jobs at once per node, 1 to 16 |
|
| an upload that sends nothing for this long is cut off |
|
| remove EXIF and XMP (GPS included) from JPEG, PNG and WebP uploads |
|
| days an unused file is kept before the media clean-up deletes it, 1 to 365 |
[media.s3]
With backend = "s3":
Key | Default | |
|---|---|---|
| required | |
| required | |
| not set | for S3-compatible stores, an |
| not set | both or neither; neither uses the |
|
| a key prefix inside the bucket |
|
| allow a plain |
|
|
|
| not set | link media to this URL (the bucket or a CDN, which must allow public reads of |
| not set | how the store refuses to overwrite on copy, in object_store's form ( |
| not set ( |
|
[cluster]
Key | Default | |
|---|---|---|
|
|
|
|
| this node's name, at most 64 bytes |
| the larger of 2 and the CPU count | background jobs at once on this node, 1 to 256 |
[cache]
Key | Default | |
|---|---|---|
|
| the page cache's size |
|
| pages for signed-in visitors: |
|
| how often a node reads the changes that invalidate cached pages |
|
| how long search results stay cached, up to |
[plugins]
Key | Default | |
|---|---|---|
|
| memory per plugin call |
|
| instructions per plugin call |
|
| time per filter call while a page renders |
|
| time per action call |
|
| time all filters of one page share; between |
| the larger of 8 and 4 × the CPU count | plugin calls at once per node |
|
| failures within |
|
| |
|
| how long a page whose plugin calls failed or were marked volatile stays cached, 1 s to 1 h |
|
| which plugins installs and updates accept: |
| the official registry URL | the plugin registry index, |
| none | the registry's minisign public key; required for any registry other than the official one |
|
|
|
Cluster nodes must use the same signatures and registry values. The official registry is verified with a key built into the binary (from the releases after 0.3.0); a build without one (0.3.0 and older) has it off until registry_key is set.
[auth]
Key | Default | |
|---|---|---|
| not set | the site key, 64 hex characters ( |
The site key seals stored secrets (two-factor secrets, sealed plugin settings, reset links). A solo site without one uses <data>/secret.key, which init creates. Cluster mode requires the key here, the same on every node.
[mail]
Without this section the site sends no mail (no password reset by e-mail, no plugin notices).
Key | Default | |
|---|---|---|
| not set |
|
| required with |
|
[backup]
Scheduled backups while serve runs (Backups and moves).
Key | Default | |
|---|---|---|
|
|
|
| required unless off | a folder outside the data folder ( |
|
| snapshots (or, on Postgres, export archives) kept, 1 to 1000 |
|
| include the media files |
[webhooks]
Outgoing webhooks (Webhooks). Retries, timeouts and the log's retention are fixed; there is one switch, for development.
Key | Default | |
|---|---|---|
|
| allow |
Updated