kratos: Dotenv files are respected and incorrectly override environment variables
Describe the bug
If I have ENVironment variables and a .env file in root where kratos starts it reads the .env file variable instead of the environment variable.
Reproducing the bug
Steps to reproduce the behavior:
- Run
export DSN="varFromEnv" - Create
.envfile with:DSN="varFromFile" - Run
./kratos -c ./kratos.yml migrate sql -e --yes
The value of DSN in Kratos is: varFromFile.
Expected behavior
I think we should read FIRST from Environment variable (if present) because .env file can contain development vars (as in my case).
Environment
- Version: oryd/kratos:v0.7.6-alpha.1
- Environment: Docker
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 18 (18 by maintainers)
OK - sorry about that, am trying to clean up old issues, and this one last saw activity in 2021. Thanks for the feedback, reopening!
Yes! 😃
Ha, good question! I don’t know to be honest. My guess would be last one wins!