Skip to content

Commit

Permalink
Fix, and use jsonc for kuzzlerc.sample
Browse files Browse the repository at this point in the history
  • Loading branch information
rolljee committed Oct 19, 2023
1 parent a043dd8 commit f2e4a5d
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 54 deletions.
114 changes: 68 additions & 46 deletions .kuzzlerc.sample → .kuzzlerc.sample.jsonc
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{

// -------------------------------------------------------------------------
// Kuzzle configuration sample file
//
// You can copy this file to a valid rc file location to customize Kuzzle
// configuration (see https://github.com/dominictarr/rc)
// -------------------------------------------------------------------------

// The HTTP section lets you configure how Kuzzle should handle HTTP requests
"http": {
// * accessControlAllowOrigin:
Expand All @@ -32,7 +30,6 @@
"accessControlAllowHeaders": "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With, Content-Encoding, Content-Length, X-Kuzzle-Volatile",
"cookieAuthentication": true
},

// Kuzzle configured limits
"limits": {
// * concurrentRequests:
Expand Down Expand Up @@ -94,13 +91,11 @@
"subscriptionRooms": 1000000,
"subscriptionDocumentTTL": 259200000 // 72 * 60 * 60 * 1000
},

// The application section lets you configure your application
// (see https://docs.kuzzle.io/core/2/guides/advanced/configuration)
"application": {
// any key/value..
},

// The plugins section lets you define plugins behaviors
// (see https://docs.kuzzle.io/core/2/guides/write-plugins)
"plugins": {
Expand Down Expand Up @@ -147,7 +142,6 @@
"kuzzle-plugin-auth-passport-local"
]
},

// plugin logger configuration.
// see https://github.com/kuzzleio/kuzzle-plugin-logger
"kuzzle-plugin-logger": {
Expand All @@ -157,7 +151,6 @@
}
}
},

// [Kuzzle Plugin Auth Passport Local]
// * algorithm
// one of the supported encryption algorithms
Expand Down Expand Up @@ -194,15 +187,13 @@
"resetPasswordExpiresIn": -1,
"passwordPolicies": []
}

// Custom plugin configurations must be described here.
// Example:
//
// "plugin-name": {
// "<configuration property name>": "<value>"
// }
},

// The repositories are used internally by Kuzzle to store its data (users,
// permissions, configuration etc.)
"repositories": {
Expand All @@ -216,7 +207,6 @@
"cacheTTL": 1440000
}
},

// The security section contains the configuration for Kuzzle permissions
// mechanism
"security": {
Expand All @@ -231,7 +221,9 @@
// [restrictedProfileIds]
// The profileIds applied to a user created with the API action
// "security:createRestrictedUser"
"restrictedProfileIds": ["default"],
"restrictedProfileIds": [
"default"
],
// [jwt]
// configuration for the npm package jsonwebtoken
// (see https://github.com/auth0/node-jsonwebtoken)
Expand Down Expand Up @@ -341,20 +333,31 @@
"profiles": {
"admin": {
"rateLimit": 0,
"policies": [ {"roleId": "admin"} ]
"policies": [
{
"roleId": "admin"
}
]
},
"default": {
"rateLimit": 10,
"policies": [ {"roleId": "default"} ]
"policies": [
{
"roleId": "default"
}
]
},
"anonymous": {
"rateLimit": 200,
"policies": [ {"roleId": "anonymous"} ]
"policies": [
{
"roleId": "anonymous"
}
]
}
}
}
},

// Kuzzle server is the entry point for incoming requests
"server": {
// General network configuration:
Expand Down Expand Up @@ -494,13 +497,12 @@
"enabled": true,
"idleTimeout": 60000,
"rateLimit": 0,
"realtimeNotifications": true
"realtimeNotifications": true,
"sendPingsAutomatically": false,
"resetIdleTimeoutOnSend": false,
"resetIdleTimeoutOnSend": false
}
}
},

// Services are the external components Kuzzle relies on.
"services": {
// [common]
Expand All @@ -514,7 +516,6 @@
"defaultInitTimeout": 120000,
"retryInterval": 1000
},

