Skip to main content

Module config

Module config 

Source
Expand description

Configuration and authentication for the ROMM client.

This module is deliberately independent of any particular frontend: both the TUI and the command-line subcommands share the same Config and AuthConfig types.

§Environment file precedence

Call load_config to read config:

  1. Variables already set in the process environment (highest priority).
  2. Project .env in the current working directory (via dotenvy).
  3. User config: {config_dir}/romm-cli/.env — fills keys not already set (so a repo .env wins over user defaults).
  4. OS keyring — secrets stored by romm-cli init (lowest priority fallback).

§load_config vs config.json

load_config merges sources per field: process environment wins over values from config.json for API_BASE_URL, ROMM_DOWNLOAD_DIR, API_USE_HTTPS, and auth-related variables. The keyring is used only to fill missing or placeholder secrets after that merge.

Structs§

Config

Enums§

AuthConfig

Constants§

KEYRING_SECRET_PLACEHOLDER
Written to config.json when the real secret is stored in the OS keyring (persist_user_config).

Functions§

is_keyring_placeholder
True if s is the sentinel written to disk when the secret lives in the keyring.
keyring_store
Store a secret in the OS keyring under the romm-cli service name.
load_config
normalize_romm_origin
RomM site URL: the same origin you use in the browser (scheme, host, optional port).
openapi_cache_path
Where the OpenAPI spec is cached (.../romm-cli/openapi.json).
persist_user_config
Write user-level romm-cli/config.json and store secrets in the OS keyring when possible (same layout as interactive romm-cli init).
read_user_config_json_from_disk
Reads config.json from disk only (no env merge, no keyring resolution). Used by the TUI setup wizard to detect <stored-in-keyring> placeholders.
user_config_dir
Directory for user-level config (romm-cli under the OS config dir).
user_config_json_path
Path to the user-level config.json file (.../romm-cli/config.json).