Consolidate .env files
The current approach to manage .env files is cumbersome and could be improved.
The .env
file is tracked in the repository, so any changes made during development have to be ignored in commits. Conversely, the .env.secrets
file is ignored so it's necessary to copy .env.secrets.example
.
I think a better approach would be to have all variables in a single .env
file (including secrets), and ignore that file altogether. In that way, a .env.example
file could include examples and documentation for any variable, regardless of being secret or not.
An additional improvement would be to provide a script/command to generate secrets. Since the task of populating the secrets is left to the developer, and there isn't any guidance as to which length or format those should have. It'd be useful to provide a command to generate those values.