Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Use password stored in an environmental variable #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ahadik
Copy link

@ahadik ahadik commented May 21, 2016

I've had a difficult time integrating this module into some continuous delivery pipelines like PM2 because for some reason (I really don't know why) piping a password using echo (echo 'my_pass' | npm run encrypt) doesn't work in the isolated environments set up to build and deploy code.

To get around this, I've added support for a single flag --PW to which you pass the name of an environmental variable set to a desired password.

Example use in package.json: encrypt: encrypt config.json config.json.cast5 --PW=ENV_VAR

This by-passes manual password entry from stdin and instead uses the value found at the --PW environmental variable, if it exits. If the environmental variable is not set, the command exits with exit status 1.

ahadik added 2 commits May 21, 2016 14:06
…he --PW flag to encrypt and decrypt using the value of the supplied environmental variable key.
…y environmental variable and exits normally for manual password entry
@ziarno
Copy link

ziarno commented Oct 20, 2016

awesome, please merge this ;)

@ripper234
Copy link

FYI, I just submitted a similar PR #8 that adds support for passing the password as a command line argument (I did it before noticing this existing PR).

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

Successfully merging this pull request may close these issues.

None yet

3 participants