Hi folks,
I'm not sure if this is considered a bug or "expected behavior," but --envfile overwrites any existing environment variables, which seems like the opposite of other dotenv libraries such as https://github.com/bkeepers/dotenv.
Similarly, it seems like if godotenv was used instead of a custom parser, this logic would be the same: https://github.com/joho/godotenv#precedence--conventions
For example, I would expect FOO to be system, but instead Caddy reads .env here:
$ cat .env
FOO=.env
$ FOO=system caddy run --envfile .env --environ
...
FOO=.env
...
If this is expected behavior, would it be possible to get an optional flag to prevent this from happening?
For example, a common use case may be to have a Kubernetes ConfigMap mounted with environment-specific environment variables, but you still want to have a .env file to fallback on, if it makes sense.
I opened a PR if it's alright, looking forward to hearing your thoughts 🙌 #5803
Thanks in advance!
Hi folks,
I'm not sure if this is considered a bug or "expected behavior," but
--envfileoverwrites any existing environment variables, which seems like the opposite of other dotenv libraries such as https://github.com/bkeepers/dotenv.Similarly, it seems like if
godotenvwas used instead of a custom parser, this logic would be the same: https://github.com/joho/godotenv#precedence--conventionsFor example, I would expect
FOOto besystem, but instead Caddy reads.envhere:If this is expected behavior, would it be possible to get an optional flag to prevent this from happening?
For example, a common use case may be to have a Kubernetes ConfigMap mounted with environment-specific environment variables, but you still want to have a
.envfile to fallback on, if it makes sense.I opened a PR if it's alright, looking forward to hearing your thoughts 🙌 #5803
Thanks in advance!