1.7.0 • Published 6 months ago

envcredstash v1.7.0

Weekly downloads
4,508
License
ISC
Repository
-
Last release
6 months ago

Load credstash secrets into environment variables.

This project is inspired by envconsul.

Installation

sudo npm i -g envcredstash

Usage

Start by storing some secrets with credstash as follows:

credstash put application/DB_PASSWORD my-db-password
credstash put application/MAIL_PASSWORD my-mail-password

Then you can run your application as follows:

envcredstash --prefix application/ -- myapplication

Example:

envcredstash --prefix application/ -- python -c "import os; print os.environ['MAIL_PASSWORD']"

my-mail-password

Running env:

envcredstash --prefix application/ -- env
DB_PASSWORD=my-db-password
MAIL_PASSWORD=my-mail-password

You can also print the variables with the export clause, this is useful to source:

source <(envcredstash --prefix application/ --export)

python -c "import os; print os.environ['MAIL_PASSWORD']"
my-mail-password

Full list of arguments

envcredstash --help
Options:
  --table            The credstash table.          [default: "credential-store"]
  --prefix           The credstash prefix for keys.      [array] [default: [""]]
  --region           The credstash region.
  --export           Export variables syntax.                          [boolean]
  --list             Export variables syntax.                          [boolean]
  --help             Show help                                         [boolean]

As a library

const envcredstash = require('envcredstash');

envcredstash.get({
  prefixes: ['application/'],
  // table:
  // region:
}, (err, envs) => {
  console.dir(envs);
  //{
  //  DB_PASSWORD: "my-db-password"
  //  MAIL_PASSWORD: "my-mail-password"
  //}
});

License

MIT 2017 - José F. Romaniello

1.7.0

6 months ago

1.6.0

5 years ago

1.5.1

5 years ago

1.5.0

6 years ago

1.4.1

6 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.2.0

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago