mehcode / config-rs

⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
Apache License 2.0
2.56k stars 213 forks source link

reading values via environment variables in bash #569

Open 8de2fdb0 opened 3 months ago

8de2fdb0 commented 3 months ago

Reading nested environment variables is kind of impossible when using this library.

Env variables like: APP.NESTED_CONFIG.VALUE

Don't really work in Bash, the workaround is to use a double underscore for separators __, I guess parsing would have been a bit harder if _ would be supported in that case. But from a usability perspective this is a real foodgun.

softdevca commented 2 months ago

In fact, dots in environment variables aren't POSIX compliant. See https://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names/2821201#2821201