// [internalIndex]
// The database engine used for Kuzzle internal index
// * bootstrapLockTimeout:
Expand All @@ -523,7 +524,6 @@
"internalIndex": {
"bootstrapLockTimeout": 60000
},

// [internalCache]
// The cache service relies on Redis sample settings for Redis service
// (see also https://github.com/luin/ioredis)
Expand Down Expand Up @@ -641,7 +641,6 @@
// "enableReadyCheck": true
// }
//},

// [memoryStorage]
// The Redis memoryStorage Engine
// (see "internalCache" above for sample settings)
Expand Down Expand Up @@ -753,7 +752,6 @@
// "enableReadyCheck": true
// }
//},

// [storageEngine]
// The default storage layer is Elasticsearch and it is
// currently the only storage layer we support.
Expand All @@ -776,7 +774,9 @@
// See https://www.elastic.co/guide/en/elasticsearch/reference/7.4/dynamic-mapping.html
"storageEngine": {
"backend": "elasticsearch",
"aliases": ["storageEngine"],
"aliases": [
"storageEngine"
],
"client": {
"node": "http://localhost:9200"
},
Expand All @@ -786,10 +786,18 @@
"properties": {
"_kuzzle_info": {
"properties": {
"author": { "type": "keyword" },
"createdAt": { "type": "date" },
"updatedAt": { "type": "date" },
"updater": { "type": "keyword" }
"author": {
"type": "keyword"
},
"createdAt": {
"type": "date"
},
"updatedAt": {
"type": "date"
},
"updater": {
"type": "keyword"
}
}
}
}
Expand All @@ -816,7 +824,9 @@
"mappings": {
"dynamic": "false",
"properties": {
"profileIds": { "type": "keyword" }
"profileIds": {
"type": "keyword"
}
}
}
},
Expand All @@ -829,8 +839,10 @@
"dynamic": "false",
"properties": {
"policies": {
"properties": {
"roleId": { "type": "keyword" }
"properties": {
"roleId": {
"type": "keyword"
}
}
}
}
Expand Down Expand Up @@ -858,8 +870,12 @@
},
"mappings": {
"properties": {
"index": { "type": "keyword" },
"collection": { "type": "keyword" },
"index": {
"type": "keyword"
},
"collection": {
"type": "keyword"
},
"validations": {
"dynamic": "false",
"properties": {}
Expand All @@ -885,12 +901,24 @@
"mappings": {
"dynamic": "false",
"properties": {
"userId": { "type": "keyword" },
"hash": { "type": "keyword" },
"expiresAt": { "type": "long" },
"ttl": { "type": "keyword" },
"description": { "type": "text" },
"token": { "type": "keyword" }
"userId": {
"type": "keyword"
},
"hash": {
"type": "keyword"
},
"expiresAt": {
"type": "long"
},
"ttl": {
"type": "keyword"
},
"description": {
"type": "text"
},
"token": {
"type": "keyword"
}
}
}
}
Expand All @@ -917,7 +945,6 @@
"generateMissingAliases": true
}
},

// Configuration of the Kuzzle's internal statistics module
// * enabled:
// Enable or disable the stats module
Expand All @@ -930,16 +957,13 @@
"ttl": 3600,
"statsInterval": 10
},

// [validation]
// Defines the specifications used to validate data.
// Please refer to the guide for more information.
// (https://docs.kuzzle.io/guide/1/datavalidation)
//
// /!\ No syntax check will be performed here /!\
"validation": {
},

"validation": {},
// [dump]
// Kuzzle provides diagnostic tools, enabling analysis, support
// and debugging on unexpected events (errors, crashes)
Expand Down Expand Up @@ -990,7 +1014,6 @@
]
}
},

// [realtime]
// Realtime engine options
// * pcreSupport (DEPRECATED):
Expand All @@ -1009,7 +1032,6 @@
"realtime": {
"pcreSupport": false
},

// [cluster]
// Kuzzle Cluster configuration
// * activityHistory:
Expand Down Expand Up @@ -1081,4 +1103,4 @@
},
"syncTimeout": 5000
}
}
}
Empty file removed config/.keep
Empty file.
2 changes: 1 addition & 1 deletion doc/2/guides/advanced/cluster-scalability/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ If you want to quickly create a Kuzzle cluster on a single machine, you can use

Kuzzle's RC file features a `cluster` section, allowing to fine-tune its behavior.

See the `cluster` section of our [.kuzzlerc.sample file](https://github.com/kuzzleio/kuzzle/blob/master/.kuzzlerc.sample) for a complete documentation.
See the `cluster` section of our [.kuzzlerc.sample.jsonc file](https://github.com/kuzzleio/kuzzle/blob/master/.kuzzlerc.sample.jsonc) for a complete documentation.

---

Expand Down
2 changes: 1 addition & 1 deletion doc/2/guides/advanced/debugging/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It's easier and safer to use the [Debug Controller](/core/2/api/controllers/debu
Whereas when launching Kuzzle with `node --inspect` you need to setup some Port Forwarding from your host machine to your local machine to be able to debug Kuzzle remotely, and you need to be sure that no one can access your instance using the Debug Port exposed.

:::warning
By default access to the [Chrome Devtools Protocol](https://chromedevtools.github.io/devtools-protocol/v8) through the [Debug Controller](/core/2/api/controllers/debug) is disabled, to use the methods of the [Chrome Devtools Protocol](https://chromedevtools.github.io/devtools-protocol/v8) you need to enable it in the [kuzzlerc file](https://github.com/kuzzleio/kuzzle/blob/debug-controller/.kuzzlerc.sample#L229)
By default access to the [Chrome Devtools Protocol](https://chromedevtools.github.io/devtools-protocol/v8) through the [Debug Controller](/core/2/api/controllers/debug) is disabled, to use the methods of the [Chrome Devtools Protocol](https://chromedevtools.github.io/devtools-protocol/v8) you need to enable it in the [kuzzlerc file](https://github.com/kuzzleio/kuzzle/blob/debug-controller/.kuzzlerc.sample.jsonc#L229)
by setting `security.debug.native_debug_protocol` to `true` and rebooting your instance.
:::

Expand Down
2 changes: 1 addition & 1 deletion docker/images/kuzzle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ADD ./lib /app/lib
ADD ./package.json /app/package.json
ADD ./package-lock.json /app/package-lock.json
ADD ./index.js /app/index.js
ADD ./.kuzzlerc.sample /app/.kuzzlerc.sample
ADD ./.kuzzlerc.sample.jsonc /app/.kuzzlerc.sample.jsonc

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion docker/images/plugin-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ADD ./lib /app/lib
ADD ./package.json /app/package.json
ADD ./package-lock.json /app/package-lock.json
ADD ./index.js /app/index.js
ADD ./.kuzzlerc.sample /app/.kuzzlerc.sample
ADD ./.kuzzlerc.sample.jsonc /app/.kuzzlerc.sample.jsonc


WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion lib/config/default.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { KuzzleConfiguration } from "../types/config/KuzzleConfiguration";
*
* To customize your Kuzzle installation, create a
* ".kuzzlerc" file and put your overrides there.
* Please check the ".kuzzlerc.sample" file to get
* Please check the ".kuzzlerc.sample.jsonc" file to get
* started.
*
* @class KuzzleConfiguration
Expand Down
2 changes: 1 addition & 1 deletion lib/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function preprocessProtocolsOptions(config) {

function preprocessRedisOptions(redisConfig) {
// @deprecated Remove those lines for Kuzzle v3 then
// remove also 'database' from .kuzzlerc.sample and default.config
// remove also 'database' from .kuzzlerc.sample.jsonc and default.config
if (redisConfig.database) {
redisConfig.options = { db: redisConfig.database, ...redisConfig.options };
}
Expand Down
4 changes: 4 additions & 0 deletions lib/types/config/ServerConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,15 @@ export type ServerConfiguration = {

/**
* Whether or not we should automatically send pings to uphold a stable connection given whatever idleTimeout.
*
* @default false
*/
sendPingsAutomatically: boolean;

/**
* Whether or not we should reset the idle timeout on every message received.
*
* @default false
*/
resetIdleTimeoutOnSend: boolean;
};
Expand Down
Loading

0 comments on commit f2e4a5d

Please sign in to comment.