kuzzle 2.15.2 → 2.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/lib/api/controllers/serverController.js +24 -4
  2. package/lib/api/funnel.js +19 -0
  3. package/lib/{config → api}/httpRoutes.js +29 -14
  4. package/lib/api/openApiGenerator.d.ts +6 -0
  5. package/lib/api/openApiGenerator.js +167 -126
  6. package/lib/api/openapi/document/count.yaml +47 -0
  7. package/lib/api/openapi/document/create.yaml +46 -0
  8. package/lib/api/openapi/document/createOrReplace.yaml +61 -0
  9. package/lib/api/openapi/document/delete.yaml +67 -0
  10. package/lib/api/openapi/document/deleteByQuery.yaml +90 -0
  11. package/lib/api/openapi/document/exists.yaml +35 -0
  12. package/lib/api/openapi/document/get.yaml +68 -0
  13. package/lib/api/openapi/document/index.d.ts +20 -0
  14. package/lib/api/openapi/document/index.js +55 -0
  15. package/lib/api/openapi/document/replace.yaml +66 -0
  16. package/lib/api/openapi/document/scroll.yaml +49 -0
  17. package/lib/api/openapi/document/update.yaml +78 -0
  18. package/lib/api/openapi/index.d.ts +2 -0
  19. package/lib/api/openapi/index.js +18 -0
  20. package/lib/api/openapi/payloads.yaml +32 -0
  21. package/lib/api/request/kuzzleRequest.d.ts +32 -0
  22. package/lib/api/request/kuzzleRequest.js +34 -0
  23. package/lib/api/request/requestInput.d.ts +2 -0
  24. package/lib/api/request/requestInput.js +2 -0
  25. package/lib/config/default.config.js +1 -1
  26. package/lib/core/network/router.js +33 -0
  27. package/lib/core/realtime/hotelClerk.d.ts +7 -0
  28. package/lib/core/realtime/hotelClerk.js +14 -0
  29. package/lib/util/readYamlFile.d.ts +2 -0
  30. package/lib/util/readYamlFile.js +10 -0
  31. package/package-lock.json +160 -175
  32. package/package.json +11 -25
  33. package/.kuzzlerc.sample +0 -988
  34. package/CONTRIBUTING.md +0 -116
  35. package/bin/.lib/colorOutput.js +0 -71
  36. package/bin/.upgrades/connectors/es.js +0 -90
  37. package/bin/.upgrades/connectors/redis.js +0 -112
  38. package/bin/.upgrades/lib/connectorContext.js +0 -38
  39. package/bin/.upgrades/lib/context.js +0 -142
  40. package/bin/.upgrades/lib/formatters.js +0 -103
  41. package/bin/.upgrades/lib/inquirerExtended.js +0 -46
  42. package/bin/.upgrades/lib/logger.js +0 -99
  43. package/bin/.upgrades/lib/progressBar.js +0 -70
  44. package/bin/.upgrades/versions/v1/checkConfiguration.js +0 -85
  45. package/bin/.upgrades/versions/v1/index.js +0 -35
  46. package/bin/.upgrades/versions/v1/upgradeCache.js +0 -149
  47. package/bin/.upgrades/versions/v1/upgradeStorage.js +0 -450
  48. package/protocols/available/.gitignore +0 -4
  49. package/protocols/enabled/.gitignore +0 -4
