forked from tvrbo-pro/TvrboAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
44 lines (31 loc) · 972 Bytes
/
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
"use strict";
var nconf = require( 'nconf' );
nconf.env();
// 'ADMIN_' is prefixing every variable to prevent collisions in the server's
// environment variables
// To get the value of ADMIN_DEBUG, simply use it as config.DEBUG
// (skip the prefix)
var defaults = {
ADMIN_DEBUG: true,
ADMIN_APP_NAME: 'Tvrbo Admin',
ADMIN_HTML_TITLE: 'Tvrbo Admin',
ADMIN_AUTH_PERIOD: 1000 * 60 * 60 * 24,
ADMIN_ENFORCE_HTTPS: false,
ADMIN_HTTP_PORT: process.env.PORT || 8080,
ALLOW_CORS: false,
ADMIN_HTTP_USER: null,
ADMIN_HTTP_PASSWORD: null,
// DATABASE
ADMIN_MONGODB_URI: 'mongodb://localhost:27017/db',
// CERTBOT
ADMIN_ALLOW_CERTBOT: true,
// JWT SESSIONS
ADMIN_JWT_SECRET: '____SOME_LONG_KEY_HERE____'
};
nconf.defaults(defaults);
var k;
for(k in defaults) {
if(defaults.hasOwnProperty(k)) {
exports[k.replace(/^ADMIN_/, "")] = nconf.get(k); // REMOVING THE VARIABLE'S PREFIX _TVRBOREACT
}
}