1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-23 13:29:35 +02:00

added integration for docker secrets

This commit is contained in:
Abbie Wade 2021-11-20 10:54:34 +11:00
parent 4c1c0087c7
commit 7a8808df4f
7 changed files with 4242 additions and 13 deletions

15
utils/init/initSecrets.js Normal file
View file

@ -0,0 +1,15 @@
const { getSecrets } = require('docker-secret');
const Logger = require('../Logger');
const logger = new Logger();
const initSecrets = () => {
const secrets = getSecrets();
for (const property in secrets) {
const upperProperty = property.toUpperCase();
process.env[upperProperty] = secrets[property];
logger.log(`${upperProperty} was overwritten with docker secret value`, 'WARN');
}
};
module.exports = initSecrets;