PerlDancer / Dancer2

Perl Dancer Next Generation (rewrite of Perl Dancer)
http://perldancer.org/
Other
542 stars 274 forks source link

Replace strings in Dancer2 config with environment variables #1629

Closed mikkoi closed 2 years ago

mikkoi commented 3 years ago

Ref #1628

What this PR changes?

1) After reading the whole config from different files, it traverses the whole tree and if it sees a string with a substring like "${ENV:SOME_ENV}", it changes it to the corresponding environment variable, if that environment variable is defined. 2) Before doing 1), it checks if the config item "env_var_replace" is defined and is boolean true. If so, then it executes 1). Otherwise it skips. This is to maintain backwards compatibility. 3) Unit tests included.

I am using this solution in my build and web application.

xsawyerx commented 2 years ago

I see now that this was closed. I commented on the original ticket with a way that I think we can do this in core.