forked from ParalelniPolis/rfid-access-system-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
65 lines (55 loc) · 1.37 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
'use strict';
var config = module.exports = {
host: process.env.PRASE_HOST || 'localhost',
port: parseInt(process.env.PRASE_PORT || 3000),
db: {
client: process.env.PRASE_DB_CLIENT || 'mysql',
connection: {
host: process.env.PRASE_DB_HOST || '127.0.0.1',
port: parseInt(process.env.PRASE_DB_PORT || 3306),
user: process.env.PRASE_DB_USER || 'prase_local',
password: process.env.PRASE_DB_PASS || 'password',
database: process.env.PRASE_DB_NAME || 'prase_local',
timezone: process.env.PRASE_DB_TIMEZONE || 'UTC'
}
},
site: {
name: 'p.r.a.s.e.',
slogan: 'RFID access system at Paralelni Polis'
},
passwords: {
workFactor: parseInt(process.env.PRASE_PASSWORDS_WORK_FACTOR || '10')
},
nonce: {
maxAge: 5 * 60 * 1000// 5 minutes
},
sessions: {
key: 'prase-session',
secret: process.env.PRASE_SESSIONS_SECRET,
cookie: {
path: '/',
maxAge: 30 * 86400 * 1000,// 30 days
httpOnly: true,
secure: false
},
secureProxy: false,
proxy: false,
resave: true,
saveUninitialized: false,
storeOptions: {
expiration: 30 * 86400 * 1000,// 30 days
autoReconnect: true,
keepAlive: true
}
},
template: {
extension: '.html',
defaultLayout: 'main',
viewsDir: __dirname + '/views'
},
publicDir: __dirname + '/public'
};
if (!config.sessions.secret) {
throw new Error('config.sessions.secret is required');
process.exit(1);
}