Skip to main content

Module config

Module config 

Source
Expand description

Configuration for ma-core-based daemons.

Provides Config, a configuration model that supports:

Native from_args resolves fields from (in decreasing priority):

  1. Explicit CLI arguments (via MaArgs)
  2. MA_<MA_DEFAULT_SLUG>_* environment variables (slug-prefixed, set per binary)
  3. MA_* environment variables (static fallback, shared across binaries)
  4. YAML config file (XDG_CONFIG_HOME/ma/<slug>.yaml)
  5. Built-in defaults

§Native compile-time constant requirement

Binaries using Config::from_args must declare a compile-time constant:

const MA_DEFAULT_SLUG: &str = "panteia";

This constant serves a dual purpose:

  • Default slug — used for file naming when --slug is not set.
  • Env-var prefix — uppercased to MA_PANTEIA_* for env-var lookup. This prefix is fixed at compile time and cannot be changed at runtime. Only file-naming can be overridden via --slug.

Re-exports§

pub use cli::MaArgs;
pub use secrets::SecretBundle;

Modules§

cli
Command-line argument struct for ma-core-based binaries.
secrets
Secret bundle: four standard 32-byte keys plus optional user-defined keys, all stored encrypted on disk in a single file.

Structs§

BrowserIdentityExport
Browser-friendly identity export payload.
Config
Runtime configuration for a ma daemon.

Functions§

default_config_path
Default YAML config path: XDG_CONFIG_HOME/ma/<slug>.yaml.
default_log_file_path
Default log file path: XDG_DATA_HOME/ma/<slug>.log.
default_secret_bundle_path
Default secret bundle path: XDG_CONFIG_HOME/ma/<slug>.bin.