commit
73cf66c592
3 changed files with 18 additions and 14 deletions
14
package-lock.json
generated
14
package-lock.json
generated
|
@ -13,7 +13,7 @@
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"concurrently": "^6.3.0",
|
"concurrently": "^6.3.0",
|
||||||
"docker-secret": "^1.2.3",
|
"docker-secret": "^1.2.4",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^10.0.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
|
@ -1191,9 +1191,9 @@
|
||||||
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
|
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
|
||||||
},
|
},
|
||||||
"node_modules/docker-secret": {
|
"node_modules/docker-secret": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.4.tgz",
|
||||||
"integrity": "sha512-JFUGiZEiNO0Hi9YzZAdCc5MwUpgQOjz0OeZkkcEv+lH6ZBkXNK97w2gcBQCsg5WRsT+Cj9eKFhuYyDxT8j56+A==",
|
"integrity": "sha512-aH3truzfxV8TikMa0wJES8h0v2FAwhuQZYk116ZVOHFZ1vnDTGutgCOvXmBPyLBG1Lo7yv93FdHVRTvhFFaC/g==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
|
@ -5335,9 +5335,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"docker-secret": {
|
"docker-secret": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.4.tgz",
|
||||||
"integrity": "sha512-JFUGiZEiNO0Hi9YzZAdCc5MwUpgQOjz0OeZkkcEv+lH6ZBkXNK97w2gcBQCsg5WRsT+Cj9eKFhuYyDxT8j56+A=="
|
"integrity": "sha512-aH3truzfxV8TikMa0wJES8h0v2FAwhuQZYk116ZVOHFZ1vnDTGutgCOvXmBPyLBG1Lo7yv93FdHVRTvhFFaC/g=="
|
||||||
},
|
},
|
||||||
"dot-prop": {
|
"dot-prop": {
|
||||||
"version": "5.3.0",
|
"version": "5.3.0",
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"concurrently": "^6.3.0",
|
"concurrently": "^6.3.0",
|
||||||
"docker-secret": "^1.2.3",
|
"docker-secret": "^1.2.4",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^10.0.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
|
|
|
@ -3,14 +3,18 @@ const Logger = require('../Logger');
|
||||||
const logger = new Logger();
|
const logger = new Logger();
|
||||||
|
|
||||||
const initDockerSecrets = () => {
|
const initDockerSecrets = () => {
|
||||||
const secrets = getSecrets();
|
try {
|
||||||
|
const secrets = getSecrets();
|
||||||
|
|
||||||
for (const property in secrets) {
|
for (const property in secrets) {
|
||||||
const upperProperty = property.toUpperCase();
|
const upperProperty = property.toUpperCase();
|
||||||
|
|
||||||
process.env[upperProperty] = secrets[property];
|
process.env[upperProperty] = secrets[property];
|
||||||
|
|
||||||
logger.log(`${upperProperty} was overwritten with docker secret value`);
|
logger.log(`${upperProperty} was overwritten with docker secret value`);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
logger.log(`Failed to initialize docker secrets. Error: ${e}`, 'ERROR');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue