Live data from Hacker News

Where .env Went Wrong

secretspec.dev

21–30 of 77 posts

Re: Where .env Went Wrong

#23
post #22

> Where .env Went Wrong start with making it a dot file. Why would you want to hide the fact your app was using loaded environment variables?

I hate that it's hidden too. There's no reason for it to be hidden and arguably some reason for it not to be hidden.

I did discover one reason for it not to be just "env" though, which surprised me, which is that "source env" will yield "bash: source: /usr/bin/env: cannot execute binary file". I did not expect the source command to use the $PATH to resolve the filename. Probably some minor security issues that can result from that out there in the world. Arguably anyone loading it should use "source ./.env" or equivalent, with full path.

It's documented in the bash manual, of course. But it is rather complicated as to when it will and will not use $PATH.

Re: Where .env Went Wrong

#26
post #22

> Where .env Went Wrong start with making it a dot file. Why would you want to hide the fact your app was using loaded environment variables?

The fact that it's hidden means it doesn't get commited by accident in most git repos unless explicitly added or configured that way.

Re: Where .env Went Wrong

#27

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).

Yeah, this is the way. I assumed that was fairly standard at this point.

Re: Where .env Went Wrong

#28
post #9
post #6

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.

While there are absolutely a million of these env tools popping up which are total vibe-coded slop, secretspec is not one of them. It's from the creator of https://devenv.sh and has been around for a while.

the blog post is absolute slop though

Re: Where .env Went Wrong

#29
post #26
post #22

> Where .env Went Wrong start with making it a dot file. Why would you want to hide the fact your app was using loaded environment variables?

The fact that it's hidden means it doesn't get commited by accident in most git repos unless explicitly added or configured that way.

there shouldn't be any secrets in it so committing it shouldn't be a huge problem.
Post reply on HN