forked from jhurliman/node-echoprint-server
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.js
54 lines (42 loc) · 1.45 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
/**
* Configuration variables. These can be overridden in the per-system config file
*/
var log = require('winston');
var settings = {
// IP the web server will bind to
listen_address: '127.0.0.1',
// Port that the web server will bind to
web_port: 37760,
// Database settings
db_user: 'root',
db_pass: '',
db_database: 'echoprint',
db_host: 'localhost',
// Set this to a system username to drop root privileges
run_as_user: '',
// Filename to log to
log_path: __dirname + '/logs/echoprint.log',
// Log level. Valid values are debug, info, warn, error
log_level: 'debug',
// Minimum number of codes that must be matched to consider a fingerprint
// match valid
code_threshold: 10,
// Supported version of echoprint-codegen codes
codever: '4.12',
// Disable or enable the use load from infile code. This would be faster, but we can't do it on RDS
useLoadDataInfile: false
};
// Override default settings with any local settings
try {
var localSettings = require('./config.local');
for (var property in localSettings) {
if (localSettings.hasOwnProperty(property))
settings[property] = localSettings[property];
}
log.info('Loaded settings from config.local.js. Database is ' +
settings.db_database + '@' + settings.db_host);
} catch (err) {
log.warn('Using default settings from config.js. Database is ' +
settings.db_database + '@' + settings.db_host);
}
module.exports = settings;