3 ms·
One thing I love to use pass with is direnv. The problem direnv solves for me is: how can I have persistent local config/settings in a shared repo without havin
by vinceguidry 5y ago
One thing I love to use pass with is direnv. The problem direnv solves for me is: how can I have persistent local config/settings in a shared repo without having to push code? Invariably at work there is always the 'shared access credentials to third-party services'. Usually you just throw these in a .env file. This leaves them on your drive in plaintext.
Instead, stuff the creds into pass, and since dotenv leverages bash, you can put substitutions in your .envrc file. Bonus, now that the creds are in a personal secured repo, you don't have to go hunting for the creds every time you want to spin up a new dev machine. (you do unfortunately still have to migrate your .envrc, I tried writing git tooling to make it easier but I could never find a convenient place to store them. I have ideas to extend git to try out the next time I want to iterate on this)
This does require your app to be properly configurable with environment variables, meaning if an envvar is present, it should override all other settings. Envvars don't get set by accident so they should be treated as the ultimate settings. This is usually the case with most frameworks but I've run into Node apps where this wasn't the case. Maddening.