pub struct Config {
pub preset: Preset,
pub toolsets: BTreeSet<Toolset>,
pub max_tier: Tier,
pub disabled: BTreeSet<Surface>,
pub cli_path: Option<PathBuf>,
pub max_result_bytes: usize,
pub api_base_url: String,
pub tailnet: String,
pub log_filter: String,
pub http: Option<HttpConfig>,
}Expand description
The configuration the server actually runs with.
Fields§
§preset: PresetThe preset the selection started from, kept for diagnostics.
toolsets: BTreeSet<Toolset>The toolsets to offer, after any adjustment.
max_tier: TierThe most dangerous tier permitted.
disabled: BTreeSet<Surface>Surfaces the operator switched off. A surface can also be unavailable because its backend is missing, which is decided at startup, not here.
cli_path: Option<PathBuf>§max_result_bytes: usize§api_base_url: StringWhere the control-plane calls go. The real control plane unless a test or a staging environment says otherwise; validated when the client is built, because that is where the rule about what is safe lives.
tailnet: StringThe tailnet a control-plane path means when the caller does not name one.
log_filter: String§http: Option<HttpConfig>Serve over HTTP instead of stdio, when the operator asked for it.
Implementations§
Source§impl Config
impl Config
Sourcepub fn resolve(cli: Cli) -> Result<Self, ConfigError>
pub fn resolve(cli: Cli) -> Result<Self, ConfigError>
Resolve the command line against the process environment.
Sourcepub fn resolve_with(
cli: Cli,
source: impl Fn(&str) -> Option<String>,
) -> Result<Self, ConfigError>
pub fn resolve_with( cli: Cli, source: impl Fn(&str) -> Option<String>, ) -> Result<Self, ConfigError>
Resolve the command line against an arbitrary source of variables.
Sourcepub fn is_disabled(&self, surface: Surface) -> bool
pub fn is_disabled(&self, surface: Surface) -> bool
Whether the operator switched this surface off.
Sourcepub fn changed_settings(&self) -> Vec<(&'static str, String)>
pub fn changed_settings(&self) -> Vec<(&'static str, String)>
The settings that differ from what this server would do on its own, as the variables that would reproduce them.
This is resolve run backwards, which is why it lives beside it: every
field it reads and every variable it names is this module’s, and a
setting added to one without the other is a snippet that does not
reproduce the server it was printed from.
Only what the operator changed. A snippet spelling out every default would be a snippet nobody reads, and every value in it would go stale the day a default changed.