Live data from Hacker News

Show HN: From dotenv to dotenvx – better config management

dotenvx.com

11–20 of 223 posts

Re: Show HN: From dotenv to dotenvx – better config management

#13
Secrets in env vars in production is not too secure either, ideally you’ll move to your app pulling secrets in-process from your infrastructure at boot-up or upon use. This also gives a nice advantage of not needing to rebuild the app or container or whatever to rotate a secret.

Re: Show HN: From dotenv to dotenvx – better config management

#14
post #3

I don't get it. Dotenv is only good for local dev. Otherwise you should put your secrets in environment variables (the "env" in ".env"). That people put .env files in prod is a mistake itself, and the proposed fixes here seem to not really do much about that.

Just set those env vars in your IDE. Let your IDE or docker-compose or whatever read an .env file if you must. But don't do it directly from your application code, indeed you're one lazy dev away from putting an .env file on prod servers. Using dotenv-like constructions is, in my eyes, an antipattern.

And it need not even be an IDE. Whatever environment you use for development, set environment variables in that.

Re: Show HN: From dotenv to dotenvx – better config management

#16
post #13

Secrets in env vars in production is not too secure either, ideally you’ll move to your app pulling secrets in-process from your infrastructure at boot-up or upon use. This also gives a nice advantage of not needing to rebuild the app or container or whatever to rotate a secret.

This just moves the problem to a different step. How are you going to manage access to said secrets, especially when your application lives off premises?

Re: Show HN: From dotenv to dotenvx – better config management

#17

Seems odd to announce new features without calling out to the fact that libraries with the same name in other languages have had those same features for years. (for example, the dotenv gem in Ruby)

Node.js already has built in support for .env https://nodejs.org/en/blog/release/v20.6.0#built-in-env-file...

True, but the dotenv npm package has been around much longer than that support (11 years vs 9 months), and the .env support in Node doesn't yet support features like auto-inclusion of environment-specific files.

Re: Show HN: From dotenv to dotenvx – better config management

#18
post #3

I don't get it. Dotenv is only good for local dev. Otherwise you should put your secrets in environment variables (the "env" in ".env"). That people put .env files in prod is a mistake itself, and the proposed fixes here seem to not really do much about that.

> Dotenv is only good for local dev.

It wouldn't surprise me if many VPS use .env files.

Post reply on HN