Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there away to decrypt the env.enc back into a .env plaintext? #4

Closed
mendeljacks opened this issue Sep 15, 2019 · 2 comments
Closed

Comments

@mendeljacks
Copy link

The use case is that developers and production servers each have copies of a private key. The env.enc is committed to the git repository, and assuming the developer knows the private key they can add or remove from the env.enc. Ideally a server such as heroku or aws would only need one env varaible which is the secret key to get the rest of the env variables.

At the moment however, it appears as though once someone locks and commits the env.enc, the other developers have no way of reading the env variables even if they know the secret key because the file can only be unencrypted programmatically and not with a cli

@kunalpanchal
Copy link
Owner

Hey @mendeljacks,
Thanks for raising this concern. As of now there is no option for in secure-env cli to decrypt env.env, and this could be done only via code. For heroku or any other service what you can do is add secretKey to heroku/aws config and in your code :

let secureEnv = require('secure-env');
global.env = secureEnv({ secret: process.env.secretKey });

Adding the dycrypt functionality to secure-env CLI seems to be a valid request though. I will keep this issue open and mark it closed when this feature is implemented. I will add this as a task for next release v1.0.0.

Repository owner deleted a comment from github-actions bot Sep 15, 2019
kunalpanchal added a commit that referenced this issue Oct 11, 2019
@kunalpanchal
Copy link
Owner

Fixed with #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants