From dotenv to dotenvx

Dev tools

environment configuration

SHOW HN2024

354points
206comments
#146of 3,515 in 2024
Top 5%of 2024 by points

How HN took it

MixedNo clear lean

7 positive, 41 neutral or asking, 3 mixed, 50 critical, out of 101 comments about the project. Thread score -0.43.

Privacy: 3 for, 22 againstIdea: 3 for, 13 againstExecution: 0 for, 4 againstDesign: 0 for, 3 againstDocs: 0 for, 2 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Encrypting env files so they can be committed is a sensible tradeoff

    From 3 comments
    • With leaking secrets being such a big concern, it seems wise to require that secrets be encrypted to use dotenvx. That is, it will only work with encrypted secrets. As others…
      michaelmior on HN
    • dotenvx encryption goes a long way towards solving THE BIGGEST problem with dotenv; using multiple tools to ensure that secrets are protected. I wonder if dotenvx ensures that…
      nunez on HN
    • We implemented the exact same method for config encryption a year ago or so, using pub/private key auth and the same `encrypted:` prefixes for encrypted config values. This is a…
      the_duke on HN

Objections

  • Committing encrypted secrets to git is a bad habit

    From 2 comments
    • I don't think encryption is a good idea, and the reason is forming bad habits. Now developers have a very strong and non-ambiguous habit: never put .env files in version control…
      golergka on HN
    • This seems to encourage committing encrypted secrets, which is a bad idea. Configuration and code should be in separate repositories. Secrets should be protected elsewhere. The…
      sneak on HN
  • Adds dependencies and is written in JavaScript

    From 3 comments
    • dotenv has zero npm dependencies. dotenvx has 21, including a few I have never heard of. Is this really more secure?
      stiiv on HN
    • My beef with it is that it's written in Javascript whereas what it does is so simple that they should just code it up in Rust or Go and be done with it, particularly when it…
      PaulHoule on HN
    • Thanks, but I would rather go with the imperfect setup that I understand than an allegedly perfect setup with dozens of third party dependencies that I don't understand. Doubly…
      frithsun on HN
  • Environment variables and .env files are the wrong place for secrets

    From 3 comments
    • I think it's good advice to not pass secrets through environment variables. Env vars leak a lot. Think php_info, Sentry, java vm dumps, etc. Also, env vars leak into…
      cimnine on HN
    • 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…
      boxed on HN
    • 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…
      jitl on HN

Requests

  • Option to choose .env file via environment variable

    From 1 comment
    • Would be nice to be able to configure which .env file to read as an environment variable. Why? Imagine a package.json with this line: `start: dotenvx run -f .env.local -f .env --…
      daralthus on HN
  • Support for secrets managers

    From 1 comment
    • I always thought highly of the approach used by https://www.npmjs.com/package/@strong-config/node Does dotenvx support secrets managers?
      difu_disciple on HN
  • TypeScript types

    From 1 comment

Questions

  • How does it work with IDE run configurations and plain commands like ruby index.rb

    From 2 comments
    • How would this work with application-specific Intellij Run/Debug configurations? Would this require switching to a "Shell Script" configuration, thereby losing debugging…
      kodeninja on HN
    • So with this, I have to prefix every executable with dotenvx in order to utilize the env variables? Can’t I somehow do this in the script itself so “ruby index.rb” is enough? I…
      Alifatisk on HN
  • Why make network requests and what is the hub

    From 1 comment
    • I'm not comfortable that this tool is able to make HTTP requests, IMO it ought to be completely offline and not perform network operations. I did a search for requests and found…
      politelemon on HN

Alternatives named

  • sops

    From 2 comments
    • Seems pretty similar to sops[0], but without the encrypted-by-default feature that makes sops feel significantly safer for secret management. Sops also integrates easily with AWS…
      mplanchard on HN
    • Personally, I like sops for encrypting my secrets.
      hooverd on HN
  • Vault services

    From 2 comments
    • Can a kind soul point me some documentation on how to put .env in a vault correctly? Possibly open-source solutions? If the vault is password protected, aren't you just adding…
      rrgok on HN
    • I’ve been using dotenv-cli for a long time now. I appreciate the encryption, but I will keep loading secrets from a vault instead.
      hermanradtke on HN
  • dotenv-cli and foreman

    From 2 comments
    • I’ve been using dotenv-cli for a long time now. I appreciate the encryption, but I will keep loading secrets from a vault instead.
      hermanradtke on HN
    • I always used foreman [0] which I found to be superior to dotenv in every way. Even superior to this new dotenvx [0] https://github.com/ddollar/foreman
      VWWHFSfQ on HN
  • phase.dev

    From 1 comment
    • I don't think this is the best approach. I am building https://phase.dev which lets you import secrets (.env), encrypt secrets (end-to-end encrypted with keys you control), sync…
      nimishk on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/40789353)