forked from scrollback/scrollback
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
128 lines (118 loc) · 2.91 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
Scrollback: Beautiful text chat for your community.
Copyright (c) 2014 Askabt Pte. Ltd.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or any
later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see http://www.gnu.org/licenses/agpl.txt
or write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
*/
var fs = require('fs');
var changes = {};
if (fs.existsSync('./myConfig.js')) {
changes = require("./myConfig.js");
}
/**
*It merge c into d
*@param {object} d default Object
*@param {object} c this object will be merged into d.
*/
function merge(d, c) {
for(var i in c) {
if (typeof d[i] === 'object' && typeof c[i] === 'object' && d[i] !== null && c[i] !== null) {
if (d[i] instanceof Array && c[i] instanceof Array) {
// d[i] = d[i].concat(c[i]);
/*Concatinating the plugins array from the default ones and the ones in
myConfig is probably not something that we might be interested in.*/
d[i] = c[i];
} else {
merge(d[i], c[i]);
}
} else {
d[i] = c[i];
}
}
}
var defaults = {
core: {
name: "scrollback",
newrelic: { name: 'Scrollback Local' }
},
mysql: {
host : 'localhost',
user : 'scrollback',
password : 'scrollback',
connectionLimit: 100,
//debug :true ,
database : 'scrollback'
},
pg: {//post gre config
server: "localhost",//server:port
db: "logs",
username: "username",
password: "password"
//port:
},
http: {
host: "local.scrollback.io",
cookieDomain: ".scrollback.io",
port: 80,
home: "public", // the directory containing static files
time: 60000,
limit: 30
},
email: {
from: "[email protected]"
},
auth: {
audience: "local.scrollback.io"
},
redis:{
host: "local.scrollback.io",
port: 6379,
db:0
},
threader: {
host : "local.scrollback.io",
port : 12345
},
twitter: {
//consumerKey: ".."
//consumerSecret: ".."
timeout: 1000 * 60,
silentTimeout: 1000 * 60 * 10
},
irc: {
port: 8910,
server: "localhost"
},
leveldb: {
path: "/data"
},
redisDB:{
twitter: 6,
email: 7,
session: 8,
user: 9,
room: 9,
occupants: 10,
threader: 11,
search: 14
},
su: {
},
plugins: ["anti-flood", "validator", "authorizer", "browserid-auth", "anti-abuse",
"threader", "http", "irc" , "email", "redis-storage", "leveldb-storage", "mysql-storage",
"admin-notifier", "custom-emitter","entityloader", "twitter"],
facebook: {
}
};
merge(defaults, changes);
module.exports = defaults;