pub struct ServerConfig {
pub listen_addr: String,
pub listen_port: Option<u16>,
pub unix_socket: Option<String>,
pub max_body_size: usize,
pub worker_threads: usize,
pub shutdown_timeout_secs: u64,
}Expand description
[server] section — network listener and general server tuning.
Fields§
§listen_addr: StringListen address.
"0.0.0.0:8443"or"[::]:8443"for TCP."unix:/run/kipuka/kipuka.sock"or"/run/kipuka/kipuka.sock"for Unix."fd:3"for systemd socket activation (LISTEN_FDS).
The KIPUKA_LISTEN environment variable overrides this field.
listen_port: Option<u16>TCP listen port (ignored when listen_addr is a Unix socket or fd).
When set, overrides the port portion of listen_addr.
Useful for separating the bind address from the port in deployment configs.
unix_socket: Option<String>Unix socket path (alternative to embedding it in listen_addr).
When set, the server listens on this Unix domain socket instead of TCP.
Mutually exclusive with listen_port.
max_body_size: usizeMaximum HTTP request body size in bytes.
EST CSR payloads (PKCS#10) are typically 1–4 KB; Full CMC requests can be larger. Default: 65536 (64 KiB).
worker_threads: usizeNumber of tokio worker threads.
0 (the default) uses num_cpus threads.
shutdown_timeout_secs: u64Graceful shutdown timeout in seconds.
After receiving SIGTERM/SIGINT, the server waits this long for in-flight requests to complete before forcing shutdown. Default: 30 seconds.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn effective_listen_addr(&self) -> String
pub fn effective_listen_addr(&self) -> String
Resolve the effective listen target, accounting for overrides.
Priority: unix_socket > env KIPUKA_LISTEN > listen_addr.
Sourcepub fn is_unix_socket(&self) -> bool
pub fn is_unix_socket(&self) -> bool
Returns true when the effective listen target is a Unix domain socket.
Sourcepub fn is_systemd_fd(&self) -> bool
pub fn is_systemd_fd(&self) -> bool
Returns true when the effective listen target uses systemd fd passing.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
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>,
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations§
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more