You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ability to declare placeholder values in our configuration files that will be taken from the environment variables.
Use Case
Sometimes we do not decide how our environment variables will be named, so we don't get to define them with prefixes like APP__
It would be nice if we could declare placeholders in our configuration files where the values should be taken from our environment variables.
Example:
application_port: ${PORT} #value taken from PORT environment variabledatabase:
host: "127.0.0.1"port: 5432username: "postgres"password: "${DB_PASS}"#value taken from DB_PASS environment variabledatabase_name: "${DB_HOST}"#value taken from DB_HOST environment variablerequire_ssl: false
The text was updated successfully, but these errors were encountered:
Sounds like something for the "re-thinking" ideas list, thus I added it to the project. I guess we could add (optional) support for templating engines, which would easily resolve this feature request. Adding own logic that does such replacements would be overkill and out of scope for this crate, IMO, but I like the idea of exposing enough interfaces so that a user can easily add templating to the loading/parsing logic of config-rs!
I do not yet have anything specific in mind, no. If you like to experiment (emphasis on "experiment"), have a look at the rethinking issues. There's a branch linked somewhere where I am exploring my ideas.
Feature description
Ability to declare placeholder values in our configuration files that will be taken from the environment variables.
Use Case
Sometimes we do not decide how our environment variables will be named, so we don't get to define them with prefixes like
APP__
It would be nice if we could declare placeholders in our configuration files where the values should be taken from our environment variables.
Example:
The text was updated successfully, but these errors were encountered: