-
Notifications
You must be signed in to change notification settings - Fork 29
/
config.js
230 lines (207 loc) · 4.85 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/*
* Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U
*
* This file is part of perseo-fe
*
* perseo-fe 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 (at your option) any later version.
*
* perseo-fe 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 perseo-fe.
* If not, see http://www.gnu.org/licenses/.
*
* For those usages not covered by the GNU Affero General Public License
* please contact with::[contacto@tid.es]
*/
'use strict';
var config = {};
/**
* Default log level. Can be one of: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'
* @type {string}
*/
config.logLevel = 'INFO';
/**
* Configures the exposed API.
*/
config.endpoint = {
host: 'localhost',
port: 9090,
rulesPath: '/rules',
actionsPath: '/actions/do',
noticesPath: '/notices',
vrPath: '/m2m/vrules',
checkPath: '/check',
versionPath: '/version',
logPath: '/admin/log',
metricsPath: '/admin/metrics'
};
/**
* Is Master this one?
*/
config.isMaster = true;
/**
* Delay (in milliseconds) for slave to execute an action
*/
config.slaveDelay = 500;
/**
* DB Configuration.
*/
config.mongo = {
// The URI to use for the database connection. It supports replica set URIs.
// mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]
// I.e.: 'mongodb://user:pass@host1:27017,host2:27018,host3:27019/cep?replicaSet=myrep'
url: 'mongodb://localhost:27017/cep'
};
/**
* OrionDB Configuration.
*/
config.orionDb = {
url: 'mongodb://localhost:27017/orion',
collection: 'entities',
prefix: 'orion',
batchSize: 500
};
/**
* EPL core options
*
* interval is the time in milliseconds between refreshing rules
* at core. Each <<interval>> ms, the rules are sent to core.
*/
config.perseoCore = {
rulesURL: 'http://localhost:8080/perseo-core/rules',
noticesURL: 'http://localhost:8080/perseo-core/events',
interval: 60e3 * 5
};
/**
* NEXT EPL core options (with HA)
*/
config.nextCore = {
//
// Note this parameter is empty, so Perseo will not use HA by default
//
/*
rulesURL : 'http://next-core:8080/perseo-core/rules',
noticesURL : 'http://next-core:8080/perseo-core/events'
*/
};
/**
* SMTP endpoint options
*/
config.smtp = {
port: 25,
host: 'smtpserver',
secure: false,
/*
auth: {
user: 'abc',
pass: 'xyz'
}
,
*/
tls: {
// keep rejectUnauthorized to false when secure is also false
rejectUnauthorized: false
}
};
/**
* SMS endpoint options
*/
config.sms = {
URL: 'http://sms-endpoint/smsoutbound',
API_KEY: '',
API_SECRET: '',
from: 'tel:22012;phone-context=+34'
};
/**
* SMPP endpoint options
*/
config.smpp = {
host: '',
port: '',
systemid: '',
password: '',
from: '346666666',
enabled: false
};
/**
* Orion (Context Broker) endpoint options
*/
config.orion = {
URL: 'http://orion-endpoint:1026'
};
/**
* Pep (proxy for Context Broker) endpoint options
*/
config.pep = {
URL: 'http://pep-endpoint:1026'
};
/**
* Collections
* @type {String}
*/
config.collections = {
rules: 'rules',
executions: 'executions'
};
/**
* Executions TTL
*
* Number of seconds to expire a document in 'executions'
* @type {Number}
*
*/
config.executionsTTL = 1 * 24 * 60 * 60;
/**
* Constants for missing header fields for service (Fiware-servicepath) DEFAULT_SUBSERVICE
* and tenant (Fiware-service) DEFAULT_TENANT
*
* @type {String}
*/
config.DEFAULT_SUBSERVICE = '/';
config.DEFAULT_SERVICE = 'unknownt';
/**
* CheckDB configuration
*
* delay Number of milliseconds to check DB connection
* @type {Number}
*
* reportInterval Number of milliseconds to report a problem with DB connection in logs
* @type {Number}
*/
config.checkDB = {
delay: 5e3,
reconnectTries: 1e3,
reconnectInterval: 5e3,
bufferMaxEntries: 5
};
/**
* Rest base for changing access to twitter
*
* It should not be changed in normal conditions
*
* restBase: URL
* @type {String}
*
*/
config.restBase = null;
/**
* Cast attribute values in updateAction using NGSIv2 types
*/
config.castTypes = false;
/**
* Maximum number of rule executions triggered by the same notification (with the same correlator) until refuse execute a rule
*/
config.maxRulesByCorr = 20;
/**
* Check nonSignal rules using API ngsiv2 or just access to mongo
* @type {Boolean}
*/
config.nonSignalByAPI = false;
module.exports = config;