Improve configuration handling #2
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/diplonat#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
At the moment, Diplonat reads its configuration variables only from the environment:
I am planning on adding ACME capability to Diplonat. This will add many more configuration options. Using environment variables will become impractical.
I want Diplonat to read its configuration variables from a file (most simple INI-style format, at the moment).
Also, since we are talking about only a few variables, I plan on using only one configuration file at the moment.
The configuration file will allow to eschew environment variables for Diplonat's configuration, but will not obsolete them. As common practice: if both a configuration file and an environment variable provide for the same information, the environment variable superseedes the configuration file's information.
Any comments on the configuration file format?
I don't have the experience of the Heroku people that wrote 12factor.net . However, they say one should use the environment instead of writing config files in some language, stored somewhere arbitrary. So I'll stick to the current situation that uses environment variables instead of proposing an anti-feature, and just parse the environment using the crate Envy (as suggested in environment.rs).
Docs:
The
trunk
crate does a good job with its configuration: a Toml config file is superseeded by the environment variables. See the doc and the code.Read Diplonat's configuration variables from a configuration fileto Improve configuration handlingResolved by PR#5!