pub struct FileConfig {Show 41 fields
pub command_socket: Option<String>,
pub command_buffer_size: Option<u64>,
pub max_command_buffer_size: Option<u64>,
pub max_connections: Option<usize>,
pub min_buffers: Option<u64>,
pub max_buffers: Option<u64>,
pub buffer_size: Option<u64>,
pub slab_entries_per_connection: Option<u64>,
pub basic_auth_max_credential_bytes: Option<u64>,
pub max_connections_per_ip: Option<u64>,
pub retry_after: Option<u32>,
pub splice_pipe_capacity_bytes: Option<u64>,
pub command_allowed_uids: Option<Vec<u32>>,
pub saved_state: Option<String>,
pub automatic_state_save: Option<bool>,
pub log_level: Option<String>,
pub log_target: Option<String>,
pub log_colored: bool,
pub audit_logs_target: Option<String>,
pub audit_logs_json_target: Option<String>,
pub access_logs_target: Option<String>,
pub access_logs_format: Option<AccessLogFormat>,
pub access_logs_colored: Option<bool>,
pub worker_count: Option<u16>,
pub worker_automatic_restart: Option<bool>,
pub metrics: Option<MetricsConfig>,
pub disable_cluster_metrics: Option<bool>,
pub listeners: Option<Vec<ListenerBuilder>>,
pub clusters: Option<HashMap<String, FileClusterConfig>>,
pub handle_process_affinity: Option<bool>,
pub ctl_command_timeout: Option<u64>,
pub pid_file_path: Option<String>,
pub activate_listeners: Option<bool>,
pub front_timeout: Option<u32>,
pub back_timeout: Option<u32>,
pub connect_timeout: Option<u32>,
pub zombie_check_interval: Option<u32>,
pub accept_queue_timeout: Option<u32>,
pub evict_on_queue_full: Option<bool>,
pub request_timeout: Option<u32>,
pub worker_timeout: Option<u32>,
}Expand description
Parsed from the TOML config provided by the user.
Fields§
§command_socket: Option<String>§command_buffer_size: Option<u64>§max_command_buffer_size: Option<u64>§max_connections: Option<usize>§min_buffers: Option<u64>§max_buffers: Option<u64>§buffer_size: Option<u64>§slab_entries_per_connection: Option<u64>Slab-entries-per-connection multiplier. None keeps the compile-time
default of 4. Operator-visible escape hatch for fan-out topologies
that exceed 4 backends per session — clamped to [2, 32] at load.
basic_auth_max_credential_bytes: Option<u64>Maximum length, in bytes, of a base64-decoded Authorization: Basic
payload accepted by the worker’s mux::auth module. Caps the
per-failed-auth allocation so a hostile peer cannot force the worker
to decode arbitrarily large tokens. RFC 7617 imposes no upper bound
— defaults to 4096, which is well above the realistic
username:password shape. Operators running hardened tenants can
lower this to e.g. 256 or 512 to bound the allocation tighter.
Values >= buffer_size / 3 emit a warning at config-load time
(the credential cap shouldn’t dominate the per-frontend buffer).
max_connections_per_ip: Option<u64>Default per-(cluster, source-IP) connection limit. None keeps
0 (unlimited). Each cluster may override via its own
max_connections_per_ip. The source IP is taken from the parsed
proxy-protocol header when present, else peer_addr. When the
limit is reached, HTTP requests are answered with 429 Too Many Requests (with optional Retry-After) and TCP sessions are
closed gracefully without dialing the backend.
retry_after: Option<u32>Default Retry-After header value (seconds) sent on HTTP 429
responses. Some(0) or None keeping the default 0 omits the
header (rendering Retry-After: 0 invites an immediate retry that
defeats the limit). Per-cluster overrides apply for HTTP listeners
only. TCP listeners ignore this value (no HTTP envelope).
splice_pipe_capacity_bytes: Option<u64>Requested kernel-pipe capacity, in bytes, for each splice(2)
zero-copy direction (Linux only, splice feature). None keeps
the kernel default (64 KiB). Applied via fcntl(F_SETPIPE_SZ);
the kernel rounds up to a page boundary and clamps at
/proc/sys/fs/pipe-max-size (default 1 MiB unprivileged). The
realised capacity is read back via fcntl(F_GETPIPE_SZ) and
drives the per-call len for splice_in. Ignored on non-Linux
targets and on builds without the splice feature.
command_allowed_uids: Option<Vec<u32>>Optional UID allowlist for command-socket requests. None (default)
preserves historical behaviour: any same-UID local process can
invoke any verb. When set, requests whose SO_PEERCRED UID is not
in the list are rejected. Use to restrict mutating verbs to a
specific operator UID even when other same-UID daemons coexist
(CI runners, monitoring).
saved_state: Option<String>§automatic_state_save: Option<bool>§log_level: Option<String>§log_target: Option<String>§log_colored: bool§audit_logs_target: Option<String>Dedicated file path for the control-plane audit log. When set, every
emitted [AUDIT] / Command(...) line is also appended to this file
opened O_APPEND | O_CREAT with mode 0o640 (owner read+write,
group read, world nothing) so operators can separate the audit trail
from the main log stream and protect it with group-scoped ACLs /
logrotate. Independent of the standard log_target. None keeps
audit lines routed only through the standard logger.
audit_logs_json_target: Option<String>Dedicated file path for a JSON-encoded mirror of the audit log.
One JSON object per line so SIEM pipelines (Wazuh, Elastic, Loki)
ingest without bespoke parsers. Same O_APPEND | O_CREAT | 0o640
as audit_logs_target. None disables the JSON mirror.
access_logs_target: Option<String>§access_logs_format: Option<AccessLogFormat>§access_logs_colored: Option<bool>§worker_count: Option<u16>§worker_automatic_restart: Option<bool>§metrics: Option<MetricsConfig>§disable_cluster_metrics: Option<bool>§listeners: Option<Vec<ListenerBuilder>>§clusters: Option<HashMap<String, FileClusterConfig>>§handle_process_affinity: Option<bool>§ctl_command_timeout: Option<u64>§pid_file_path: Option<String>§activate_listeners: Option<bool>§front_timeout: Option<u32>§back_timeout: Option<u32>§connect_timeout: Option<u32>§zombie_check_interval: Option<u32>§accept_queue_timeout: Option<u32>§evict_on_queue_full: Option<bool>§request_timeout: Option<u32>§worker_timeout: Option<u32>Implementations§
Source§impl FileConfig
impl FileConfig
pub fn load_from_path(path: &str) -> Result<FileConfig, ConfigError>
Trait Implementations§
Source§impl Clone for FileConfig
impl Clone for FileConfig
Source§fn clone(&self) -> FileConfig
fn clone(&self) -> FileConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FileConfig
impl Debug for FileConfig
Source§impl Default for FileConfig
impl Default for FileConfig
Source§fn default() -> FileConfig
fn default() -> FileConfig
Source§impl<'de> Deserialize<'de> for FileConfig
impl<'de> Deserialize<'de> for FileConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for FileConfig
impl PartialEq for FileConfig
Source§fn eq(&self, other: &FileConfig) -> bool
fn eq(&self, other: &FileConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for FileConfig
impl Serialize for FileConfig
impl Eq for FileConfig
impl StructuralPartialEq for FileConfig
Auto Trait Implementations§
impl Freeze for FileConfig
impl RefUnwindSafe for FileConfig
impl Send for FileConfig
impl Sync for FileConfig
impl Unpin for FileConfig
impl UnsafeUnpin for FileConfig
impl UnwindSafe for FileConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.