pub struct ServerSettings {
pub listen_address: Option<String>,
pub port: Option<u16>,
pub cert: Option<String>,
pub key: Option<String>,
pub console_inactivity_timeout_secs: u64,
pub auth_rate_limit_per_minute: Option<u32>,
pub request_timeout_secs: u64,
pub shutdown_grace_period_secs: u64,
pub migrate_backup_root: Option<String>,
pub allow_http: bool,
}Expand description
Server-only settings — TLS, listen address, console behaviour. Lives
under [server] in server.toml.
Fields§
§listen_address: Option<String>TCP listen address (e.g. “0.0.0.0”). When omitted from config
and no --listen-address flag is supplied, the server falls
back to "0.0.0.0".
port: Option<u16>TCP port. When omitted from config and no --port flag is
supplied, the effective default depends on whether TLS is
configured: 8443 if both cert and key are present (HTTPS),
otherwise 8080 (plain HTTP). See
ServerSettings::default_port.
cert: Option<String>Path to the TLS certificate (PEM).
key: Option<String>Path to the TLS private key (PEM).
console_inactivity_timeout_secs: u64How long a node-console WebSocket stays open without activity before the server tears it down.
auth_rate_limit_per_minute: Option<u32>Per-source-IP rate limit for the /api/v1/auth/* endpoints,
in requests per minute. None disables in-process rate limiting
(operators are then expected to enforce it at the reverse proxy).
request_timeout_secs: u64Global request timeout applied to every HTTP route, in seconds.
When this elapses the server returns 408 REQUEST_TIMEOUT. All
long-running work (e.g. power transitions) now runs CLI-side,
so no endpoint needs more than the default.
shutdown_grace_period_secs: u64Grace period (seconds) axum_server waits for in-flight
requests to finish after SIGTERM / Ctrl+C before force-aborting.
Matches the standard k8s terminationGracePeriodSeconds default
(30 s); pods that hit this without finishing get SIGKILL’d by
the kubelet.
migrate_backup_root: Option<String>Filesystem root that confines POST /migrate/{backup,restore}
file access. When set, every destination / bos_file /
cfs_file / hsm_file / ims_file / image_dir path in the
request is canonicalised and rejected unless it resolves under
this directory. When unset (default), the migrate endpoints
return BadRequest even for admin callers — the operator must
explicitly opt in to server-side filesystem writes.
allow_http: boolOpt in to plain-HTTP listen mode. Default false: when neither
cert nor key is configured the server refuses to start, so
bearer tokens can’t accidentally land on the wire in cleartext.
Set to true only when TLS terminates upstream (reverse proxy
or sidecar); otherwise leave it off and configure both cert
and key.
Implementations§
Source§impl ServerSettings
impl ServerSettings
Sourcepub const DEFAULT_LISTEN_ADDRESS: &'static str = "0.0.0.0"
pub const DEFAULT_LISTEN_ADDRESS: &'static str = "0.0.0.0"
Effective default listen address when neither config nor CLI flag supplies one: bind on all interfaces.
Sourcepub fn default_port(has_tls: bool) -> u16
pub fn default_port(has_tls: bool) -> u16
Effective default port when neither config nor CLI flag supplies
one. 8443 for the HTTPS path (cert + key both present), 8080
for plain HTTP — the latter is the typical dev / sidecar setup
where TLS is terminated upstream.
Trait Implementations§
Source§impl Debug for ServerSettings
impl Debug for ServerSettings
Source§impl<'de> Deserialize<'de> for ServerSettings
impl<'de> Deserialize<'de> for ServerSettings
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 ServerSettings
impl RefUnwindSafe for ServerSettings
impl Send for ServerSettings
impl Sync for ServerSettings
impl Unpin for ServerSettings
impl UnwindSafe for ServerSettings
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
§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