Skip to content

Commit 739f635

Browse files
committed
ts: lib/config/dockerSecret.js
1 parent 110ce70 commit 739f635

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
'use strict'
2-
3-
const fs = require('fs')
4-
const path = require('path')
1+
import * as fs from "fs";
2+
import * as path from "path";
53

64
const basePath = path.resolve('/var/run/secrets/')
75

8-
function getSecret (secret) {
6+
function getSecret(secret) {
97
const filePath = path.join(basePath, secret)
108
if (fs.existsSync(filePath)) return fs.readFileSync(filePath)
119
return undefined
1210
}
1311

12+
let dockerSecretConfig: any = {}
1413
if (fs.existsSync(basePath)) {
15-
module.exports = {
14+
dockerSecretConfig = {
1615
dbURL: getSecret('dburl'),
1716
// ssl path
1817
sslKeyPath: getSecret('sslkeypath'),
@@ -77,3 +76,5 @@ if (fs.existsSync(basePath)) {
7776
}
7877
}
7978
}
79+
80+
export = dockerSecretConfig

0 commit comments

Comments
 (0)