pub struct ServerConfig {
pub serve: Option<ServeConfig>,
pub handlers: Option<HandlersConfig>,
pub cluster: Option<ClusterConfig>,
pub compute: Option<ComputeConfig>,
pub security: Option<SecurityConfig>,
pub secrets: Option<SecretsConfig>,
}Expand description
Server daemon configuration, loaded from boatramp.cfg (RON). Read by
boatramp serve; flags/env override the serve values.
Fields§
§serve: Option<ServeConfig>Server defaults for serve (flag/env override these).
handlers: Option<HandlersConfig>Server-side handler runtime config (which backend serves each binding),
consumed only with the handlers feature.
cluster: Option<ClusterConfig>Self-hosted cluster mode (consumed only with the cluster feature).
compute: Option<ComputeConfig>Opt-in compute backends. Present ⇒ this node runs compute workloads via the backends it can offer; absent ⇒ no compute (the reconcile loop stays a no-op).
security: Option<SecurityConfig>Operator security posture (the hardening knobs): a profile
preset + overrides, resolved at startup. Absent ⇒ the strict
multi-tenant default. Operator-only — never part of site config.
secrets: Option<SecretsConfig>Secrets-at-rest envelope. Absent ⇒ private keys stored cleartext in the (replicated) control plane.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn parse(text: &str) -> Result<Self, ConfigError>
pub fn parse(text: &str) -> Result<Self, ConfigError>
Parse a boatramp.cfg document as RON (the default). Kept for the existing
callers/tests; Self::parse_with_format is the format-aware entry point.
Sourcepub fn parse_with_format(
text: &str,
fmt: ConfigFormat,
) -> Result<Self, ConfigError>
pub fn parse_with_format( text: &str, fmt: ConfigFormat, ) -> Result<Self, ConfigError>
Parse a boatramp.cfg document in fmt (RON or JSON). The deserializer is
selected by format (RON ⇒ ron_options, JSON ⇒ serde_json) into the SAME
typed struct. Db-binding names declared in the file are validated here (the same
fail-closed check load re-runs after the env merge) regardless of format, so
a file-only config path — e.g. boatramp cloudflare rendering, or the
operator-resources loader — is guarded even without going through load.
Sourcepub fn load(
path: &Path,
override_: Option<ConfigFormat>,
) -> Result<Self, ConfigError>
pub fn load( path: &Path, override_: Option<ConfigFormat>, ) -> Result<Self, ConfigError>
Load from path, decoding as RON or JSON per resolve_format (override_
wins; else .json ⇒ JSON, everything else ⇒ RON), then layer BOATRAMP_*
environment overrides on top. A missing file yields the default config, so
serve can be configured entirely from the environment (12-factor deployments
where dropping a boatramp.cfg is awkward — fly.io / Cloudflare / containers).
The env-override merge runs AFTER the parse for either format — JSON is only an alternative decoder into the same typed struct; it does not change the file < env precedence.
Trait Implementations§
Source§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfigwhere
ServerConfig: Default,
impl<'de> Deserialize<'de> for ServerConfigwhere
ServerConfig: Default,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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