package/.kuzzlerc.sample DELETED
@@ -1,988 +0,0 @@
1
- {
2
-
3
- // -------------------------------------------------------------------------
4
- // Kuzzle configuration sample file
5
- //
6
- // You can copy this file to a valid rc file location to customize Kuzzle
7
- // configuration (see https://github.com/dominictarr/rc)
8
- // -------------------------------------------------------------------------
9
-
10
- // The HTTP section lets you configure how Kuzzle should handle HTTP requests
11
- "http": {
12
- // * accessControlAllowOrigin:
13
- // sets the default Access-Control-Allow-Origin HTTP
14
- // header used to send responses to the client
15
- // * accessControlAllowOriginUseRegExp
16
- // Allow the usage of Regular Expressions to verify the origin
17
- // based on Access-Control-Allow-Origin.
18
- // /!\ This convert every string in Access-Control-Allow-Origin into Regular Expressions
19
- // be careful with the Regular Expressions that you use.
20
- // * accessControlAllowMethods:
21
- // sets the default Access-Control-Allow-Method header
22
- // * accessControlAllowHeaders:
23
- // sets the default Access-Control-Allow-Headers
24
- // (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)
25
- // * cookieAuthentication:
26
- // Allows browser clients to connect to Kuzzle with cookies.
27
- // /!\ This should not be allowed if the "http.accessControlAllowOrigin"
28
- // configuration contains a wildcard ("*").
29
- "accessControlAllowOrigin": "*",
30
- "accessControlAllowOriginUseRegExp": false,
31
- "accessControlAllowMethods": "GET,POST,PUT,PATCH,DELETE,OPTIONS,HEAD",
32
- "accessControlAllowHeaders": "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With, Content-Encoding, Content-Length, X-Kuzzle-Volatile",
33
- "cookieAuthentication": true
34
- },
35
-
36
- // Kuzzle configured limits
37
- "limits": {
38
- // * concurrentRequests:
39
- // Number of requests Kuzzle processes simultaneously.
40
- // Requests received above this limit are buffered until a slot is freed
41
- // This value should be kept low to avoid overloading Kuzzle's event loop.
42
- // * documentsFetchCount:
43
- // Maximum number of documents that can be fetched by a single API
44
- // request. The minimum value to this limit is 1.
45
- // This limits is applied to any route returning multiple documents,
46
- // such as document:mGet or document:search
47
- // You may have to configure ElasticSearch as well if you need
48
- // to set this value higher than 10000
49
- // * documentsWriteCount:
50
- // Maximum number of documents that can be written by a single API
51
- // request. The minimum value to this limit is 1.
52
- // There is no higher limit to this value, but you may
53
- // also have to change the value of the "maxRequestSize" parameter
54
- // (in the "server" section) to make Kuzzle accept larger requests.
55
- // * loginsPerSecond:
56
- // Maximum number of logins per second and per network connection.
57
- // * requestsBufferSize:
58
- // Maximum number of requests that can be buffered.
59
- // Requests received above this limit are discarded with a 503 error
60
- // * requestsBufferWarningThreshold:
61
- // Number of buffered requests after
62
- // which Kuzzle will throw 'core:overload' events
63
- // (see https://docs.kuzzle.io/plugins/1/events/core-overload/)
64
- // * subscriptionConditionsCount
65
- // Maximum number of conditions a subscription filter can contain
66
- // NB: A condition is either a "simple" operator (anything but "and",
67
- // "or" and "bool"), or a boolean condition that contains only
68
- // simple operators.
69
- // * subscriptionRooms
70
- // Maximum number of different subscription rooms
71
- // (i.e. different index+collection+filters subscription
72
- // configurations)
73
- // Depends primarily on available memory.
74
- // If set to 0, an unlimited number of rooms can be created
75
- // * subscriptionDocumentTTL
76
- // Maximum time (in milliseconds) a document will be kept in cache for
77
- // real-time subscriptions.
78
- // This cache is used to notify subscriber when a document enters or
79
- // leaves a scope after an update.
80
- // By default, subscriptions will be kept 72 hours.
81
- // /!\ Please note that keeping subscriptions over a long period of
82
- // /!\ time may result in memory overuse.
83
- // If set to 0, the subscription will be kept in cache forever.
84
- // /!\ Setting the property to 0 will lead to a memory leak if
85
- // /!\ documents enter a real-time subscription scope and never exit
86
- // /!\ that scope.
87
- "concurrentRequests": 50,
88
- "documentsFetchCount": 10000,
89
- "documentsWriteCount": 200,
90
- "loginsPerSecond": 1,
91
- "requestsBufferSize": 50000,
92
- "requestsBufferWarningThreshold": 5000,
93
- "subscriptionConditionsCount": 100,
94
- "subscriptionRooms": 1000000,
95
- "subscriptionDocumentTTL": 259200000 // 72 * 60 * 60 * 1000
96
- },
97
-
98
- // The application section lets you configure your application
99
- // (see https://docs.kuzzle.io/core/2/guides/advanced/configuration)
100
- "application": {
101
- // any key/value..
102
- },
103
-
104
- // The plugins section lets you define plugins behaviors
105
- // (see https://docs.kuzzle.io/core/2/guides/write-plugins)
106
- "plugins": {
107
- // [Common]
108
- // * failsafeMode
109
- // If true, Kuzzle will not load custom plugin and features (including
110
- // the ones defined in the application).
111
- // The API will only be available to administrators ("admin" profile)
112
- // during failsafe mode.
113
- // * bootstrapLockTimeout
114
- // Maximum amount of time (in milliseconds)
115
- // to wait for a concurrent plugin bootstrap
116
- // * include
117
- // List of Kuzzle's embedded plugins to be activated.
118
- // Edit this list to deactivate one or more of those plugins.
119
- // NOTE: this list does not control plugins installed manually.
120
- // * pipeWarnTime:
121
- // Warning time threshold (in milliseconds)
122
- // on a pipe plugin action
123
- // * initTimeout:
124
- // Maximum execution time (in milliseconds)
125
- // of a plugin initialization
126
- // * maxConcurrentPipes:
127
- // Maximum number of pipes that can be executed in parallel.
128
- // New pipes submitted while the maximum number of pipes is met are
129
- // delayed for later execution.
130
- // This parameter controls is used to limit the stress put on the
131
- // event loop, allowing for Kuzzle to process pipes faster, and to
132
- // protect it from performances degradation if an abnormal number of
133
- // pipes are submitted.
134
- // (timers do not start while a pipe is hold back)
135
- // * pipesBufferSize:
136
- // Maximum number of pipes that can be delayed. If full, new pipes
137
- // are rejected.
138
- "common": {
139
- "failsafeMode": false,
140
- "bootstrapLockTimeout": 30000,
141
- "pipeWarnTime": 40,
142
- "initTimeout": 2000,
143
- "maxConcurrentPipes": 50,
144
- "pipesBufferSize": 50000,
145
- "include": [
146
- "kuzzle-plugin-logger",
147
- "kuzzle-plugin-auth-passport-local"
148
- ]
149
- },
150
-
151
- // plugin logger configuration.
152
- // see https://github.com/kuzzleio/kuzzle-plugin-logger
153
- "kuzzle-plugin-logger": {
154
- "services": {
155
- "stdout": {
156
- "level": "info"
157
- }
158
- }
159
- },
160
-
161
- // [Kuzzle Plugin Auth Passport Local]
162
- // * algorithm
163
- // one of the supported encryption algorithms
164
- // (run crypto.getHashes() to get the complete list).
165
- // Examples: sha256, sha512, blake2b512, whirlpool, ...
166
- // * stretching
167
- // boolean and controlling if the password is stretched or not.
168
- // * digest
169
- // describes how the hashed password is stored in the database
170
- // https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end
171
- // * encryption
172
- // determines whether the hashing algorithm uses crypto.createHash (hash)
173
- // or crypto.createHmac (hmac).
174
- // https://nodejs.org/api/crypto.html
175
- // * requirePassword
176
- // if true, kuzzle will refuse any credentials update or deletion,
177
- // unless the currently valid password is provided
178
- // or if the change is performed via the security controller
179
- // * resetPasswordExpiresIn
180
- // a positive time representation of the delay after which a
181
- // reset password token expires (see the "ms" NPM package for possible
182
- // formats: https://www.npmjs.com/package/ms).
183
- // Users with expired passwords are given a resetPasswordToken when
184
- // logging in and must change their password to be allowed to log in again
185
- // * passwordPolicies
186
- // set of additional rules to apply to users, or to groups of users
187
- // See the documentation at https://docs.kuzzle.io/core/2/guides/main-concepts/5-authentication#password-policies
188
- "kuzzle-plugin-auth-passport-local": {
189
- "algorithm": "sha512",
190
- "stretching": true,
191
- "digest": "hex",
192
- "encryption": "hmac",
193
- "requirePassword": false,
194
- "resetPasswordExpiresIn": -1,
195
- "passwordPolicies": []
196
- }
197
-
198
- // Custom plugin configurations must be described here.
199
- // Example:
200
- //
201
- // "plugin-name": {
202
- // "<configuration property name>": "<value>"
203
- // }
204
- },
205
-
206
- // The repositories are used internally by Kuzzle to store its data (users,
207
- // permissions, configuration etc.)
208
- "repositories": {
209
- // [Common]
210
- // * cacheTTL:
211
- // Time to live (in milliseconds) of cached objects.
212
- // Decreasing this value will lower Redis memory and
213
- // disk consumption, at the cost of increasing
214
- // queries rate to the database and response times
215
- "common": {
216
- "cacheTTL": 1440000
217
- }
218
- },
219
-
220
- // The security section contains the configuration for Kuzzle permissions
221
- // mechanism
222
- "security": {
223
- // [restrictedProfileIds]
224
- // The profileIds applied to a user created with the API action
225
- // "security:createRestrictedUser"
226
- "restrictedProfileIds": ["default"],
227
- // [jwt]
228
- // configuration for the npm package jsonwebtoken
229
- // (see https://github.com/auth0/node-jsonwebtoken)
230
- //
231
- // * algorithm:
232
- // hash/encryption method used to sign the token
233
- // * expiresIn:
234
- // Token default expiration time
235
- // (interpreted by https://www.npmjs.com/package/ms)
236
- // * gracePeriod:
237
- // Duration in ms during which a renewed jwt is still
238
- // considered valid
239
- // * maxTTL:
240
- // Maximum duration in milliseconds a token can be requested
241
- // to be valid.
242
- // If set to -1 (default), no maximum duration is set.
243
- // * secret:
244
- // String or buffer data containing either the secret for HMAC
245
- // algorithms, or the PEM encoded private key for RSA and ECDSA.
246
- // If left to null (default), Kuzzle will autogenerate a random
247
- // seed (can only be used with HMAC algorithms).
248
- "jwt": {
249
- "algorithm": "HS256",
250
- "expiresIn": "1h",
251
- "gracePeriod": 1000,
252
- "maxTTL": -1,
253
- "secret": null
254
- },
255
- // [apiKey]
256
- // API Keys configuration
257
- //
258
- // * maxTTL:
259
- // Maximum time to live of an API Key, in milliseconds
260
- // If set to -1 (default), API Keys can be created with an infinite duration.
261
- "apiKey": {
262
- "maxTTL": -1
263
- },
264
- // [default]
265
- // The default role defines permissions for all users,
266
- // until an administrator configures the backend rights
267
- // By default, all users are granted all permissions
268
- "default": {
269
- "role": {
270
- "controllers": {
271
- "*": {
272
- "actions": {
273
- "*": true
274
- }
275
- }
276
- }
277
- }
278
- },
279
- // [standard]
280
- // Permissions used when creating an administrator user, either using the
281
- // CLI or the Back Office.
282
- //
283
- // By default, the admin user is granted all permissions.
284
- // Anonymous and non-administrator users have their rights restricted
285
- "standard": {
286
- "roles": {
287
- "admin": {
288
- "controllers": {
289
- "*": {
290
- "actions": {
291
- "*": true
292
- }
293
- }
294
- }
295
- },
296
- "default": {
297
- "controllers": {
298
- "auth": {
299
- "actions": {
300
- "checkToken": true,
301
- "getCurrentUser": true,
302
- "getMyRights": true,
303
- "logout": true,
304
- "updateSelf": true
305
- }
306
- },
307
- "server": {
308
- "actions": {
309
- "publicApi": true
310
- }
311
- }
312
- }
313
- },
314
- "anonymous": {
315
- "controllers": {
316
- "auth": {
317
- "actions": {
318
- "checkToken": true,
319
- "getCurrentUser": true,
320
- "getMyRights": true,
321
- "login": true
322
- }
323
- },
324
- "server": {
325
- "actions": {
326
- "publicApi": true,
327
- "openapi": true
328
- }
329
- }
330
- }
331
- }
332
- },
333
- "profiles": {
334
- "admin": {
335
- "rateLimit": 0,
336
- "policies": [ {"roleId": "admin"} ]
337
- },
338
- "default": {
339
- "rateLimit": 10,
340
- "policies": [ {"roleId": "default"} ]
341
- },
342
- "anonymous": {
343
- "rateLimit": 200,
344
- "policies": [ {"roleId": "anonymous"} ]
345
- }
346
- }
347
- }
348
- },
349
-
350
- // Kuzzle server is the entry point for incoming requests
351
- "server": {
352
- // General network configuration:
353
- // * maxRequestSize:
354
- // The maximum size of an incoming request. Units can be expressed in
355
- // bytes ("b" or none), kilobytes ("kb"), megabytes ("mb"), gigabytes
356
- // ("gb") or terabytes ("tb")
357
- // * port:
358
- // The listening port for HTTP and WebSocket
359
- // * strictSdkVersion:
360
- // Raise an error when an incompatible SDK is used.
361
- "maxRequestSize": "1mb",
362
- "port": 7512,
363
- "strictSdkVersion": true,
364
- // [logs]
365
- // Configuration section for Kuzzle access logs
366
- // * transports:
367
- // An array of Winston transports configurations to output access
368
- // logs. Possible transport types are: console, file, elasticsearch
369
- // and syslog.
370
- // Please refer to https://github.com/winstonjs/winston/blob/master/docs/transports.md
371
- // for more information on transports configuration.
372
- // * accessLogFormat:
373
- // Access log format.
374
- // Currently supported are "combined" (=Apache combined logs format)
375
- // and "logstash".
376
- // "logstash" will output the whole request input to JSON, ready to
377
- // be consumed by logstash agent.
378
- // * accessLogIpOffset:
379
- // The offset to use as the client ip, from the FORWARDED-FOR chain,
380
- // beginning from the right (0 = the ip address of the last
381
- // client|proxy which connected to Kuzzle
382
- "logs": {
383
- "transports": [
384
- {
385
- "transport": "console",
386
- "level": "info",
387
- "stderrLevels": [],
388
- "silent": true
389
- }
390
- ],
391
- "accessLogFormat": "combined",
392
- "accessLogIpOffset": 0
393
- },
394
- // [protocols]
395
- // protocols accepted by Kuzzle.
396
- // protocols can be extended and configured in this section.
397
- "protocols": {
398
- "http": {
399
- // * allowCompression:
400
- // Enable support for compressed requests, using the
401
- // Content-Encoding header
402
- // Currently supported compression algorithms:
403
- // gzip, deflate, identity
404
- // Note: "identity" is always an accepted value, even if
405
- // compression support is disabled
406
- // * enabled:
407
- // Set to "false" to disable HTTP support
408
- // * maxEncodingLayers:
409
- // Maximum number of encoding layers that can be applied
410
- // to an http message, using the Content-Encoding header.
411
- // This parameter is meant to prevent abuses by setting an
412
- // abnormally large number of encodings, forcing Kuzzle to
413
- // allocate as many decoders to handle the incoming request.
414
- // * maxFormFileSize:
415
- // Maximum size of requests sent via http forms
416
- "allowCompression": true,
417
- "enabled": true,
418
- "maxEncodingLayers": 3,
419
- "maxFormFileSize": "1mb"
420
- },
421
- "mqtt": {
422
- // * enabled:
423
- // Set to true to enable MQTT support
424
- // * allowPubSub
425
- // Allow MQTT pub/sub capabilities or restrict to Kuzzle requests only
426
- // * developmentMode
427
- // Switches responseTopic back to a regular public topic
428
- // * disconnectDelay
429
- // Delay in ms to apply between a disconnection notification is
430
- // received and the connection is actually removed
431
- // * requestTopic
432
- // Name of the topic listened by the plugin for requests
433
- // * responseTopic
434
- // Name of the topic clients should listen to get requests result
435
- // * server
436
- // Constructor options passed to underlying MQTT server.
437
- // See aedes documentation for further reference: https://github.com/moscajs/aedes
438
- // * realtimeNotifications:
439
- // Set to "true" to enable realtime notifications like "TokenExpired" notifications
440
- "enabled": false,
441
- "allowPubSub": false,
442
- "developmentMode": false,
443
- "disconnectDelay": 250,
444
- "requestTopic": "Kuzzle/request",
445
- "responseTopic": "Kuzzle/response",
446
- "server": {
447
- "port": 1883
448
- },
449
- "realtimeNotifications": true
450
- },
451
- "websocket": {
452
- // * compression:
453
- // Enable/Disable per message compression
454
- // * enabled:
455
- // Set to true to enable WebSocket support
456
- // * idleTimeout:
457
- // The maximum time (in milliseconds) without sending or receiving a
458
- // message from a client. Once reached, the client's socket is
459
- // forcibly closed.
460
- // If a client socket is inactive for too long, the server will send
461
- // a PING request before closing the socket.
462
- // Minimum value: 1000 (but it's strongly advised to not set a value
463
- // this low to forcibly close idle client sockets)
464
- // * rateLimit:
465
- // The maximum number of messages per second a single socket can
466
- // submit to the server.
467
- // Requests exceeding that rate limit are rejected.
468
- // Disabled if set to 0.
469
- // * realtimeNotifications:
470
- // Set to "true" to enable realtime notifications like "TokenExpired" notifications
471
- "compression": false,
472
- "enabled": true,
473
- "idleTimeout": 60000,
474
- "rateLimit": 0,
475
- "realtimeNotifications": true
476
- }
477
- }
478
- },
479
-
480
- // Services are the external components Kuzzle relies on.
481
- "services": {
482
- // [common]
483
- // * defaultInitTimeout:
484
- // Time in ms after which a service is considered
485
- // failing if it has not init.
486
- // * retryInterval:
487
- // Default interval in ms between Kuzzle tries to init
488
- // the service again on first failure.
489
- "common": {
490
- "defaultInitTimeout": 120000,
491
- "retryInterval": 1000
492
- },
493
-
494
- // [internalIndex]
495
- // The database engine used for Kuzzle internal index
496
- // * bootstrapLockTimeout:
497
- // Maximum amount of time (in milliseconds)
498
- // to wait for a concurrent database bootstrap
499
- "internalIndex": {
500
- "bootstrapLockTimeout": 60000
501
- },
502
-
503
- // [internalCache]
504
- // The cache service relies on Redis sample settings for Redis service
505
- // (see also https://github.com/luin/ioredis)
506
- //
507
- // 1. using a single Redis database:
508
- // * node:
509
- // * host:
510
- // The host on which Redis can be reached.
511
- // Can take an IP address, an URI or a hostname
512
- // * port:
513
- // The port on which Redis is running its database:
514
- // * (optional, deprecated) database:
515
- // ID of the redis database (default: 0)
516
- // NOTE: this option is deprecated and will be removed in Kuzzle v3.
517
- // Use 'options.db' instead. If both options are set, then
518
- // "options.db" will take precedence.
519
- // * (optional) options:
520
- // Redis specific options compatible with IORedis.
521
- // See Redis client constructor available options:
522
- // https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
523
- "internalCache": {
524
- "backend": "redis",
525
- "node": {
526
- "host": "localhost",
527
- "port": 6379
528
- },
529
- "options": {
530
- "db": 0
531
- }
532
- },
533
- // 2. using a master/slaves Redis instance with Redis sentinels
534
- // (cf. http://redis.io/topics/sentinel):
535
- // * node:
536
- // * sentinels:
537
- // array of sentinels instances:
538
- // * host:
539
- // Host name/address of the sentinel server
540
- // Can be an IP address, an URI or a hostname
541
- // * port:
542
- // Network port opened by Redis on the sentinel server
543
- // * name:
544
- // Group of Redis instances composed of a master and one
545
- // or more slaves
546
- // * (optional, deprecated) database:
547
- // ID of the redis database (default: 0)
548
- // NOTE: this option is deprecated and will be removed in Kuzzle v3.
549
- // Use 'options.db' instead. If both options are set, then
550
- // "options.db" will take precedence.
551
- // * (optional) options:
552
- // Redis specific options compatible with IORedis.
553
- // See Redis client constructor available options:
554
- // https://github.com/luin/ioredis/blob/master/API.md#redis--eventemitter
555
- //"internalCache": {
556
- // "backend": "redis",
557
- // "node": {
558
- // "sentinels": [
559
- // {"host": "sentinel-host-1", "port": 26379},
560
- // {"host": "sentinel-host-2", "port": 26379},
561
- // {"host": "sentinel-host-3", "port": 26379}
562
- // ],
563
- // "name": "kuzzle"
564
- // },
565
- // "options": {
566
- // "db": 0
567
- // }
568
- //},
569
- // 3. using a redis cluster (cf. http://redis.io/topics/cluster-spec):
570
- // * nodes: array of master nodes of the cluster
571
- // * host:
572
- // Host name/address of a redis cluster node
573
- // Can be an IP address, an URI or a hostname
574
- // * port:
575
- // Network port opened by the redis cluster node
576
- // * (optional, deprecated) database:
577
- // ID of the redis database (default: 0)
578
- // NOTE: this option is deprecated and will be removed in Kuzzle v3.
579
- // Use 'options.db' instead. If both options are set, then
580
- // "options.db" will take precedence.
581
- // * (optional) options:
582
- // Redis specific options compatible with IORedis.
583
- // See Redis client constructor available options:
584
- // https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
585
- // * (optional) clusterOptions:
586
- // Redis Cluster specific options compatible with IORedis.
587
- // See Redis Cluster client constructor available options:
588
- // https://github.com/luin/ioredis/blob/master/API.md#new-clusterstartupnodes-options
589
- // * (optional) overrideDnsLookup:
590
- // Only available when using a Redis Cluster config.
591
- // Use with caution: if set to true, it makes Kuzzle skip DNS validation for TLS certificates
592
- // This is the only way to connect to an AWS Elasticache Cluster with TLS encryption.
593
- // See: https://github.com/luin/ioredis#special-note-aws-elasticache-clusters-with-tls
594
- //"internalCache": {
595
- // "backend": "redis",
596
- // "nodes": [
597
- // {"host": "redis-1", "port": 6379},
598
- // {"host": "redis-2", "port": 6379},
599
- // {"host": "redis-3", "port": 6379}
600
- // ],
601
- // "options": {
602
- // "db": 0
603
- // },
604
- // "clusterOptions": {
605
- // "enableReadyCheck": true
606
- // }
607
- //},
608
-
609
- // [memoryStorage]
610
- // The Redis memoryStorage Engine
611
- // (see "internalCache" above for sample settings)
612
- // By default, the memoryStorage engine uses the same Redis server
613
- // as internalCache, on database ID "5"
614
- //
615
- // 1. using a single Redis database:
616
- // * node:
617
- // * host:
618
- // The host on which Redis can be reached.
619
- // Can take an IP address, an URI or a hostname
620
- // * port:
621
- // The port on which Redis is running its database:
622
- // * (optional, deprecated) database:
623
- // ID of the redis database (default: 5)
624
- // NOTE: this option is deprecated and will be removed in Kuzzle v3.
625
- // Use 'options.db' instead. If both options are set, then
626
- // "options.db" will take precedence.
627
- // * (optional) options:
628
- // Redis specific options compatible with IORedis.
629
- // See Redis client constructor available options:
630
- // https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
631
- "memoryStorage": {
632
- "backend": "redis",
633
- "node": {
634
- "host": "localhost",
635
- "port": 6379
636
- },
637
- "options": {
638
- "db": 5
639
- }
640
- },
641
- // 2. using a master/slaves Redis instance with Redis sentinels
642
- // (cf. http://redis.io/topics/sentinel):
643
- // * node:
644
- // * sentinels:
645
- // array of sentinels instances:
646
- // * host:
647
- // Host name/address of the sentinel server
648
- // Can be an IP address, an URI or a hostname
649
- // * port:
650
- // Network port opened by Redis on the sentinel server
651
- // * name:
652
- // Group of Redis instances composed of a master and one
653
- // or more slaves
654
- // * (optional, deprecated) database:
655
- // ID of the redis database (default: 5)
656
- // NOTE: this option is deprecated and will be removed in Kuzzle v3.
657
- // Use 'options.db' instead. If both options are set, then
658
- // "options.db" will take precedence.
659
- // * (optional) options:
660
- // Redis specific options compatible with IORedis.
661
- // See Redis client constructor available options:
662
- // https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
663
- //"memoryStorage": {
664
- // "backend": "redis",
665
- // "node": {
666
- // "sentinels": [
667
- // {"host": "sentinel-host-1", "port": 26379},
668
- // {"host": "sentinel-host-2", "port": 26379},
669
- // {"host": "sentinel-host-3", "port": 26379}
670
- // ],
671
- // "name": "kuzzle"
672
- // },
673
- // "options": {
674
- // "db": 5
675
- // }
676
- //},
677
- // 3. using a redis cluster (cf. http://redis.io/topics/cluster-spec):
678
- // * nodes: array of master nodes of the cluster
679
- // * host:
680
- // Host name/address of a redis cluster node
681
- // Can be an IP address, an URI or a hostname
682
- // * port:
683
- // Network port opened by the redis cluster node
684
- // * (optional, deprecated) database:
685
- // ID of the redis database (default: 5)
686
- // NOTE: this option is deprecated and will be removed in Kuzzle v3.
687
- // Use 'options.db' instead. If both options are set, then
688
- // "options.db" will take precedence.
689
- // * (optional) options:
690
- // Redis specific options compatible with IORedis.
691
- // See Redis client constructor available options:
692
- // https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
693
- // * (optional) clusterOptions:
694
- // Redis Cluster specific options compatible with IORedis.
695
- // See Redis Cluster client constructor available options:
696
- // https://github.com/luin/ioredis/blob/master/API.md#new-clusterstartupnodes-options
697
- // * (optional) overrideDnsLookup:
698
- // Only available when using a Redis Cluster config.
699
- // Use with caution: if set to true, it makes Kuzzle skip DNS validation for TLS certificates
700
- // This is the only way to connect to an AWS Elasticache Cluster with TLS encryption.
701
- // See: https://github.com/luin/ioredis#special-note-aws-elasticache-clusters-with-tls
702
- //"memoryStorage": {
703
- // "backend": "redis",
704
- // "nodes": [
705
- // {"host": "redis-1", "port": 6379},
706
- // {"host": "redis-2", "port": 6379},
707
- // {"host": "redis-3", "port": 6379}
708
- // ],
709
- // "options": {
710
- // "db": 5
711
- // },
712
- // "clusterOptions": {
713
- // "enableReadyCheck": true
714
- // }
715
- //},
716
-
717
- // [storageEngine]
718
- // The default storage layer is Elasticsearch and it is
719
- // currently the only storage layer we support.
720
- // * client:
721
- // Elasticsearch constructor options. Use this field to specify your
722
- // Elasticsearch config options, this object is passed through to the
723
- // Elasticsearch constructor and can contain all options/keys outlined
724
- // here:
725
- // https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html
726
- // * commonMapping.dynamic:
727
- // Default policy against new fields that are not referenced in the
728
- // collection mapping.
729
- // The value of this configuration will change Elasticsearch behavior
730
- // on fields that are not declared in the collection mapping.
731
- // - "true": Stores document and update the collection mapping with
732
- // inferred type
733
- // - "false": Stores document and does not update the collection
734
- // mapping (field are not indexed)
735
- // - "strict": Rejects document
736
- // See https://www.elastic.co/guide/en/elasticsearch/reference/7.4/dynamic-mapping.html
737
- "storageEngine": {
738
- "backend": "elasticsearch",
739
- "aliases": ["storageEngine"],
740
- "client": {
741
- "node": "http://localhost:9200"
742
- },
743
- // default mapping applied to all collections
744
- "commonMapping": {
745
- "dynamic": "false",
746
- "properties": {
747
- "_kuzzle_info": {
748
- "properties": {
749
- "author": { "type": "keyword" },
750
- "createdAt": { "type": "date" },
751
- "updatedAt": { "type": "date" },
752
- "updater": { "type": "keyword" }
753
- }
754
- }
755
- }
756
- },
757
- // Internal index default name and collections
758
- "internalIndex": {
759
- "name": "kuzzle",
760
- "collections": {
761
- "dynamic": "false",
762
- "users": {
763
- "properties": {
764
- "profileIds": { "type": "keyword" }
765
- }
766
- },
767
- "profiles": {
768
- "dynamic": "false",
769
- "properties": {
770
- "policies": {
771
- "properties": {
772
- "roleId": { "type": "keyword" }
773
- }
774
- }
775
- }
776
- },
777
- "roles": {
778
- "dynamic": "false",
779
- "properties": {
780
- "controllers": {
781
- "dynamic": "false",
782
- "properties": {}
783
- }
784
- }
785
- },
786
- "validations": {
787
- "properties": {
788
- "index": { "type": "keyword" },
789
- "collection": { "type": "keyword" },
790
- "validations": {
791
- "dynamic": "false",
792
- "properties": {}
793
- }
794
- }
795
- },
796
- "config": {
797
- "dynamic": "false",
798
- "properties": {}
799
- },
800
- "api-keys": {
801
- "dynamic": "false",
802
- "properties": {
803
- "userId": { "type": "keyword" },
804
- "hash": { "type": "keyword" },
805
- "expiresAt": { "type": "long" },
806
- "ttl": { "type": "keyword" },
807
- "description": { "type": "text" },
808
- "token": { "type": "keyword" }
809
- }
810
- }
811
- }
812
- },
813
- // Maximum duration for a scroll session
814
- "maxScrollDuration": "1m",
815
- "defaults": {
816
- // Number of retries to attempt on an update conflict
817
- // before throwing an error
818
- "onUpdateConflictRetries": 0,
819
- // Time to live of a paginated search
820
- "scrollTTL": "15s"
821
- }
822
- }
823
- },
824
-
825
- // Configuration of the Kuzzle's internal statistics module
826
- // * enabled:
827
- // Enable or disable the stats module
828
- // * ttl:
829
- // Time to live (in seconds) of a statistics frame
830
- // * statsInterval:
831
- // Time (in seconds) between statistics snapshots
832
- "stats": {
833
- "enabled": true,
834
- "ttl": 3600,
835
- "statsInterval": 10
836
- },
837
-
838
- // [validation]
839
- // Defines the specifications used to validate data.
840
- // Please refer to the guide for more information.
841
- // (https://docs.kuzzle.io/guide/1/datavalidation)
842
- //
843
- // /!\ No syntax check will be performed here /!\
844
- "validation": {
845
- },
846
-
847
- // [dump]
848
- // Kuzzle provides diagnostic tools, enabling analysis, support
849
- // and debugging on unexpected events (errors, crashes)
850
- // DO NOT disable this feature if you bought enterprise support
851
- // * enabled:
852
- // Enable/disable information dump on crash or on errors
853
- // (see below)
854
- // * history:
855
- // * coredump:
856
- // Maximum number of core dumps to keep.
857
- // Core dumps weight usually between 1 and 2GB,
858
- // so make sure you have enough space to store
859
- // the provided number of coredumps.
860
- // * reports:
861
- // Maximum number of reports directories
862
- // * path:
863
- // Directory path where the dumps are stored
864
- // * gcore:
865
- // Location of the "gcore" binary
866
- // * dateFormat:
867
- // Format used to generate dump names
868
- // (see http://momentjs.com for formats)
869
- // * handledErrors:
870
- // Creates a dump whenever an error belonging to the
871
- // provided list is generated
872
- // * enabled:
873
- // Enable/disable dumps on generated errors.
874
- // If disabled, dumps will only occur on crashes.
875
- // * whitelist:
876
- // List of error types triggering a dump
877
- "dump": {
878
- "enabled": true,
879
- "history": {
880
- "coredump": 3,
881
- "reports": 10
882
- },
883
- "path": "./dump/",
884
- "gcore": "/usr/bin/gcore",
885
- "dateFormat": "YYYYMMDD-HHmm",
886
- "handledErrors": {
887
- "enabled": true,
888
- "whitelist": [
889
- "Error",
890
- "RangeError",
891
- "TypeError",
892
- "KuzzleError",
893
- "InternalError"
894
- ]
895
- }
896
- },
897
-
898
- // [realtime]
899
- // Realtime engine options
900
- // * pcreSupport (DEPRECATED):
901
- // Backward-compatibility option. Since v1.11, Kuzzle's realtime engine
902
- // has been switched to RE2 as its regular expressions engine, instead
903
- // of regular PCREs. RE2 supports most of PCREs features, but not all.
904
- // You can switch back to PCREs if you absolutely cannot convert
905
- // existing regular expressions to make them compatible with RE2 in a
906
- // timely fashion, but note that this will make Kuzzle vulnerable to
907
- // ReDoS attacks (see https://en.wikipedia.org/wiki/ReDoS)
908
- //
909
- // It is *VERY STRONGLY* advised to leave that option deactivated.
910
- // This option is deprecated and will be removed from Kuzzle v2.
911
- // More information about the RE2 engine: https://github.com/google/re2
912
- //
913
- "realtime": {
914
- "pcreSupport": false
915
- },
916
-
917
- // [cluster]
918
- // Kuzzle Cluster configuration
919
- // * activityHistory:
920
- // Depth of nodes activity (addition or removal) to keep in memory for
921
- // the cluster:status API action
922
- // * heartbeat:
923
- // Delay between 2 heartbeat frames. A higher value means less
924
- // reactivity for detecting dead nodes, while a lower value might mean
925
- // erroneous node evictions on slow networks.
926
- // * interface:
927
- // Network interface to use as the node IP address.
928
- // If the configured interface cannot be found, the node will refuse to
929
- // start.
930
- // Accepted values:
931
- // * interface name (e.g. eth0, wlan0, vmnet1, ...)
932
- // * IP address (v4 or v6)
933
- // * MAC address
934
- // * null value: no preferred network interface
935
- // * ipv6:
936
- // If true, asks nodes to use IPv6 to connect to each others
937
- // * ip:
938
- // The type of IP address to use.
939
- // If no suitable IP address can be found, the node will refuse to
940
- // start.
941
- // Accepted values:
942
- // * 'public': will target only public IPs
943
- // * 'private': will target only private IPs (private addresses,
944
- // ULAs and link-local addresses)
945
- // * null (or blank string): no target preference. If this
946
- // property is left to null, it is advised to configure an interface
947
- // * joinTimeout:
948
- // The cluster join timeout (in ms): if that timeout is reached before
949
- // the node could join the cluster, it will kill itself.
950
- // * minimumNodes:
951
- // The minimum number of nodes required by the cluster. It should be set
952
- // to AT LEAST to ((total number of nodes / 2) + 1), to ensure that the
953
- // cluster continues to work correctly even in the face of a network
954
- // split. If there are fewer nodes available than the configured
955
- // minimum, the entire cluster stops accepting requests, until there are
956
- // enough nodes available again.
957
- // In this example, we plan to run a cluster of 3 nodes.
958
- // * ports:
959
- // The network TCP ports allowing cluster nodes to send messages to each
960
- // others. Cluster nodes MUST be able to open those ports between
961
- // themselves.
962
- // There is no need to expose these ports publicly.
963
- // * command:
964
- // used for issuing commands between nodes (handshakes, full
965
- // state requests, ...)
966
- // * sync:
967
- // one-way port to propagate sync information from a node to the
968
- // other ones
969
- // * syncTimeout:
970
- // The maximum time (in milliseconds) for a new node to receive a
971
- // fullstate from another node. If the cluster holds a very large number
972
- // of realtime subscriptions, it might be necessary to allow more time
973
- // for a fullstate to be sent to new nodes.
974
- "cluster": {
975
- "activityDepth": 50,
976
- "heartbeat": 2000,
977
- "interface": null,
978
- "ipv6": false,
979
- "ip": "private",
980
- "joinTimeout": 60000,
981
- "minimumNodes": 2,
982
- "ports": {
983
- "command": 7510,
984
- "sync": 7511
985
- },
986
- "syncTimeout": 5000
987
- }
988
- }