Live data from Hacker News

Show HN: From dotenv to dotenvx – better config management

dotenvx.com

61–70 of 223 posts

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

#61

On my phone so can’t double test, but can’t you get this by adding “export” in front of every line in your env file and then source before running command? I suppose if you don’t want it to stay after execution i believe you can: > $(source .env; my command) I’m sure there is a fairly straightforward way to encrypt and decrypt a local file

dotenv has features that include conditional selection and ordered merging of env files, which are configurable by dotenv's runtime and buildtime APIs.

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

#62
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.

> Just set those env vars in your IDE.

How is that different from a dotenv, other than location of where the k/v persists?

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

#65

On my phone so can’t double test, but can’t you get this by adding “export” in front of every line in your env file and then source before running command? I suppose if you don’t want it to stay after execution i believe you can: > $(source .env; my command) I’m sure there is a fairly straightforward way to encrypt and decrypt a local file

Now take that a step further with Environment Modules and you can source them from any shell or scripting language: https://modules.readthedocs.io/ (without creating a subinterpreter)

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

#66

I don't really understand why this is a new project. Seems it would have been pretty simple to add these in a backwards compatible way. It would only break in cases where people's values specifically started with "encrypted:"

Even without backwards compatibility, why not just a breaking change in the same project? Don't get it either.

I've never used it (knowingly) but if I did and wanted to use this new version/project even the CLI name change to append 'x' would be annoying (I'd probably alias /symlink it).

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

#67

This is similar to how Rails handles secrets - https://edgeguides.rubyonrails.org/security.html#environment... In Rails, the entire file is encrypted unlike here where only the secrets are

Dotenvx used to encrypt by file. It’s a very recent design decision to encrypt by secret.

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

#68

I don't really understand why this is a new project. Seems it would have been pretty simple to add these in a backwards compatible way. It would only break in cases where people's values specifically started with "encrypted:"

Whether good or bad, it's marketing

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

#69

Encrypting secrets and committing them seems very convenient but I'm paranoid about these sorts of things. Can anyone tell me why this would be a bad idea? One reason I can think of is that normally with secrets I actually don't keep any copies of them. I just set them in whatever secret manager my cloud environment uses and never touch them again unless I need to rotate them. Meaning there is no way to accidentally…

Using encrypted secrets provides a way better developer experience than using a vault. Typically, developers can’t change production secrets in vaults and need to follow some other protocols. Encrypted secrets mean you deploy everything along side the secrets. The developer experience is great, but the biggest issues I have faced while using Kubeseal were 1. Developers HAVE the secret in order to encrypt it. This can…

I disagree. Using vaults isn’t that bad. And I’d also like developers to never actually know the secrets.

It’s a learning curve, but I think it’s best to just bite the bullet and use a vault rather than trusting developers to know and manage secrets properly.

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

#70

We’ve been pushing for committing encrypted secrets for many years now, and have written an open source spec and implementation in multiple languages: https://github.com/neosmart/securestore-rs

There's also sops: https://github.com/getsops/sops

I've used it at two jobs now over about 5 years and have had zero issues.

Post reply on HN