Skip to main content

FileConfig

Struct FileConfig 

Source
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§

Trait Implementations§

Source§

impl Clone for FileConfig

Source§

fn clone(&self) -> FileConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FileConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FileConfig

Source§

fn default() -> FileConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FileConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FileConfig

Source§

fn eq(&self, other: &FileConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for FileConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for FileConfig

Source§

impl StructuralPartialEq for FileConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Reset for T
where T: Default + Clone,

Source§

fn reset(&mut self)

Source§

impl<T> Reset for T
where T: Default + Clone,

Source§

fn reset(&mut self)

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,