feat: added flexible configuration system using figment
This commit is contained in:
parent
f16cdfdfff
commit
f9ffc21a3f
11 changed files with 227 additions and 74 deletions
21
README.md
21
README.md
|
|
@ -11,3 +11,24 @@ Gpodder, suitable for low-power devices.
|
|||
* Devices API
|
||||
* Subscriptions API
|
||||
* Episode actions API
|
||||
|
||||
## Configuration
|
||||
|
||||
Otter is configurable via a TOML config file, environment variables and CLI
|
||||
arguments thanks to the [Figment](https://docs.rs/figment/latest/figment/)
|
||||
library. Each variable in the configuration file below can be provided via an
|
||||
environment variable (prefixed using `OTTER_`) or a CLI argument.
|
||||
|
||||
```toml
|
||||
data_dir = "./data"
|
||||
domain = "127.0.0.1"
|
||||
port = 8080
|
||||
```
|
||||
|
||||
Otter can be told to read a config variable using the `--config/-c` flag (see
|
||||
the `help` command for other useful CLI commands). Each variable needs to be
|
||||
provided either from the config file, as an environment variable (e.g.
|
||||
`OTTER_DATA_DIR`) or a CLI argument (e.g. `--data-dir`).
|
||||
|
||||
If a variable is provided in multiple ways, environment variables overwrite
|
||||
configuration file variables, and CLI arguments overwrite both.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue