Skip to content

Commit

Permalink
add dotenv to make aws security easier
Browse files Browse the repository at this point in the history
  • Loading branch information
markbirbeck committed Jul 4, 2015
1 parent ab0f4d0 commit a3afd0d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Expand Up @@ -17,11 +17,14 @@ AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
```

Alternatively, the values can be provided via a config file. A template is provided at `config/environment.yaml` which can be copied and then filled in with your AWS keys. The name of the file you use should be set in the `NODE_ENV` environment variable. For example, if you create a file `config/test.yaml` to hold your keys then you can test as follows:
Alternatively, the values can be provided via config files. This can be with a `.env` file that will set environment variables, as well as with a structured config file.

If using a config file then a template is provided at `config/environment.yaml` which can be copied and then filled in with your AWS keys, and the name of the file you use will need to be set in the `NODE_ENV` environment variable.

For example, if you create a file `config/test.yaml` to hold your keys and other configuration information then you can test as follows:

```shell
export NODE_ENV=test
mocha
NODE_ENV=test npm test
```

For more information on why that works, see the magical [config module](https://npmjs.org/package/config).
Expand Down
1 change: 1 addition & 0 deletions lib/amqp-sqs.js
Expand Up @@ -2,6 +2,7 @@
* A wrapper around SQS that looks like AMQP.
*/

require('dotenv').load();
require('../config/set_defaults');

var CONFIG = require('config');
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -6,6 +6,7 @@
"dependencies": {
"aws-sdk": "^2.1.36",
"config": "^1.14.0",
"dotenv": "^1.2.0",
"limiter": "~1.0.5",
"lodash": "^3.10.0",
"winston": "^1.0.1",
Expand Down

0 comments on commit a3afd0d

Please sign in to comment.