-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.js
50 lines (45 loc) · 1.05 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var convict = require('convict');
var conf = convict({
transip: {
login: {
doc: 'The username to login',
format: String,
default: null,
env: 'TRANSIP_LOGIN'
},
privateKeyPath: {
doc: 'Path to where the private key is stored used for api request',
format: String,
default: null,
env: 'TRANSIP_PRIVATE_KEY'
}
},
domain: {
doc: 'The domain to update the DNS record of',
format: String,
default: null,
env: 'TRANSIP_DOMAIN'
},
dnsRecord: {
doc: 'The name of the DNS record to update',
format: String,
default: null,
env: 'TRANSIP_DNS_RECORD'
},
logLocation: {
doc: 'Path to create the log file',
format: String,
default: './output.log',
env: 'TRANSIP_LOG_LOCATION'
}
});
// Ugly part about loading config.
// Check if there is a local config
try {
conf.loadFile('./config-example.json');
} catch(err) {}
// If we run with docker we want to link a config folder.
try {
conf.loadFile('/config/config.json');
} catch(err) {}
module.exports = conf;