24 releases (14 breaking)

new 0.28.0 Dec 12, 2024
0.27.0 Nov 20, 2024
0.26.0 Nov 18, 2024
0.17.0-rc.1 Jul 19, 2024
0.12.0-alpha Mar 18, 2024

#190 in Configuration

Download history 153/week @ 2024-08-26 4/week @ 2024-09-09 318/week @ 2024-09-16 36/week @ 2024-09-23 90/week @ 2024-09-30 185/week @ 2024-10-07 19/week @ 2024-10-14 4/week @ 2024-10-21 131/week @ 2024-10-28 15/week @ 2024-11-04 288/week @ 2024-11-18 14/week @ 2024-11-25 13/week @ 2024-12-02

317 downloads per month
Used in 2 crates (via opentalk-database)

EUPL-1.2

215KB
5K SLoC

Contains the application settings.

The application settings are set with a TOML config file. Settings specified in the config file can be overwritten by environment variables. To do so, set an environment variable with the prefix OPENTALK_CTRL_ followed by the field names you want to set. Nested fields are separated by two underscores __.

OPENTALK_CTRL_<field>__<field-of-field>...

Example

set the database.url field:

OPENTALK_CTRL_DATABASE__URL=postgres://postgres:password123@localhost:5432/opentalk

So the field 'database.max_connections' would resolve to:

OPENTALK_CTRL_DATABASE__MAX_CONNECTIONS=5

Note

Fields set via environment variables do not affect the underlying config file.

Implementation Details:

Setting categories, in which all properties implement a default value, should also implement the Default trait.

Dependencies

~42MB
~448K SLoC