diff --git a/README.md b/README.md index b50d650..745f5e3 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,8 @@ npm install @cloudreach/docker-secrets const secrets = require('@cloudreach/docker-secrets'); console.log(secrets); ``` + +## Customization + +If the `SECRETS_DIR` environment variable is set, the specified location will be used in stead of `/run/secrets`. + diff --git a/index.js b/index.js index 2d100ee..8b29c71 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ const fs = require('fs'); const path = require('path'); -const SECRETS_DIR = '/run/secrets'; +const SECRETS_DIR = process.env.SECRETS_DIR || '/run/secrets'; const output = {}; if (fs.existsSync(SECRETS_DIR)) {