forked from mozilla/send
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
66 lines (63 loc) · 1.16 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const convict = require('convict');
const conf = convict({
s3_bucket: {
format: String,
default: '',
env: 'S3_BUCKET'
},
redis_host: {
format: String,
default: 'localhost',
env: 'REDIS_HOST'
},
listen_port: {
format: 'port',
default: 1443,
arg: 'port',
env: 'PORT'
},
analytics_id: {
format: String,
default: '',
env: 'GOOGLE_ANALYTICS_ID'
},
sentry_id: {
format: String,
default: '',
env: 'SENTRY_CLIENT'
},
sentry_dsn: {
format: String,
default: '',
env: 'SENTRY_DSN'
},
env: {
format: ['production', 'development', 'test'],
default: 'development',
env: 'NODE_ENV'
},
max_file_size: {
format: Number,
default: 1024 * 1024 * 1024 * 2,
env: 'MAX_FILE_SIZE'
},
expire_seconds: {
format: Number,
default: 86400,
env: 'EXPIRE_SECONDS'
},
l10n_dev: {
format: Boolean,
default: false,
env: 'L10N_DEV'
},
base_url: {
format: 'url',
default: 'https://send.firefox.com',
env: 'BASE_URL'
}
});
// Perform validation
conf.validate({ allowed: 'strict' });
const props = conf.getProperties();
module.exports = props;