Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Allow overriding of directory using SECRETS_DIR env var #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down