Configuration Reference
The complete schema of ferrixd.toml. Every table and field, with types, defaults, and validation rules. For a guided walkthrough, see the configuration guide.
Unknown keys are errors
Configuration is fail-closed: every table rejects unknown keys. A typo prevents startup instead of being silently ignored. Validate with ferrixd check after every edit.
Conventions below: required fields have no default; everything else may be omitted. Durations are integer seconds; sizes are bytes.
[server] — required
Identity and listeners.
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | advertised server name, used in numerics and message prefixes |
network | string | "ferrixnet" | network name (ISUPPORT NETWORK=) |
description | string | the network name | free-text server description shown in LINKS and WHOIS and sent to linked servers |
icon | string | unset | network icon URL (IRCv3 draft/network-icon), advertised as ISUPPORT draft/ICON=; use an HTTPS URL to a (square) image, optionally with a {size} template |
chantypes | string | "#&" | accepted channel prefixes (CHANTYPES): any non-repeating subset of # (network), & (server-local, never linked), + (modeless) |
casemapping | "ascii" | "rfc1459" | "ascii" | nick/channel case folding; must be identical network-wide |
motd | array of string | [] | message of the day, one entry per line; REHASH-reloadable |
cloak_key | string | unset | HMAC key enabling host cloaking; omit to disable; keep secret and identical on linked servers |
sid | string | "42F" | server ID for S2S; unique per network |
link_bind | socket address | unset | inbound S2S listener, e.g. "0.0.0.0:6666" |
tls_bind | socket address | required | primary TLS listener, e.g. "0.0.0.0:6697" |
plain_bind | socket address | unset | plaintext listener; loopback-only unless allow_plain_nonlocal |
allow_plain_nonlocal | bool | false | permit a non-loopback plain_bind or ws_bind (e.g. behind a local TLS-terminating proxy) |
wss_bind | socket address | unset | secure WebSocket (wss://) listener; terminates TLS with the [tls] certificate, then negotiates the text.ircv3.net/binary.ircv3.net subprotocols |
ws_bind | socket address | unset | plaintext WebSocket (ws://) listener; loopback-only unless allow_plain_nonlocal (prefer wss_bind) |
password | string | unset | connection password: clients must send a matching PASS before registration (464 otherwise); REHASH-reloadable |
sts | table | unset | IRCv3 strict transport security policy: { port = 6697, duration = 2592000, preload = false }; plaintext connections are told the TLS port, TLS connections the duration (seconds; 0 clears the policy) |
Validation: a non-loopback plain_bind or ws_bind with allow_plain_nonlocal = false is a configuration error.
[tls] — required
| Field | Type | Default | Description |
|---|---|---|---|
cert | path | unset | PEM certificate chain (leaf first) |
key | path | unset | PEM private key |
self_signed_dev | bool | false | generate an ephemeral self-signed cert at startup — development only; ignored when cert/key are set |
dev_hostnames | array of string | ["localhost"] | SANs for the dev certificate |
reload_interval_secs | int | 60 | how often the certificate/key files are checked; a changed, valid pair is installed live (a broken one is ignored). 0 disables |
Validation: cert and key must be set together; if neither is set, [tls.acme] must be configured or self_signed_dev must be true.
[tls.acme] — optional
Built-in certificate management (RFC 8555, HTTP-01). Replaces cert/key. See TLS → built-in ACME.
| Field | Type | Default | Description |
|---|---|---|---|
domains | array of string | required | DNS names on the certificate (no wildcards) |
dir | path | required | holds account.key, cert.pem, key.pem (created 0700, keys 0600) |
http_bind | socket address | required | HTTP-01 responder; must be reachable as port 80 of every domain |
accept_terms | bool | false | must be true — agreement to the CA's terms of service |
contact | array of string | [] | account contacts, e.g. mailto:admin@example.org |
directory | string | Let's Encrypt production | the CA's ACME directory URL |
renew_before_days | int | 30 | renew when the certificate expires within this many days |
[limits] — optional
All fields optional; defaults shown. See also Limits & Defaults for the hardcoded constants.
| Field | Type | Default | Description |
|---|---|---|---|
max_tag_bytes | int | 4094 | budget for a client's message-tags section (the IRCv3 client limit); longer input is refused with 417 ERR_INPUTTOOLONG |
max_body_bytes | int | 512 | wire budget for the message body (RFC 1459) |
max_line_bytes | int | 8704 | fatal frame length — longer frames drop the connection; must be ≥ max_tag_bytes + max_body_bytes |
registration_timeout_secs | int | 30 | seconds a connection may stay unregistered |
handshake_timeout_secs | int | 15 | TLS handshake budget |
ping_interval_secs | int | 120 | idle seconds before a server PING; a second missed interval disconnects |
max_clients_per_ip | int | 10 | simultaneous connections per source IP |
max_channels | int | 50 | channels per client (CHANLIMIT); opers exempt |
sendq_lines | int | 2048 | outbound queue depth in lines; overflow disconnects (SendQ exceeded) |
recv_burst | int | 20 | inbound token-bucket burst allowance |
recv_rate | int | 10 | sustained inbound commands/second; exhaustion disconnects (Excess Flood) |
history_len | int | 500 | retained messages per chathistory target; 0 = current-run only |
history_max_targets | int | 50000 | cap on distinct in-memory history targets; LRU-evicted beyond |
[[accounts]] — optional, repeatable
SASL seed accounts. See Accounts & SASL.
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | account name |
password | string | unset | plaintext password, Argon2id-hashed at startup — development convenience |
password_hash | string | unset | precomputed Argon2 PHC string (ferrixd hash-password) — production |
scram | string | unset | precomputed SCRAM-SHA-256 credential (<iterations>:<b64 salt>:<b64 stored_key>:<b64 server_key>). Required for SCRAM logins on a password_hash account — the server never sees that account's plaintext and cannot derive them. ferrixd hash-password --toml prints password_hash and scram together; an account seeded with plaintext password gets SCRAM credentials automatically |
fingerprints | array of string | [] | permitted TLS client-cert SHA-256 fingerprints (lowercase hex) for SASL EXTERNAL |
REHASH-reloadable. Self-registered accounts (via REGISTER) are stored in [persistence] and merged on top.
[[operators]] — optional, repeatable
IRC operator credentials for OPER. See Operators & Moderation.
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | operator name |
password | string | unset | plaintext (dev only) |
password_hash | string | unset | Argon2 PHC string (production) |
hosts | array of string | [] | hostmask globs (nick!user@host or bare IP) allowed to use this block; anywhere else gets 491 ERR_NOOPERHOST; empty = any host |
Validation: each operator needs password or password_hash. REHASH-reloadable.
[[bans]] — optional, repeatable
Startup K-lines, enforced at registration.
| Field | Type | Default | Description |
|---|---|---|---|
mask | string | required | nick!user@host glob (*, ?) |
reason | string | "Banned" | shown to the banned client |
REHASH-reloadable. Runtime additions: KLINE/DLINE (moderation guide).
[[webirc]] — optional, repeatable
Trusted WEBIRC gateways (IRCv3 WEBIRC). A web/IRC gateway may rewrite a client's apparent host and IP so users behind it are seen — and moderated — by their real address. Empty (the default) disables the WEBIRC command.
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | gateway identifier, matched against the WEBIRC <gateway> parameter |
password | string | required | shared secret the gateway sends as WEBIRC <password>; compared in constant time — use a long random value |
hosts | array of string | required | source-address globs (e.g. "127.0.0.1", "10.0.0.*") the gateway may connect from |
A WEBIRC is accepted only when it is the connection's first command (before CAP/NICK/USER/PASS), the real peer address matches one of hosts, and the password matches; the rewritten IP is then re-checked against D-lines. Any failure closes the connection. REHASH-reloadable.
[[services]] — optional, repeatable
RFC 2812 services allowed to register with SERVICE (commands). Empty refuses every SERVICE. REHASH-reloadable.
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | the service name it must register as |
password | string | required | sent by the service with PASS before SERVICE; compared in constant time |
hosts | list of globs | [] | source addresses the service may connect from; empty = any |
[[services]]
name = "stats"
password = "long-random-secret"
hosts = ["127.0.0.1"][account_registration] — optional
Self-registration (REGISTER) policy. REHASH-reloadable. See Accounts → E-mail verification.
| Field | Type | Default | Description |
|---|---|---|---|
verification | string | "none" | "none" (accounts usable at once), "smtp" or "command" (code must be confirmed with VERIFY; the cap advertises email-required) |
code_ttl_secs | int | 86400 | how long a code is valid; an account still unverified then is deleted |
code_length | int | 8 | code length, 6–32 |
verify_url | string | unset | link included in the message; {account}, {code}, {network} are substituted (URL-encoded) |
subject | string | "Your {network} verification code" | mail subject |
max_per_ip_per_hour | int | 5 | registrations per source address per hour; 0 = unlimited |
before_connect | bool | true | allow REGISTER before connection registration completes (the cap's before-connect key); false answers it with FAIL REGISTER COMPLETE_CONNECTION_REQUIRED |
command | list of strings | [] | verification = "command": argv of the delivery program; gets FERRIXD_ACCOUNT, FERRIXD_EMAIL, FERRIXD_CODE, FERRIXD_NETWORK, FERRIXD_VERIFY_URL in its environment; must exit 0 within 30 s |
[account_registration.smtp] (verification = "smtp"):
| Field | Type | Default | Description |
|---|---|---|---|
host | string | required | relay host (also the TLS name verified against Mozilla's root store) |
port | int | 587 | relay port |
security | string | "starttls" | "starttls", "tls" (implicit, usually port 465) or "none" (local relays only) |
username | string | unset | AUTH PLAIN login |
password_env | string | unset | name of the environment variable holding the SMTP password |
from | string | required | sender address |
timeout_secs | int | 20 | per-delivery timeout |
[dnsbl] — optional
DNS blocklist checks at connect time. No lists = disabled. REHASH-reloadable (a reload clears the result cache). See Operators → DNS blocklists.
| Field | Type | Default | Description |
|---|---|---|---|
cache_ttl_secs | int | 3600 | how long a lookup result is cached per address |
max_cache_entries | int | 65536 | cache cap; when full, expired entries are purged and new results go uncached |
max_inflight | int | 256 | concurrent checks; beyond it connections are admitted unchecked (fail open) |
lists | array | [] | the blocklists (below) |
[[dnsbl.lists]]:
| Field | Type | Default | Description |
|---|---|---|---|
zone | string | required | the blocklist zone, e.g. dnsbl.dronebl.org |
codes | list of ints | [] | which 127.0.0.<code> answers count as listed; empty = any |
action | string | "reject" | "reject" refuses the connection; "ban" also refuses the address for ban_secs without further lookups; "mark" admits it and shows operators the zone in WHOIS (320) |
ban_secs | int | 86400 | ban duration |
reason | string | "Your address is listed in {zone}" | shown to refused clients; {zone} and {ip} are substituted |
timeout_ms | int | 1500 | per-lookup timeout (1–30000); a timeout counts as not listed |
[multiclient] — optional
Several connections per account. REHASH-reloadable. See Accounts → multiclient.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | a SASL login to an account already online here attaches to that user |
max_connections | int | 4 | devices per account |
always_on | bool | false | the user stays (auto-away) when its last connection leaves |
always_on_expiry_secs | int | 604800 | an always-on user without connections quits after this |
auto_away_message | string | "Disconnected" | away message while no device is connected |
rejoin | bool | false | rejoin an account's previous channels on login (persisted with [persistence]) |
[web] — optional
The built-in HTTP(S) server: the web client, IRC over WebSocket and file uploads on one port. See Web Client and File Uploads.
| Field | Type | Default | Description |
|---|---|---|---|
bind | socket address | — | address to listen on |
tls | bool | true | HTTPS with the [tls] certificate; false only on loopback (reverse proxy) |
public_url | string | https://<server name>:<port> | externally visible base URL for links and FILEHOST |
irc | bool | true | accept IRC over WebSocket at /irc on this port |
client | bool | false | serve the web client from root |
root | path | /usr/share/ferrixd/web | directory holding the built web client (ferrixd-web.tar.gz from a release) |
[admin] — optional
The admin dashboard and its HTTP API.
| Field | Type | Default | Description |
|---|---|---|---|
bind | socket address | — | address to listen on; must be loopback unless tls = true |
tls | bool | false | HTTPS with the [tls] certificate (required for a non-loopback bind) |
root | path | [web] root | directory holding admin.html |
session_secs | int | 28800 | admin session lifetime |
overrides | path | — | JSON file persisting runtime switches changed with ferrixd ctl set or the dashboard |
[filehost] — optional
File uploads (soju.im/FILEHOST); needs [web]. Limits are REHASH-reloadable, the storage backend is fixed at startup. See File Uploads.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | accept uploads and advertise the endpoint |
max_bytes | int | 26214400 | largest upload (25 MiB) |
allowed_types | string list | images, audio, video, PDF, text/plain | accepted MIME types; type/* wildcards |
quota_bytes | int | 524288000 | stored bytes per account (0 = unlimited) |
uploads_per_hour | int | 60 | uploads per account per hour |
retention_days | int | 30 | purge uploads older than this (0 = never) |
voice_max_secs | int | 300 | longest Ogg/Opus voice message (0 = no limit) |
index | path | <local dir>/index.db | SQLite upload index; required for S3 |
storage.kind | "local" | "s3" | "local" | backend |
storage.path | path | /var/lib/ferrixd/uploads | local: directory |
storage.endpoint, region, bucket | string | — | S3: where |
storage.access_key_env, secret_key_env | string | — | S3: environment variables holding the credentials |
storage.path_style | bool | true | S3: <endpoint>/<bucket> instead of <bucket>.<host> |
storage.prefix | string | "" | S3: object key prefix |
[calls] — optional
1:1 call signalling (ferrix.chat/calls). REHASH-reloadable. See Calls & E2EE.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | offer the capability and police call frames |
stun_urls | string list | [] | STUN URLs handed out by CALL ICE |
turn_urls | string list | [] | TURN URLs handed out with minted credentials |
turn_secret_env | string | — | environment variable holding the coturn static-auth-secret |
turn_ttl_secs | int | 3600 | TURN credential lifetime |
require_account | bool | true | only logged-in users may call or get TURN credentials |
offers_per_minute | int | 5 | call offers per user per minute |
max_duration_secs | int | 14400 | the server hangs up calls older than this |
[e2ee] — optional
The experimental end-to-end encryption key directory (ferrix.chat/e2ee). REHASH-reloadable. See Calls & E2EE.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | offer the capability and the KEYS command |
max_devices | int | 10 | devices per account |
max_prekeys | int | 100 | one-time prekeys per device |
fetches_per_minute | int | 30 | bundle fetches per user per minute |
[control] — optional
The local administration endpoint for ferrixd ctl (and the web admin API). Disabled unless configured.
| Field | Type | Default | Description |
|---|---|---|---|
socket | path | unset | Unix domain socket, created mode 0600 — anyone who can open it can administer the server, so keep it in a directory only the service user can reach. Unix only |
bind | socket address | unset | loopback-only TCP endpoint (Windows, containers); requires token_env |
token_env | string | unset | name of the environment variable holding the TCP token (≥ 16 characters), compared in constant time |
shutdown_grace_secs | int | 30 | how long drain waits for clients to leave |
[control]
socket = "/run/ferrixd/ctl.sock"[nicks] — optional
Nick protection. REHASH-reloadable. See Accounts → Nick protection.
| Field | Type | Default | Description |
|---|---|---|---|
delay_secs | int | 0 | RFC 2811 nick delay: after a netsplit or ping timeout the departed user's nick answers 437 ERR_UNAVAILRESOURCE to everyone else for this long. 0 disables it |
reserve_account_nicks | bool | false | every registered account's name is a nick reserved for that account |
reservation_grace_secs | int | 30 | how long someone using another account's reserved nick has to log in before being renamed |
guest_prefix | string | "Guest" | forced renames pick <prefix><5 digits> |
[logging] — optional
Log output defaults, so a service unit or container needs no extra flags. The CLI flags win over these.
| Field | Type | Default | Description |
|---|---|---|---|
format | string | "full" | "full", "compact", "pretty" or "json" (one JSON object per line); --log-format overrides |
filter | string | unset | tracing filter (info, ferrixd=debug,info, …); --log overrides, and an unset filter falls back to RUST_LOG, then info. Validated at load |
[persistence] — optional
SQLite durability for history, registered channels, and self-registered accounts. Omit for in-memory-only operation. See Message History.
| Field | Type | Default | Description |
|---|---|---|---|
path | path | required | SQLite database file (created if missing; WAL mode) |
load_limit | int | 5000 | most-recent history rows loaded into RAM at startup |
search | bool | true | offer full-text message search (soju.im/search) over the stored history |
search_max_results | int | 100 | most results one SEARCH returns |
[metrics] — optional
| Field | Type | Default | Description |
|---|---|---|---|
bind | socket address | required | HTTP listener for /metrics; bind to loopback — the endpoint has no auth |
Catalogue: Metrics reference.
[plugins] — optional
WASM plugin host. See WASM Plugins.
| Field | Type | Default | Description |
|---|---|---|---|
dir | path | required | directory scanned for *.wasm at startup (sorted filename order) |
fuel | int | 5000000 | per-hook-call instruction budget |
max_memory | int | 16777216 | per-instance linear-memory cap, bytes |
expose_private_messages | bool | false | feed user-to-user DMs to the ferrix_on_private_message hook (a privacy decision — off unless you opt in) |
state_dir | path | unset | directory for host-managed per-plugin KV state files; unset → in-memory only |
tick_secs | int | 0 | seconds between ferrix_on_timer calls; 0 disables the tick (as does no plugin exporting the hook) |
grants | table | {} | per-plugin capability grants, plugin name → list of capability names; deny-by-default (see below) |
config | table | {} | per-plugin operator settings, plugin name → string table, read back through ferrix.config_get; a "$env:NAME" value is read from the environment |
on_missing_grants | string | "refuse" | a plugin whose manifest requests ungranted capabilities is "refuse"d, or loaded with the granted subset ("degrade") |
http | table | {} | plugin name → host names it may reach with ferrix.http_request (needs the http grant) |
bots | table | {} | plugin name → { nick, realname, channels } bot pseudo-client (needs the bot grant) |
Capability names for grants: send_notice, send_message, kick, mode, topic, kline, gline, connect, squit, http, bot. An unrecognised name is logged and ignored. Grants are re-applied to the running plugins on REHASH (a removed grant is revoked immediately). Grant the narrowest set that does the job — kline bans a hostmask and disconnects everyone it matches.
[plugins.grants]
"20-modbot" = ["send_notice", "kick", "mode"]
[plugins.config."20-modbot"]
report_channel = "#ops"
threshold = "5"[[links]] — optional, repeatable
S2S peer definitions. See Federation.
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | peer's advertised server.name; must match at handshake |
connect | socket address | unset | peer's link_bind; omit for accept-only links |
fingerprint | string | required | peer TLS cert SHA-256, lowercase hex (ferrixd fingerprint) — pinned |
password | string | required | shared link secret, compared in constant time |
protocol | string | "ferrix" | wire protocol on this link: "ferrix" (native) or "ts6" (charybdis-family bridge, e.g. solanum) |
What REHASH reloads
| Reloadable at runtime | Restart required |
|---|---|
[[accounts]], [[operators]], [[bans]], [[webirc]], [[services]], [nicks], [dnsbl], [account_registration], [multiclient], [calls], [e2ee], [filehost] limits, [plugins.grants], server.motd, server.password, [tls] certificate/key, [[links]] definitions | listener bind addresses, [limits], [persistence], [metrics], [web], [admin], [control], [filehost.storage], the rest of [plugins] (plugins are loaded at startup), sid, cloak_key, casemapping |
[tls] certificate/key reload is live for every TLS listener (no dropped connections; a bad PEM leaves the previous material armed).
[[links]] after a REHASH:
- operator
CONNECT(andferrixd ctl connect) uses the refreshed definitions immediately, so a newly added link can be dialled at once; - the boot-time auto-dial loops pick up an edited address, fingerprint or certificate on their next attempt, and stop for links removed from the file — but
REHASHnever starts a loop for a newly added link; - the inbound link listener (
link_bind) matches each connecting peer against the refreshed definitions, so a newly added peer (accept-only or not) can link in at once, and a removed peer — or one with a changed fingerprint or password — is judged by the new file on its next attempt. Links already up are not dropped;SQUITa removed peer to cut it off.
Runtime switches (ferrixd ctl set …, the admin dashboard) override the file across REHASH until reset with default.
Complete annotated example
The exact file ferrixd gen-config writes:
# ferrixd example configuration.
#
# Copy to `ferrixd.toml` and adjust (or run `ferrixd gen-config` to write this
# file for you). Validate any changes with `ferrixd check` before restarting.
# The parser rejects unknown keys (fail-closed configuration), so a
# typo is an error, not a silently-ignored setting.
#
# Helper subcommands for the values below:
# ferrixd gen-cert -> a self-signed [tls] cert + key (dev)
# ferrixd hash-password -> an Argon2id `password_hash` for accounts/operators
# ferrixd fingerprint -> a cert fingerprint for [[links]] / SASL EXTERNAL
[server]
# Advertised server name (used in numerics / source prefixes).
name = "irc.example.test"
# Advertised network name (ISUPPORT NETWORK).
network = "ferrixnet"
# Server description for LINKS / WHOIS / linked servers (default: the network).
# description = "Main ferrixnet server"
# Optional network icon URL (IRCv3 draft/network-icon), advertised as the
# `draft/ICON` ISUPPORT token. Use an HTTPS URL to a (preferably square) image;
# a literal `{size}` in the URL is passed through for clients to substitute.
# icon = "https://example.org/icon.svg"
# Network-wide case folding for nicks/channels: "ascii" (default) or "rfc1459".
casemapping = "ascii"
# HMAC key enabling host cloaking (omit to disable). Keep this secret — it makes
# cloaks unforgeable. Authenticated users are cloaked as account.<network>.
# cloak_key = "change-this-to-a-long-random-secret"
# Server id (SID) and optional inbound S2S link listener.
sid = "42F"
# link_bind = "0.0.0.0:6666"
# Message of the day, one entry per line (optional).
motd = [
"Welcome to ferrixd.",
"Be excellent to each other.",
]
# TLS is the primary, mandatory transport.
tls_bind = "0.0.0.0:6697"
# Plaintext is disabled by default. Uncomment ONLY for local testing;
# binding to a non-loopback address will be rejected unless you also set
# `allow_plain_nonlocal = true` below.
# plain_bind = "127.0.0.1:6667"
# allow_plain_nonlocal = false
# IRC over WebSockets (IRCv3). `wss_bind` reuses the [tls] certificate and is the
# recommended form for browser clients. `ws_bind` is plaintext and — like
# `plain_bind` — loopback-only unless `allow_plain_nonlocal = true`.
# wss_bind = "0.0.0.0:443"
# ws_bind = "127.0.0.1:8080"
# Optional connection password: clients must send `PASS <password>` before
# completing registration (rejected with 464 otherwise).
# password = "change-me"
# Accepted channel types (RFC 2811), advertised as CHANTYPES: "#" network-wide,
# "&" local to this server (never linked), "+" modeless (no ops, no modes).
# chantypes = "#&"
# Optional IRCv3 strict transport security (`sts`) policy. Plaintext clients
# are told the TLS port to reconnect to; TLS clients are told to remember the
# policy for `duration` seconds (0 clears it).
# sts = { port = 6697, duration = 2592000, preload = false }
[tls]
# Option A — provide a real certificate chain and private key (PEM):
# cert = "/etc/ferrixd/fullchain.pem"
# key = "/etc/ferrixd/privkey.pem"
# Option B — generate an ephemeral self-signed certificate at startup.
# Convenient for development; NEVER use in production. Ignored if cert/key
# are set above.
self_signed_dev = true
dev_hostnames = ["localhost", "irc.example.test"]
# Renewed certificate files are picked up automatically (0 disables).
# reload_interval_secs = 60
# Option C — let ferrixd obtain and renew its certificate itself (ACME,
# HTTP-01). Replaces cert/key; http_bind must be reachable as port 80.
# [tls.acme]
# domains = ["irc.example.org"]
# contact = ["mailto:admin@example.org"]
# dir = "/var/lib/ferrixd/acme"
# http_bind = "0.0.0.0:80"
# accept_terms = true
[limits]
# Wire-length budgets. Kept separate for tags and body per IRCv3.
max_tag_bytes = 4094
max_body_bytes = 512
# Fatal frame length before the connection is dropped (DoS guard).
# Must be >= max_tag_bytes + max_body_bytes plus a little slack.
max_line_bytes = 8704
# Seconds a connection may stay unregistered before it is closed (slot guard).
registration_timeout_secs = 30
# Seconds allowed for the TLS handshake before the attempt is aborted.
handshake_timeout_secs = 15
# Retained messages per target for chathistory (0 keeps only the current run).
history_len = 500
# Cap on the number of distinct in-memory history targets (channels + DM pairs).
# Bounds total history memory regardless of activity; least-recently-active
# targets are evicted past this. Persisted rows (if enabled) are unaffected.
history_max_targets = 50000
# Idle seconds before the server PINGs a quiet client (disconnects on a 2nd miss).
ping_interval_secs = 120
# --- DoS controls ---
# Maximum simultaneous connections from one source IP (connection throttling).
max_clients_per_ip = 10
# Maximum channels a single client may be in at once (advertised as CHANLIMIT).
max_channels = 50
# Outbound SendQ depth in lines; a client whose queue overflows is dropped.
sendq_lines = 2048
# Inbound command burst allowance, then sustained rate/sec (token bucket).
# Exceeding this disconnects the client with "Excess Flood".
recv_burst = 20
recv_rate = 10
# --- SASL seed accounts ---
# Each account may authenticate via SASL PLAIN (password) and/or EXTERNAL
# (TLS client-certificate fingerprint).
#
# [[accounts]]
# name = "alice"
# # Development convenience: plaintext, hashed with Argon2id at startup. This
# # form also derives the account's SCRAM-SHA-256 credentials automatically.
# password = "change-me"
# # Preferred in production: a pre-computed Argon2 PHC hash instead of `password`.
# # The server never sees the plaintext, so SCRAM credentials cannot be derived
# # from it — supply them explicitly for SASL SCRAM-SHA-256. Both lines are
# # printed together by `ferrixd hash-password --toml`.
# # password_hash = "$argon2id$v=19$m=19456,t=2,p=1$...$..."
# # scram = "4096:<b64 salt>:<b64 stored_key>:<b64 server_key>"
# # SASL EXTERNAL: permitted client-cert SHA-256 fingerprints (lowercase hex).
# # fingerprints = ["a1b2c3..."]
# --- IRC operators (used by the OPER command) ---
# [[operators]]
# name = "admin"
# password = "change-me" # or password_hash = "$argon2id$..."
# # Optional hostmask allowlist for this block: `nick!user@host` globs or bare
# # IPs. OPER from anywhere else is refused with 491. Empty/omitted = any host.
# # hosts = ["*!*@203.0.113.7", "*!*@*.trusted.example"]
# --- Startup server bans (K-Lines), matched at registration ---
# [[bans]]
# mask = "*!*@203.0.113.0/24" # nick!user@host glob (* and ?)
# reason = "Banned network"
# --- Trusted WEBIRC gateways (IRCv3 WEBIRC) ---
# A web/IRC gateway may rewrite a client's apparent host and IP so users behind
# it are seen (and moderated) by their real address. A gateway must present the
# shared password AND connect from one of the `hosts` globs; both are checked
# (the password in constant time) before any rewrite. Empty = WEBIRC disabled.
# [[webirc]]
# name = "kiwi" # matched against the WEBIRC <gateway> field
# password = "long-random-shared-secret"
# hosts = ["127.0.0.1", "10.0.0.*"] # source-address globs the gateway may use
# --- RFC 2812 services (optional) ---
# Connections allowed to register with SERVICE instead of NICK/USER. The
# service sends `PASS <password>` first; `hosts` limits where it may connect
# from (empty = anywhere).
# [[services]]
# name = "stats"
# password = "long-random-secret"
# hosts = ["127.0.0.1"]
# --- Self-registration policy (optional) ---
# [account_registration]
# verification = "none" # none | smtp | command
# code_ttl_secs = 86400 # unverified accounts are deleted after this
# max_per_ip_per_hour = 5
# REGISTER allowed before connection registration completes:
# before_connect = true
# verify_url = "https://irc.example.org/verify?account={account}&code={code}"
# [account_registration.smtp]
# host = "smtp.example.org"
# port = 587
# security = "starttls" # starttls | tls | none
# username = "irc@example.org"
# password_env = "FERRIXD_SMTP_PASSWORD"
# from = "irc@example.org"
# --- DNS blocklists (optional) ---
# Listed addresses are refused (or marked for opers) at connect time.
# [dnsbl]
# cache_ttl_secs = 3600
# max_inflight = 256 # beyond this, connect unchecked (fail open)
# [[dnsbl.lists]]
# zone = "dnsbl.dronebl.org"
# action = "ban" # reject | mark | ban
# ban_secs = 86400
# reason = "Your address ({ip}) is listed in {zone}"
# timeout_ms = 1500
# --- Several devices per account (optional) ---
# [multiclient]
# enabled = true # a SASL login to an online account attaches
# max_connections = 4
# always_on = false # stay present (away) without connections
# always_on_expiry_secs = 604800
# rejoin = false # rejoin the account's channels on login
# --- Built-in HTTP(S) server: web client, IRC over WebSocket, uploads ---
# [web]
# bind = "0.0.0.0:8443"
# tls = true # HTTPS with the [tls] certificate
# public_url = "https://chat.example.org" # behind a reverse proxy
# irc = true # IRC over WebSocket at wss://…/irc
# client = true # serve the web client from `root`
# root = "/usr/share/ferrixd/web" # extracted ferrixd-web.tar.gz
#
# Admin dashboard + API; log in with an [[operators]] credential.
# [admin]
# bind = "127.0.0.1:8080" # loopback unless tls = true
# overrides = "/var/lib/ferrixd/overrides.json" # persist runtime switches
#
# File uploads, advertised as soju.im/FILEHOST (needs [web]).
# [filehost]
# enabled = true
# max_bytes = 26214400 # 25 MiB
# quota_bytes = 524288000 # per account; 0 = unlimited
# uploads_per_hour = 60
# retention_days = 30 # 0 = keep forever
# voice_max_secs = 300 # Ogg/Opus voice messages
# [filehost.storage]
# kind = "local"
# path = "/var/lib/ferrixd/uploads"
# # kind = "s3", endpoint = "https://…", region = "…", bucket = "…",
# # access_key_env = "FERRIXD_S3_ACCESS_KEY", secret_key_env = "FERRIXD_S3_SECRET_KEY"
# # (S3 also needs [filehost] index = "/var/lib/ferrixd/uploads.db")
# --- 1:1 call signalling, ferrix.chat/calls (optional) ---
# [calls]
# enabled = true
# stun_urls = ["stun:turn.example.org:3478"]
# turn_urls = ["turn:turn.example.org:3478"]
# turn_secret_env = "FERRIXD_TURN_SECRET" # coturn static-auth-secret
# turn_ttl_secs = 3600
# require_account = true
# offers_per_minute = 5
# max_duration_secs = 14400
# --- E2EE key directory, ferrix.chat/e2ee (optional, experimental) ---
# [e2ee]
# enabled = true
# max_devices = 10
# max_prekeys = 100
# fetches_per_minute = 30
# --- Local control endpoint for `ferrixd ctl` (optional) ---
# [control]
# socket = "/run/ferrixd/ctl.sock" # mode 0600; Unix only
# # bind = "127.0.0.1:6699" # loopback TCP alternative…
# # token_env = "FERRIXD_CTL_TOKEN" # …authenticated by this env var's token
# shutdown_grace_secs = 30 # how long `ctl drain` waits
# --- Nick protection (optional) ---
# [nicks]
# delay_secs = 60 # hold a nick after netsplit/ping timeout (437)
# reserve_account_nicks = true # an account's name is its owner's nick
# reservation_grace_secs = 30 # time to log in before a forced rename
# guest_prefix = "Guest" # forced renames become Guest12345
# --- Log output (optional; --log / --log-format override these) ---
# [logging]
# format = "json" # full | compact | pretty | json
# filter = "info" # tracing filter, e.g. "info,ferrixd::link=debug"
# --- Durable persistence (SQLite; optional) ---
# When set, chathistory AND channel registrations survive restarts (they share
# the same database file). Omit for in-memory-only state.
# [persistence]
# path = "/var/lib/ferrixd/ferrixd.db"
# load_limit = 5000 # recent messages to load into RAM at startup
# search = true # full-text SEARCH (soju.im/search) over history
# search_max_results = 100
# --- Prometheus metrics endpoint (optional; bind to loopback) ---
# [metrics]
# bind = "127.0.0.1:9090" # scrape at http://127.0.0.1:9090/metrics
# --- WASM plugin host (optional) ---
# Loads every *.wasm file in `dir` at startup. Plugins are sandboxed and run
# under a per-call fuel (instruction) budget; a plugin's on_message hook may
# block channel messages. See crates/ferrixd/src/plugin.rs for the ABI.
# [plugins]
# dir = "/etc/ferrixd/plugins"
# fuel = 5000000 # per-hook-call instruction budget
# max_memory = 16777216 # per-instance linear-memory cap (bytes)
# expose_private_messages = false # feed DMs to plugins (privacy: your call)
# state_dir = "/var/lib/ferrixd/plugin-state" # persist plugin KV stores
# tick_secs = 0 # >0 calls ferrix_on_timer that often
#
# Capability grants (deny-by-default): plugin file stem -> capabilities.
# Available: send_notice, send_message, kick, mode, topic, kline.
# Grant the narrowest set that does the job — `kline` disconnects users.
# [plugins.grants]
# "20-modbot" = ["send_notice", "kick", "mode"]
#
# Per-plugin settings, readable through ferrix.config_get. Lets one .wasm
# file be deployed with site-specific parameters instead of recompiled.
# A "$env:NAME" value is read from the server's environment (API keys).
# [plugins.config."20-modbot"]
# report_channel = "#ops"
# threshold = "5"
#
# ABI 4: network grants (gline, connect, squit — audited), outbound HTTP to
# allow-listed hosts, and plugin-owned bot pseudo-clients.
# (in [plugins]:) on_missing_grants = "refuse" # or "degrade"
# [plugins.http]
# llm-assistant = ["api.openai.com"]
# [plugins.bots.llm-assistant]
# nick = "helper"
# channels = ["#help"]
# --- S2S peer links ---
# Trust is the pinned TLS certificate fingerprint plus the shared password.
# Set server.link_bind above to accept inbound links.
# Links refuse to form cycles: keep the topology a tree.
# [[links]]
# name = "irc.peer.test"
# connect = "peer.example:6666" # omit for accept-only links
# fingerprint = "a1b2c3…" # peer cert SHA-256 (lowercase hex)
# password = "shared-link-secret"
# protocol = "ferrix" # or "ts6" to bridge a charybdis-family
# # IRCd (solanum, …) into the network