Re:Show HN: Dotenv, if it is a Unix utility
by whalesalad on Sunday April 28, 2024 @10:17PM
(#40193728)
Because I banned it haha. There should not be more than one .env file. Our projects have a .env.example that has any overrides a dev might want to override but this list is kept intentionally very short. Meanwhile .env is noted in gitignore. I absolutely hate seeing an entire application configured with environment variables. Some? Sure, where it makes sense. Most? No, those should be in version control, secrets aside.
I believe in convention over configuration. Most of our apps have hard-coded config, with a concise/short and finite number of things that can be overridden (like 3-4 parameters, tops). Secrets get injected.
I do subscribe to the idea of the 12 factor app, but there is a line that needs to be drawn between env config which is more dynamic and more persistent config that should be baked in to the release.
Re:Show HN: Dotenv, if it is a Unix utility
by sureglymop on Monday April 29, 2024 @01:51AM
(#40194901)
To add to that, SOME_SECRET env vars should be banned (or at least overridable) in favor of SOME_SECRET_FILE env vars. I usually just put an example of the env vars into the readme or link to the file in the source code handling that directly.
Re:Show HN: Dotenv, if it is a Unix utility
by silversmith on Monday April 29, 2024 @02:55AM
(#40195313)
But then the problem is changing configs means building a new release, and needs code push access. Pretty much every config variable has env override in my apps - allows project owner to poke about in web UI without bothering me for changes.
Would love to hear more about why dotenv is banned at your org though.