Closed Djyp closed 3 years ago
Ok for me, it's a good opportunity to setup a better (more flexible) dotenv crate where you can have a thiner config.
I have checked possible crates, maybe this one is a good way to provide thiner configurations : https://github.com/sagiegurari/cargo-make
It's rich and with dedicated toml files, looks a lot more idiomatic to Rust eco-system, what do you think ?
months later : Adding cargo-make is quite a big change for something I am not yet mastering. I think I was trying to be perfect and I'm now accepting actix as is. It's an optimization on a non-essential matter.
I'd rather close the issue.
I'd like to have this architecture with .env files where the .env is a commited file and we .gitignore a .env.local that overrides some variables. It's what we do in Symfony and it is way better because you don't need to create a .env from the .env.dist, it's already there, you just need to customize vars with a .env.local when needed.
It allows us to set default values and give a way to override them. It's easier to maintain an instance because the new vars are commited and they appear automatically on every update.
The usual case is with DATABASE_URL, but can happen with any variable.
.env
.env.local