Saurron Configuration
Overview
Saurron uses a layered configuration that can include TOML file, environment variables, and CLI flags. Options specified through higher priority sources override options specified through lower priority sources. Option priority order from highest to lowest is:
- CLI flags
- Environment variables
- Config file (TOML format)
- Built-in defaults
All sources support all options.
See config reference for the complete list of every configuration option.
Command line flags
All options on the command line have a long form, which looks like --long-form-option <value>. Some options have a single-letter short form as well, which look like -f <value>. Some options take multiple arguments, which are always separated by commands:
--variadic-option arg1,arg2,arg3
Command line flags have the highest priority and override options from any other source.
Environment variables
With the exception of the standard Docker options, all environment variables start with the prefix SAURRON_. Environment variables have the second highest priority and will override options specified in the config file.
Config file
The optional configuration file uses TOML syntax. The config file path defaults to /etc/saurron/config.toml. You can override this via the --config CLI flag or the SAURRON_CONFIG environment variable.
Create a config file
To generate a sample config file, use the --generate-config {path} command. By default, without the optional {path} parameter, this command will stream the config to standard out. Include the optional {path} parameter to save the generated config using the specified filename.
Examples
Docker
docker run --name saurron \
ghcr.io/organicveggie/saurron:latest \
--generate-config > /etc/saurron.toml
Binary
saurron --generate-config /etc/saurron.toml
Secret file resolution
For a subset of configuration options, if the value of the option is a path to a readable file, Saurron transparently replaces the value with the file contents at startup. This enables Docker secrets without embedding sensitive values in env vars or CLI args.
Options supporting file contents substitution:
http_api.tokennotifications.email.fromnotifications.email.passwordnotifications.email.portnotifications.email.servernotifications.email.tonotifications.email.usernotifications.general.templatenotifications.mqtt.brokernotifications.mqtt.client_idnotifications.mqtt.passwordnotifications.mqtt.topicnotifications.mqtt.usernamenotifications.webhook.headersnotifications.pushover.tokennotifications.pushover.user_keynotifications.webhook.urlregistry_password