Expand description
Config-file loaders for cli.toml and server.toml.
This module owns three concerns:
- Paths — XDG-resolved defaults via
get_default_config_path, with per-binary overrides fromMANTA_CLI_CONFIG/MANTA_SERVER_CONFIG. Seeget_cli_config_file_pathandget_server_config_file_path. - Loading —
get_cli_configurationandget_server_configurationparse the TOML file and merge anyMANTA_*-prefixed environment variables on top, returning an untyped::config::Config. The typed deserialisation targets live with each binary (CliConfigurationinmanta-cli,ServerConfigurationinmanta-server) so this module stays agnostic of either schema. - In-place editing —
read_config_toml/write_config_tomlexpose atoml_edit::DocumentMutview formanta config setand friends, preserving comments and formatting.
Missing-file errors are intentionally rich: the
MantaError::NotFound message includes a minimal example file
and, when a legacy ~/.config/manta/config.toml is detected, a
field-by-field migration mapping.
Functions§
- get_
cli_ config_ file_ path - Returns the CLI config file path, honoring
MANTA_CLI_CONFIGif set. - get_
cli_ configuration - Load
cli.toml. Fails loudly if the file is missing; the error message includes a minimal example and (when a legacy config.toml is detected) a field-by-field migration mapping. - get_
csm_ root_ cert_ content - Read the root CA certificate from
file_path, falling back to the default config directory if the path is relative. - get_
default_ cache_ path - Returns the default manta cache directory path
(e.g.
~/.cache/manta/). - get_
default_ config_ path - Returns the default manta config directory path
(e.g.
~/.config/manta/). - get_
default_ manta_ cli_ config_ file_ path - Returns the default CLI config file path
(e.g.
~/.config/manta/cli.toml). - get_
default_ manta_ config_ file_ path - Returns the path of the legacy unified config file
(e.g.
~/.config/manta/config.toml). Used only bymissing_config_messageto detect when a user is migrating from the pre-split layout — neither binary ever reads from this path at startup. - get_
default_ manta_ server_ config_ file_ path - Returns the default server config file path
(e.g.
~/.config/manta/server.toml). - get_
server_ config_ file_ path - Returns the server config file path, honoring
MANTA_SERVER_CONFIGif set. - get_
server_ configuration - Load
server.toml. Fails loudly if the file is missing; the error message includes a minimal example and (when a legacy config.toml is detected) a field-by-field migration mapping. - read_
config_ toml - Reads the manta CLI configuration file (
cli.toml) and parses it as TOML, honoringMANTA_CLI_CONFIG. - write_
config_ toml - Writes a
DocumentMutback to the manta configuration file.