21 releases (11 breaking)

new 0.25.0 Oct 30, 2024
0.20.0 Sep 20, 2024
0.17.0-rc.1 Jul 19, 2024
0.12.0-alpha Mar 18, 2024

#155 in Configuration

Download history 883/week @ 2024-07-14 56/week @ 2024-07-21 118/week @ 2024-07-28 120/week @ 2024-08-04 17/week @ 2024-08-11 2/week @ 2024-08-18 142/week @ 2024-08-25 11/week @ 2024-09-01 4/week @ 2024-09-08 295/week @ 2024-09-15 57/week @ 2024-09-22 92/week @ 2024-09-29 178/week @ 2024-10-06 25/week @ 2024-10-13 4/week @ 2024-10-20 125/week @ 2024-10-27

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

EUPL-1.2

180KB
4.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

~41MB
~451K SLoC