Configuration keys

Loading

#![allow(unused)]
fn main() {
Churust::from_config() // defaults < churust.toml < env < later DSL
}

Environment variables use the CHURUST_ prefix with nested keys separated by _. Example: CHURUST_SERVER_PORT=9090.

[server]

KeyExampleMeaning
host"0.0.0.0"Bind address
port8080Port
max_body_bytes1048576Max request body size
request_timeout_ms30000Request timeout
keep_alive_ms75000Idle keep-alive; 0 answers and closes
max_connections25000Concurrent connections; 0 unlimited
max_tls_handshakes256Concurrent TLS handshakes
tls_handshake_timeout_ms10000Handshake (+ queue) deadline
shutdown_timeout_ms30000Bounded drain on shutdown
path_policy"strict"strict | redirect | collapse

Header-read timeouts cover a connection from accept time, so a peer that connects and stays silent is still bounded (slow-loris protection).

[tls]

Requires the tls feature.

KeyMeaning
certPath to certificate PEM
keyPath to private key PEM

Example file

[server]
host = "0.0.0.0"
port = 8080
max_body_bytes = 1048576
request_timeout_ms = 30000
keep_alive_ms = 75000
max_connections = 25000
max_tls_handshakes = 256
tls_handshake_timeout_ms = 10000
shutdown_timeout_ms = 30000
path_policy = "strict"

[tls]
cert = "cert.pem"
key  = "key.pem"

Additional knobs (HTTP/2 limits, multi-bind, Unix sockets, backlog) may be available on the builder — see docs.rs/churust-core and State & configuration.