-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkuzzlerc
565 lines (550 loc) · 19.6 KB
/
kuzzlerc
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
{
// -------------------------------------------------------------------------
// Kuzzle configuration sample file
//
// You can copy this file to a valid [rc](https://github.com/dominictarr/rc)
// file location to customize Kuzzle configuration
// -------------------------------------------------------------------------
// The HTTP section lets you configure how Kuzzle should handle HTTP requests
"http": {
// * accessControlAllowOrigin:
// sets the default Access-Control-Allow-Origin HTTP
// header used to send responses to the client
// (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)
"accessControlAllowOrigin": "*"
},
// Kuzzle configured limits
"limits": {
// * concurrentRequests:
// Number of requests Kuzzle processes simultaneously.
// Requests received above this limit are buffered until a slot is freed
// This value should be kept low to avoid overloading Kuzzle's event loop.
// * documentsFetchCount:
// Maximum number of documents that can be fetched by a single API
// request. The minimum value to this limit is 1.
// This limits is applied to any route returning multiple documents,
// such as document:mGet or document:search
// You may have to configure ElasticSearch as well if you need
// to set this value higher than 10000
// * documentsWriteCount:
// Maximum number of documents that can be written by a single API
// request. The minimum value to this limit is 1.
// There is no higher limit to this value, but you may
// also have to change the value of the "maxRequestSize" parameter
// (in the "server" section) to make Kuzzle accept larger requests.
// * requestsBufferSize:
// Maximum number of requests that can be buffered.
// Requests received above this limit are discarded with a 503 error
// * requestsBufferWarningThreshold:
// Number of buffered requests after
// which Kuzzle will throw 'core:overload' events
// (see http://docs.kuzzle.io/plugin-reference/#core)
// * subscriptionConditionsCount
// Maximum number of conditions a subscription filter can contain
// NB: A condition is either a "simple" operator (anything but and, or and bool)
// or a boolean condition that contains only simple operators.
// * subscriptionMinterms
// Maximum number of minterms (AND) clauses after the filters are
// transformed in their Canonical Disjunctive Normal Form (CDNF).
// Set to 0 for no limit.
// * subscriptionRooms
// Maximum number of different subscription rooms
// (i.e. different index+collection+filters subscription configurations)
// Depends primarily on available memory.
// If set to 0, an unlimited number of rooms can be created
// * subscriptionDocumentTTL
// Maximum time (in seconds) a document will be kept in cache for real-time subscriptions.
// This cache is used to notify subscriber when a document enters or leaves a scope after an update.
// By default, subscriptions will be kept 72 hours.
// /!\ Please note that keeping subscriptions over a long period of time may result in memory overuse. /!\
// If set to 0, the subscription will be kept in cache forever.
// /!\ Setting the property to 0 will lead to a memory leak if documents enter a real-time subscription scope and never exit that scope. /!\
"concurrentRequests": 50,
"documentsFetchCount": 10000,
"documentsWriteCount": 200,
"requestsBufferSize": 50000,
"requestsBufferWarningThreshold": 5000,
"subscriptionConditionsCount": 16,
"subscriptionMinterms": 0,
"subscriptionRooms": 1000000,
"subscriptionDocumentTTL": 259200 // 72 * 60 * 60
},
// The plugins section lets you define plugins behaviors
// (see http://kuzzle.io/guide/#plugins)
"plugins": {
// [Common]
// * bootstrapLockTimeout
// Maximum amount of time (in milliseconds)
// to wait for a concurrent plugin bootstrap
// * pipeWarnTime:
// Warning time threshold (in milliseconds)
// on a pipe plugin action
// * pipeTimeout:
// Maximum execution time (in milliseconds)
// of a pipe plugin action
// * initTimeout:
// Maximum execution time (in milliseconds)
// of a plugin initialization
"common": {
"bootstrapLockTimeout": 5000,
"pipeWarnTime": 40,
"pipeTimeout": 250,
"initTimeout": 2000
},
"geofencing-advertising": {
"store": "redis",
"polygons": 300000,
"bounding_box": [
-127.96875,
26.745610382199022,
-66.4453125,
51.6180165487737
]
}
},
// The repositories are used internally by Kuzzle to store its data (users,
// permissions, configuration etc.)
"repositories": {
// [Common]
// * cacheTTL:
// Time to live (in seconds) of cached objects.
// Decreasing this value will lower Redis memory and
// disk consumption, at the cost of increasing
// queries rate to the database and response times
"common": {
"cacheTTL": 1440
}
},
// The security section contains the configuration for Kuzzle permissions
// mechanism
"security": {
// [restrictedProfileIds]
// The profileIds applied to a user created with the API route
// users/_createRestricted
"restrictedProfileIds": ["default"],
// [jwt]
// configuration for npm
// [jsonwebtoken package](https://github.com/auth0/node-jsonwebtoken)
//
// * algorithm:
// hash/encryption method used to sign the token
// * expiresIn:
// Token default expiration time
// (interpreted by https://www.npmjs.com/package/ms)
// * secret:
// String or buffer data containing either the secret for HMAC
// algorithms, or the PEM encoded private key for RSA and ECDSA.
// If left to null (default), Kuzzle will autogenerate a random
// seed (can only be used with HMAC algorithms).
"jwt": {
"algorithm": "HS256",
"expiresIn": "1h",
"secret": null
},
// [default]
// The default role defines permissions for all users,
// until an administrator configures the backend rights
// By default, all users are granted all permissions
"default": {
"role": {
"controllers": {
"*": {
"actions": {
"*": true
}
}
}
}
},
// [standard]
// Permissions used when creating an administrator user, either using the
// CLI or the Back Office.
//
// By default, the admin user is granted all permissions.
// Anonymous and non-administrator users have their rights restricted
"standard": {
"profiles": {
"admin": {
"policies": [ {"roleId": "admin"} ]
},
"default": {
"policies": [ {"roleId": "default"} ]
},
"anonymous": {
"policies": [ {"roleId": "anonymous"} ]
}
},
"roles": {
"admin": {
"controllers": {
"*": {
"actions": {
"*": true
}
}
}
},
"default": {
"controllers": {
"auth": {
"actions": {
"checkToken": true,
"getCurrentUser": true,
"getMyRights": true,
"logout": true,
"updateSelf": true
}
},
"server": {
"actions": {
"info": true
}
}
}
},
"anonymous": {
"controllers": {
"auth": {
"actions": {
"checkToken": true,
"getCurrentUser": true,
"getMyRights": true,
"login": true
}
},
"server": {
"actions": {
"info": true
}
}
}
}
}
}
},
// Kuzzle server is the entry point for incoming requests
"server": {
// [entryPoints]
// list of available entry points for Kuzzle.
// Posible values:
// - embedded: Kuzzle can run on its own and does not require any
// external component to process requests
// - proxy: Kuzzle will connect to a Kuzzle proxy and process requests
// coming from it
// Entry points can be combined.
"entryPoints": {
"embedded": true,
"proxy": false
},
// [proxy]
// A Kuzzle proxy can be used to forward requests to Kuzzle.
// * host:
// Host name/address of a Kuzzle proxy server.
// Can be a hostname, an IP address or an URI.
// * pingInterval:
// Time (in milliseconds) between ping requests
// * pingTimeout:
// Timeout (in milliseconds) of a ping request. If reached, Kuzzle
// marks its connection to the distant host as lost.
// * port:
// Network port opened by the Kuzzle proxy server
// * retryClientListDelay
// Time after which (in milliseconds) Kuzzle should ask the proxy to
// send the list of clients back after a disconnection (default 1s).
// * retryInterval:
// Time interval (in milliseconds) between reconnection retries
// when the connection to the broker server has been lost
"proxy": {
"host": "localhost",
"port": 7331,
"pingInterval": 60000,
"pingTimeout": 500,
"resendClientListDelay": 1000,
"retryInterval": 1000
},
// [logs] (embedded only)
// Configuration section for Kuzzle access logs
// * transports:
// An array of Winston transports configurations to output access
// logs. Possible transport types are: console, file, elasticsearch
// and syslog.
// Please refer to https://github.com/winstonjs/winston/blob/master/docs/transports.md
// for more information on transports configuration.
// * accessLogFormat:
// Access log format.
// Currently supported are "combined" (=Apache combined logs format) and
// "logstash".
// "logstash" will output the whole request input to JSON, ready to
// be consumed by logstash agent.
// * accessLogIpOffset:
// The offset to use as the client ip, from the FORWARDED-FOR chain,
// beginning from the right (0 = the ip address of the last
// client|proxy which connected to Kuzzle
"logs": {
"transports": [
{
"transport": "console",
"level": "info",
"stderrLevels": [],
"format": "simple",
"silent": true
}
],
"accessLogFormat": "combined",
"accessLogIpOffset": 0
},
// (embedded only)
// * maxRequestSize:
// The maximum size of an incoming request. Units can be expressed in
// bytes ("b" or none), kilobytes ("kb"), megabytes ("mb"), gigabytes
// ("gb") or terabytes ("tb")
// * port:
// The port on which Kuzzle should bind to
//
"maxRequestSize": "1mb",
"port": 7512,
// [protocols] (embedded only)
// protocols accepted by Kuzzle.
// protocols can be extended using plugins and configured in this section.
"protocols": {
"http": {
// * enabled:
// Set to "false" to disable HTTP support
// * maxFormFileSize:
// Maximum size of requests sent via http forms
// * maxEncodingLayers:
// Maximum number of encoding layers that can be applied
// to an http message, using the Content-Encoding header.
// This parameter is meant to prevent abuses by setting an
// abnormally large number of encodings, forcing Kuzzle to
// allocate as many decoders to handle the incoming request.
// * allowCompression:
// Enable support for compressed requests, using the
// Content-Encoding header
// Currently supported compression algorithms: gzip, deflate, identity
// Note: "identity" is always an accepted value, even if
// compression support is disabled
"enabled": true,
"maxFormFileSize": "1mb",
"maxEncodingLayers": 3,
"allowCompression": true
},
"socketio": {
"enabled": true,
// value of Access-Control-Allow-Origin header to answer the upgrade request
"origins": "*:*"
},
"websocket": {
"enabled": true
}
}
},
// Services are the external components Kuzzle relies on.
"services": {
// [common]
// * defaultInitTimeout:
// Time in ms after which a service is considered
// failing if it has not init.
// * retryInterval:
// Default interval in ms between Kuzzle tries to init
// the service again on first failure.
"common": {
"defaultInitTimeout": 10000,
"retryInterval": 1000
},
// [internalCache]
// The cache service relies on Redis
// sample settings for Redis service (see also https://github.com/luin/ioredis):
//
// 1. using a single Redis database:
// node:
// * host:
// The host on which Redis can be reached.
// Can take an IP address, an URI or a hostname
// * port:
// The port on which Redis is running its database:
// * (optional) database:
// ID of the redis database (default: 0)
"internalCache": {
"backend": "redis",
"node": {
"host": "localhost",
"port": 6379
}
},
// [internalEngine]
// The database layer used internally by Kuzzle
// * bootstrapLockTimeout:
// Maximum amount of time (in milliseconds)
// to wait for a concurrent database bootstrap
"internalEngine": {
"bootstrapLockTimeout": 5000
},
// 2. using a master/slaves Redis instance with Redis sentinels
// (cf. http://redis.io/topics/sentinel):
// * node:
// * sentinels:
// array of sentinels instances:
// * host:
// Host name/address of the sentinel server
// Can be an IP address, an URI or a hostname
// * port:
// Network port opened by Redis on the sentinel server
// * name:
// Group of Redis instances composed of a master and one
// or more slaves
// * (optional) database:
// ID of the redis database (default: 0)
//"internalCache": {
// "backend": "redis",
// "node": {
// "sentinels": [
// {"host": "sentinel-host-1", "port": 26379},
// {"host": "sentinel-host-2", "port": 26379},
// {"host": "sentinel-host-3", "port": 26379}
// ],
// "name": "kuzzle"
// }
//},
// 3. using a redis cluster (cf. http://redis.io/topics/cluster-spec):
// * nodes: array of master nodes of the cluster
// * host:
// Host name/address of a redis cluster node
// Can be an IP address, an URI or a hostname
// * port:
// Network port opened by the redis cluster node
//"internalCache": {
// "backend": "redis",
// "nodes": [
// {"host": "redis-1", "port": 6379},
// {"host": "redis-2", "port": 6379},
// {"host": "redis-3", "port": 6379}
// ]
//},
// [memoryStorage]
// The Redis memoryStorage Engine
// (see "internalCache" above for sample settings)
// By default, the memoryStorage engine uses the same Redis server
// as internalCache, on database ID "5"
"memoryStorage": {
"backend": "redis",
"database": 5,
"node": {
"host": "localhost",
"port": 6379
}
},
// [garbageCollector]
// The document garbage collector service: permanently delete
// documents in the trashcan area
//
// * cleanInterval:
// Delay between each garbage collection, in milliseconds
// * maxDelete:
// Maximum number of documents to delete **per data collection**
"garbageCollector": {
"cleanInterval": 86400000,
"maxDelete": 1000
},
// [db]
// The default database layer is Elasticsearch and it is
// currently the only database layer we support.
// * client:
// Elasticsearch constructor options. Use this field to specify your Elasticsearch config options, this object
// is passed through to the Elasticsearch constructor and can contain all options/keys outlined here:
// https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html
"db": {
"backend": "elasticsearch",
"aliases": ["storageEngine"],
"client": {
"host": "http://localhost:9200",
"apiVersion": "5.4"
},
// default mapping applied to all collections
"commonMapping": {
"_kuzzle_info": {
"properties": {
"active": {"type": "boolean"},
"author": {"type": "keyword"},
"createdAt": {"type": "date"},
"updatedAt": {"type": "date"},
"updater": {"type": "keyword"},
"deletedAt": {"type": "date"}
}
}
},
"defaults": {
// Number of retries to attempt on an update conflict
// before throwing an error
"onUpdateConflictRetries": 0,
// Time to live of a paginated search
"scrollTTL": "15s"
}
}
},
// Configuration of the Kuzzle's internal statistics module
// * ttl:
// Time to live (in seconds) of a statistics frame
// * statsInterval:
// Time (in seconds) between statistics snapshots
"stats": {
"ttl": 3600,
"statsInterval": 10
},
// [validation]
// Defines the specifications used to validate data.
// Please refer to the guide for more information.
// (http://docs.kuzzle.io/guide/#data-validation)
"validation": {
},
// [dump]
// Kuzzle provides diagnostic tools, enabling analysis, support
// and debugging on unexpected events (errors, crashes)
// DO NOT disable this feature if you bought enterprise support
// * enabled:
// Enable/disable information dump on crash or on errors
// (see below)
// * history:
// * coredump:
// Maximum number of core dumps to keep.
// Core dumps weight usually between 1 and 2GB,
// so make sure you have enough space to store
// the provided number of coredumps.
// * reports:
// Maximum number of reports directories
// * path:
// Directory path where the dumps are stored
// * gcore:
// Location of the "gcore" binary
// * dateFormat:
// Format used to generate dump names
// (see http://momentjs.com for formats)
// * handledErrors:
// Creates a dump whenever an error belonging to the
// provided list is generated
// * enabled:
// Enable/disable dumps on generated errors.
// If disabled, dumps will only occur on crashes.
// * whitelist:
// List of error types triggering a dump
"dump": {
"enabled": true,
"history": {
"coredump": 3,
"reports": 10
},
"path": "./dump/",
"gcore": "/usr/bin/gcore",
"dateFormat": "YYYYMMDD-HHmm",
"handledErrors": {
"enabled": true,
"whitelist": [
"Error",
"RangeError",
"TypeError",
"KuzzleError",
"InternalError"
]
}
}
}