Skip to main content

Module env_override

Module env_override 

Source
Expand description

Environment variable overrides for atrg.toml configuration.

Any field in Config can be overridden at runtime via an environment variable. The naming convention uses a double-underscore (__) to separate the section from the field:

Config fieldEnv var
app.nameATRG_APP__NAME
app.hostATRG_APP__HOST
app.portATRG_APP__PORT
app.secret_keyATRG_APP__SECRET_KEY
app.environmentATRG_APP__ENVIRONMENT
app.cors_originsATRG_APP__CORS_ORIGINS
auth.client_idATRG_AUTH__CLIENT_ID
auth.redirect_uriATRG_AUTH__REDIRECT_URI
auth.scopeATRG_AUTH__SCOPE
database.urlATRG_DATABASE__URL

For app.cors_origins, provide a comma-separated list of origins, e.g. ATRG_APP__CORS_ORIGINS="http://localhost:5173,https://example.com".

Invalid values (e.g. a non-numeric ATRG_APP__PORT) are logged as warnings and silently ignored — the original config value is preserved.

Functions§

apply_env_overrides
Apply environment variable overrides to a mutable Config.