| ▲ | Where .env Went Wrong(secretspec.dev) | ||||||||||||||||||||||||||||
| 38 points by domenkozar a day ago | 20 comments | |||||||||||||||||||||||||||||
| ▲ | c-hendricks a day ago | parent | next [-] | ||||||||||||||||||||||||||||
Also mise: https://mise.jdx.dev/environments/ | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| ▲ | theozero a day ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Over at varlock (https://varlock.dev -- also free, open source), we agree that .env as we know it is full of problems. But instead of abandoning it, we evolved it. We replace your .env.example with a .env.schema - using decorator style comments to add schema info, and functions to load and compose values. A big difference between our tool and many other similar tools is that we combine the schema and value setting into one surface, with a way of merging many definitions together, much like cuelang - but in a way that feels more intuitive. It's extremely flexible, and can even do credential brokering for untrusted workloads. I've been enjoying the secretspec content lately, and watching it evolve :) | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| ▲ | eigencoder a day ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Hm, I haven't seen these issues personally. We only have one `.env` file and it's just for local secrets. Configuration emphatically does not go in `.env` and ideally is in docker compose and defined in code (we use Pydantic Settings). | |||||||||||||||||||||||||||||
| ▲ | qntty a day ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
I use Pydantic Settings for this, would be nice to see a comparison to that. I do like the idea of keeping this in a configuration file. | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| ▲ | ctippett a day ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
I'm sure there are many better alternatives to .env, but its ubiquity and support across various tools makes it super convenient. I'm using 1Password's .env integration[1] and although the UX is a bit clunky, I really like it. My API keys are secure, tools that ordinarily support .env just work and there's a team-sharing feature too (although I'm yet to use it). It's pretty neat. | |||||||||||||||||||||||||||||
| ▲ | jonny_eh a day ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Also: https://varlock.dev/ | |||||||||||||||||||||||||||||
| ▲ | Natfan a day ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Claude, find a key underpinning of most development workflows, then make a product to disrupt (and eventually SaaSify/enshitify) it. Finally, write a convincing ad disguised blog post, and purchase a fancy domain. Here's my credit card. | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| ▲ | tosti a day ago | parent | prev [-] | ||||||||||||||||||||||||||||
One could also... Not jump on the bandwagon? (Am I getting thrown out the window now? :) | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||