diff --git a/.ci/danger.config.yaml b/.ci/danger.config.yaml deleted file mode 100644 index 836dfbd108..0000000000 --- a/.ci/danger.config.yaml +++ /dev/null @@ -1,7 +0,0 @@ -checks: - branch-merge-check: - branches: - master: - - /.*-dev/ - changelog-tag-check: - pr-body-check: \ No newline at end of file diff --git a/.ci/scripts/run-monkey-tests.sh b/.ci/scripts/run-monkey-tests.sh index 43462fbbef..d2b278bd40 100755 --- a/.ci/scripts/run-monkey-tests.sh +++ b/.ci/scripts/run-monkey-tests.sh @@ -4,8 +4,8 @@ set -ex if [ -z "$NODE_VERSION" ]; then - echo "Missing NODE_VERSION, use default NODE_12_VERSION" - export NODE_VERSION=$NODE_12_VERSION + echo "Missing NODE_VERSION, use default NODE_16_VERSION" + export NODE_VERSION=$NODE_16_VERSION fi echo "Testing Kuzzle against node v$NODE_VERSION" diff --git a/.ci/scripts/run-test-arm.sh b/.ci/scripts/run-test-arm.sh index 9960ca0a58..7d97c93195 100755 --- a/.ci/scripts/run-test-arm.sh +++ b/.ci/scripts/run-test-arm.sh @@ -4,8 +4,8 @@ set -ex if [ -z "$NODE_VERSION" ]; then - echo "Missing NODE_VERSION, use default NODE_14_VERSION" - NODE_VERSION=$NODE_14_VERSION + echo "Missing NODE_VERSION, use default NODE_16_VERSION" + NODE_VERSION=$NODE_16_VERSION fi echo "Testing Kuzzle against node v$NODE_VERSION" diff --git a/.ci/scripts/run-test-cluster.sh b/.ci/scripts/run-test-cluster.sh index 4380962e1d..6cc29ce3a4 100755 --- a/.ci/scripts/run-test-cluster.sh +++ b/.ci/scripts/run-test-cluster.sh @@ -5,8 +5,8 @@ set -ex if [ -z "$NODE_VERSION" ]; then - echo "Missing NODE_VERSION, use default NODE_14_VERSION" - export NODE_VERSION=$NODE_14_VERSION + echo "Missing NODE_VERSION, use default NODE_16_VERSION" + export NODE_VERSION=$NODE_16_VERSION fi echo "Testing Kuzzle against node v$NODE_VERSION" diff --git a/.ci/scripts/run-test.sh b/.ci/scripts/run-test.sh index 171ab1de05..c91500c742 100755 --- a/.ci/scripts/run-test.sh +++ b/.ci/scripts/run-test.sh @@ -4,8 +4,8 @@ set -ex if [ -z "$NODE_VERSION" ]; then - echo "Missing NODE_VERSION, use default NODE_14_VERSION" - NODE_VERSION=$NODE_14_VERSION + echo "Missing NODE_VERSION, use default NODE_16_VERSION" + NODE_VERSION=$NODE_16_VERSION fi echo "Testing Kuzzle against node v$NODE_VERSION" diff --git a/.github/actions/install-packages/action.yml b/.github/actions/install-packages/action.yml index 8e1d9b093b..f74ac54311 100644 --- a/.github/actions/install-packages/action.yml +++ b/.github/actions/install-packages/action.yml @@ -4,5 +4,5 @@ description: Install necessary packages inside the CI runs: using: "composite" steps: - - run: sudo apt remove libunwind-dev libunwind8 + - run: sudo apt install libunwind-dev libunwind8 -y shell: bash diff --git a/.github/workflows/workflow-deployments.yaml b/.github/workflows/workflow-deployments.yaml index 788353bc62..8601f2c366 100644 --- a/.github/workflows/workflow-deployments.yaml +++ b/.github/workflows/workflow-deployments.yaml @@ -3,15 +3,20 @@ name: Workflow Deployments on: workflow_call: inputs: + node_lts_maintenance_version: + description: "Current Node LTS Version" + required: true + default: "16" + type: string node_lts_current_version: description: "Current Node LTS Version" required: true - default: "18" + default: "20" type: string node_lts_active_version: description: "Active Node LTS Version" required: true - default: "16" + default: "18" type: string docker_platforms: description: "Docker platforms" @@ -35,15 +40,20 @@ on: required: true default: true type: boolean + node_lts_maintenance_version: + description: "Current Node LTS Version" + required: true + default: "16" + type: string node_lts_current_version: description: "Current Node LTS Version" required: true - default: "18" + default: "20" type: string node_lts_active_version: description: "Active Node LTS Version" required: true - default: "16" + default: "18" type: string docker_platforms: description: "Docker platforms" @@ -60,7 +70,7 @@ jobs: if: ${{ (github.event_name != 'workflow_dispatch' || inputs.doc_deploy) && (github.ref_name == 'master' || github.ref_name == '2-dev') }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Extract references from context @@ -83,12 +93,12 @@ jobs: if: ${{ (github.event_name != 'workflow_dispatch' || inputs.dockerhub_deploy) && github.ref_name == 'master' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/install-packages - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: - node-version: ${{ inputs.node_lts_current_version }} - - uses: actions/cache@v2 + node-version: ${{ inputs.node_lts_maintenance_version }} + - uses: actions/cache@v3 with: path: "**/node_modules" key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} @@ -126,11 +136,11 @@ jobs: if: ${{ (github.event_name != 'workflow_dispatch' || inputs.npm_deploy) && github.ref_name == 'master' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/install-packages - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: - node-version: ${{ inputs.node_lts_active_version }} + node-version: ${{ inputs.node_lts_maintenance_version }} registry-url: "https://registry.npmjs.org" - run: npm install - run: npm publish diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index b9990f23eb..1dcfdcde03 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -8,9 +8,9 @@ on: pull_request: # This syntax stand for all PRs events env: - NODE_LTS_MAINTENANCE_VERSION: "14" - NODE_LTS_ACTIVE_VERSION: "16" - NODE_LTS_CURRENT_VERSION: "18" # Stand for the latest LTS version + NODE_LTS_MAINTENANCE_VERSION: "16" + NODE_LTS_ACTIVE_VERSION: "18" + NODE_LTS_CURRENT_VERSION: "20" # Stand for the latest LTS version DOCKER_PLATFORMS: "linux/amd64,linux/arm64" jobs: @@ -20,67 +20,24 @@ jobs: steps: - id: set-matrix run: | - echo "::set-output name=matrix::{\"node-version\": [\"$NODE_LTS_MAINTENANCE_VERSION\", \"$NODE_LTS_ACTIVE_VERSION\", \"$NODE_LTS_CURRENT_VERSION\"]}" + echo "::set-output name=matrix::{\"node-version\": [\"$NODE_LTS_MAINTENANCE_VERSION\", \"$NODE_LTS_ACTIVE_VERSION\"]}" outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} + node_lts_maintenance_version: ${{ env.NODE_LTS_MAINTENANCE_VERSION }} node_lts_active_version: ${{ env.NODE_LTS_ACTIVE_VERSION }} node_lts_current_version: ${{ env.NODE_LTS_CURRENT_VERSION }} docker_platforms: ${{ env.DOCKER_PLATFORMS }} - danger-js: - name: Danger JS - uses: kuzzleio/ci-tooling/.github/workflows/danger.yaml@master - secrets: inherit - with: - DANGER_CONFIG: "./.ci/danger.config.yaml" - - # ----------------------------------------------------------------------------- - # Documentation checks: error codes and dead links - # ----------------------------------------------------------------------------- - -# doc-dead-links: -# name: Documentation - Check Dead Links -# if: github.event_name == 'pull_request' -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# with: -# fetch-depth: 0 -# - uses: ./.github/actions/install-packages -# - name: Extract references from context -# shell: bash -# id: extract-refs -# run: | -# echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)" -# echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)" -# echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)" -# - uses: convictional/trigger-workflow-and-wait@v1.3.0 -# with: -# owner: kuzzleio -# repo: documentation -# github_token: ${{ secrets.ACCESS_TOKEN_CI }} -# workflow_file_name: dead_links.workflow.yml -# ref: ${{ steps.extract-refs.outputs.fw-branch }} -# inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}' - error-codes-check: name: Documentation - Error codes check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/install-packages - - uses: actions/cache@v2 - with: - path: "**/node_modules" - key: ${{ runner.os }}-${{ env.NODE_LTS_CURRENT_VERSION }}-${{ hashFiles('**/package-lock.json') }} - run: npm install - name: Test error codes run: ./.ci/scripts/check-error-codes-documentation.sh - # ----------------------------------------------------------------------------- - # Unit Test and Linting - # ----------------------------------------------------------------------------- - lint: name: Lint - Node.js LTS ${{ matrix.node-version }} runs-on: ubuntu-latest @@ -89,14 +46,11 @@ jobs: matrix: node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/install-packages - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - uses: actions/cache@v2 - with: - path: "**/node_modules" key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} - uses: ./.github/actions/es-lint @@ -108,14 +62,11 @@ jobs: node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/install-packages - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - uses: actions/cache@v2 - with: - path: "**/node_modules" key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} - uses: ./.github/actions/unit-tests env: @@ -134,14 +85,11 @@ jobs: node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} kuzzle-image: ["kuzzle"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/install-packages - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - uses: actions/cache@v2 - with: - path: "**/node_modules" key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} - uses: ./.github/actions/build-and-run-kuzzle with: @@ -153,17 +101,22 @@ jobs: strategy: matrix: test_set: - [jest, http, websocket, "legacy:mqtt", "legacy:http", "legacy:websocket"] + [ + jest, + http, + websocket, + "legacy:mqtt", + "legacy:http", + "legacy:websocket", + ] node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: ./.github/actions/install-packages + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - uses: actions/cache@v2 - with: - path: "**/node_modules" key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} - uses: ./.github/actions/functional-tests with: @@ -180,19 +133,16 @@ jobs: matrix: node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/install-packages - name: Cloning Monkey Tester - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: kuzzleio/kuzzle-monkey-tests path: "kuzzle-monkey-tests" - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - uses: actions/cache@v2 - with: - path: "**/node_modules" key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} - uses: ./.github/actions/monkey-tests with: @@ -206,6 +156,7 @@ jobs: uses: ./.github/workflows/workflow-deployments.yaml secrets: inherit with: + node_lts_maintenance_version: ${{ needs.prepare-matrix.outputs.node_lts_maintenance_version }} node_lts_active_version: ${{ needs.prepare-matrix.outputs.node_lts_active_version }} node_lts_current_version: ${{ needs.prepare-matrix.outputs.node_lts_current_version }} docker_platforms: ${{ needs.prepare-matrix.outputs.docker_platforms }} diff --git a/doc/2/api/controllers/auth/check-token/index.md b/doc/2/api/controllers/auth/check-token/index.md index a49eb920bd..ff5ea7622c 100644 --- a/doc/2/api/controllers/auth/check-token/index.md +++ b/doc/2/api/controllers/auth/check-token/index.md @@ -40,7 +40,7 @@ Body: --- - + When no token is provided the method returns information about the anonymous token (`kuid` is `-1`), instead of throwing an error. ## Body properties diff --git a/doc/2/api/controllers/bulk/update-by-query/index.md b/doc/2/api/controllers/bulk/update-by-query/index.md index 6c9dd26f74..5714687233 100644 --- a/doc/2/api/controllers/bulk/update-by-query/index.md +++ b/doc/2/api/controllers/bulk/update-by-query/index.md @@ -48,7 +48,7 @@ Body: { "index": "", "collection": "", - "controller": "document", + "controller": "bulk", "action": "updateByQuery", "refresh": "wait_for", "body": { @@ -65,7 +65,7 @@ Body: ### Kourou ```bash -kourou document:updateByQuery +kourou bulk:updateByQuery ``` --- @@ -103,7 +103,7 @@ Returns the number of updated documents. "error": null, "index": "", "collection": "", - "controller": "document", + "controller": "bulk", "action": "updateByQuery", "requestId": "", "result": { diff --git a/doc/2/api/controllers/document/search/index.md b/doc/2/api/controllers/document/search/index.md index 119cd770ee..13888e6e6c 100644 --- a/doc/2/api/controllers/document/search/index.md +++ b/doc/2/api/controllers/document/search/index.md @@ -108,7 +108,7 @@ Search using `index` & `collection` parameters } ``` -Search using `targets` parameter +Search using `targets` parameter ```js { @@ -191,8 +191,8 @@ Returns a paginated search result set, with the following properties: - `aggregations`: provides aggregation information. Present only if an `aggregations` object has been provided in the search body - `hits`: array of found documents. Each document has the following properties: - `_id`: document unique identifier - - `index`: index name - - `collection`: collection name + - `index`: index name + - `collection`: collection name - `_score`: [relevance score](https://www.elastic.co/guide/en/elasticsearch/guide/current/relevance-intro.html) - `_source`: new document content - `highlight`: optional result from [highlight API](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/search-request-body.html#request-body-search-highlighting) diff --git a/doc/2/api/protocols/websocket/index.md b/doc/2/api/protocols/websocket/index.md index 47464d1d4e..50385f4b18 100644 --- a/doc/2/api/protocols/websocket/index.md +++ b/doc/2/api/protocols/websocket/index.md @@ -65,7 +65,7 @@ Modifying the listening port will impact these two protocols. ::: - + ### Ping / Pong keep-alive diff --git a/doc/2/guides/getting-started/run-kuzzle/index.md b/doc/2/guides/getting-started/run-kuzzle/index.md index 500b2bcaf3..7ccd8b5e33 100644 --- a/doc/2/guides/getting-started/run-kuzzle/index.md +++ b/doc/2/guides/getting-started/run-kuzzle/index.md @@ -20,15 +20,16 @@ In this guide we will use Docker and Docker Compose to run those services. ### Prerequisites +::: info +It is recommended to use Node Version Manager to avoid rights problems when using Node.js and dependencies. +You can install NVM with the one-liner script documented on [NVM Github repository](https://github.com/nvm-sh/nvm#install--update-script) +::: + - [Node.js <= 18](https://nodejs.org/en/download/) - [Docker](https://docs.docker.com/engine/install/) - [Docker Compose](https://docs.docker.com/compose/install/) - [Kourou](https://github.com/kuzzleio/kourou) -::: info -It is recommended to use Node Version Manager to avoid rights problems when using Node.js and dependencies. -You can install NVM with the one-liner script documented on [NVM Github repository](https://github.com/nvm-sh/nvm#install--update-script) -::: Throughout this guide, we will need to use [Kourou](https://github.com/kuzzleio/kourou), the Kuzzle CLI. @@ -91,12 +92,13 @@ app .catch(console.error); ``` -We can now run our first application with: `npm run docker:dev` - ::: info -Under the hood, the command `npm run docker:dev` uses [nodemon](https://nodemon.io/) and [ts-node](https://www.npmjs.com/package/ts-node) inside the Docker container to run the application. +You can now run `cd playground && npm run docker npm install install dependencies` to install dependencies. After this has run successfully, run our first application with: `npm run docker:dev`. ::: + +Under the hood, the command `npm run docker:dev` uses [nodemon](https://nodemon.io/) and [ts-node](https://www.npmjs.com/package/ts-node) inside the Docker container to run the application. + Now visit [http://localhost:7512](http://localhost:7512) with your browser. You should see the result of the [server:info](/core/2/api/controllers/server/info) action. ### Admin Console diff --git a/doc/2/guides/getting-started/set-up-permissions/index.md b/doc/2/guides/getting-started/set-up-permissions/index.md index b512992250..4bceae8278 100644 --- a/doc/2/guides/getting-started/set-up-permissions/index.md +++ b/doc/2/guides/getting-started/set-up-permissions/index.md @@ -42,7 +42,7 @@ kourou security:createRole '{ } } } -}' --id dummy +}' --id dummyRole ``` You should see your newly created role in the `Security > Roles` section of the [Admin Console](http://next-console.kuzzle.io) @@ -56,12 +56,12 @@ Then, we are going to create a profile which uses our newly created role. For th ```bash kourou security:createProfile '{ policies: [ - { roleId: "dummy" } + { roleId: "dummyRole" } ] -}' --id dummy +}' --id dummyProfile ``` -Now we have a `dummy` profile which gives access to the API actions allowed by the `dummy` role. +Now we have a `dummyProfile` profile which gives access to the API actions allowed by the `dummyRole` role. You should see your newly created profile in the `Security > Profiles` section of the [Admin Console](http://next-console.kuzzle.io) @@ -69,7 +69,7 @@ You should see your newly created profile in the `Security > Profiles` section o ## User -Finally, we need a user attached to the `dummy` profile. The API action to create a user is [security:createUser](/core/2/api/controllers/security/create-user). +Finally, we need a user attached to the `dummyProfile` profile. The API action to create a user is [security:createUser](/core/2/api/controllers/security/create-user). Users need to have at least one assigned profile. We also will have to give our user some credentials to be able to log in with it. @@ -77,7 +77,7 @@ For this we will use the [security:createUser](/core/2/api/controllers/security/ ```bash kourou security:createUser '{ content: { - profileIds: ["dummy"] + profileIds: ["dummyProfile"] }, credentials: { local: { diff --git a/doc/2/guides/getting-started/store-and-access-data/data-storage-organization.8a731985.png b/doc/2/guides/getting-started/store-and-access-data/data-storage-organization.8a731985.png new file mode 100644 index 0000000000..0e22cf92fc Binary files /dev/null and b/doc/2/guides/getting-started/store-and-access-data/data-storage-organization.8a731985.png differ diff --git a/doc/2/guides/getting-started/store-and-access-data/index.md b/doc/2/guides/getting-started/store-and-access-data/index.md index 148c635792..5508807dc2 100644 --- a/doc/2/guides/getting-started/store-and-access-data/index.md +++ b/doc/2/guides/getting-started/store-and-access-data/index.md @@ -20,6 +20,8 @@ Kuzzle organizes the data storage in 4 levels: - Documents - Fields +![file hierarchy description](./data-storage-organization.8a731985.png) + An index brings together several collections, which in turn contain several documents, each of which is composed of several fields. The **collections have mappings** that define the way Elasticsearch will index the data for searches. diff --git a/doc/2/guides/getting-started/subscribe-realtime-notifications/index.md b/doc/2/guides/getting-started/subscribe-realtime-notifications/index.md index bcb8370d06..7a2dbd3606 100644 --- a/doc/2/guides/getting-started/subscribe-realtime-notifications/index.md +++ b/doc/2/guides/getting-started/subscribe-realtime-notifications/index.md @@ -35,7 +35,15 @@ Kourou is now waiting for realtime notifications about changes in our collection We are going to create a new document in the Admin Console to trigger one! -Open the [Admin Console](http://next-console.kuzzle.io/#/data/nyc-open-data/yellow-taxi) and then create a new document. +Open the [Admin Console](http://next-console.kuzzle.io/#/data/nyc-open-data/yellow-taxi) and then create a new document : + +```bash +{ + "name": "Nerwin", + "city": "Montreal", + "age": 26 +} +``` Then you should receive a notification about the created document in your terminal: @@ -77,7 +85,10 @@ This filter must be written using [Koncorde Filter Syntax](/core/2/api/koncorde- Koncorde is part of the Realtime Engine and handles subscription filters. ::: -Now we can subscribe again with a filter: +We can now subscribe with a filter. + +If you still have the previous subscription active in a terminal, cancel it and subscribe again. + ```bash kourou realtime:subscribe nyc-open-data yellow-taxi '{ diff --git a/docker-compose.yml b/docker-compose.yml index 58827fe9cb..40c96d3a5e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,9 @@ x-kuzzle-config: &kuzzle-config # Variables used by the development scripts - NODE_12_VERSION=12.20.0 - NODE_14_VERSION=14.17.0 + - NODE_16_VERSION=16.19.1 + - NODE_18_VERSION=18.17.0 + - NODE_20_VERSION=20.0.0 - WITHOUT_KUZZLE # Run only Elasticsearch and Redis - REBUILD # Force a rebuild of npm modules diff --git a/docker/images/kuzzle/Dockerfile b/docker/images/kuzzle/Dockerfile index ea3ec223bf..6bdcd49dee 100644 --- a/docker/images/kuzzle/Dockerfile +++ b/docker/images/kuzzle/Dockerfile @@ -1,7 +1,7 @@ ################################################################################ # Production build image ################################################################################ -FROM node:14-bullseye-slim as builder +FROM node:16-bullseye-slim as builder RUN set -x \ && apt-get update \ @@ -45,7 +45,7 @@ RUN set -x \ ################################################################################ # Production build 2 image ################################################################################ -FROM node:14-bullseye-slim as minifier +FROM node:16-bullseye-slim as minifier ENV NODE_ENV=production diff --git a/docker/images/plugin-dev/Dockerfile b/docker/images/plugin-dev/Dockerfile index c0741b68c6..61dff0ab07 100644 --- a/docker/images/plugin-dev/Dockerfile +++ b/docker/images/plugin-dev/Dockerfile @@ -1,7 +1,7 @@ ################################################################################ # Plugin development build image ################################################################################ -FROM node:14-bullseye-slim as builder +FROM node:16-bullseye-slim as builder RUN set -x \ && apt-get update && apt-get install -y \ diff --git a/lib/core/network/protocols/httpwsProtocol.js b/lib/core/network/protocols/httpwsProtocol.js index 259d544b60..85583bdd3c 100644 --- a/lib/core/network/protocols/httpwsProtocol.js +++ b/lib/core/network/protocols/httpwsProtocol.js @@ -1145,6 +1145,8 @@ class HttpWsProtocol extends Protocol { ); } + const idleTimeoutInSecond = Math.round(idleTimeout / 1000); + /** * @deprecated -- to be removed in the next major version */ @@ -1158,7 +1160,7 @@ class HttpWsProtocol extends Protocol { enabled: cfg.enabled, opts: { compression, - idleTimeout, + idleTimeout: idleTimeoutInSecond, maxPayloadLength: this.maxRequestSize, }, rateLimit: cfg.rateLimit, diff --git a/package-lock.json b/package-lock.json index ecb2254dba..4db90fc95a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kuzzle", - "version": "2.25.0", + "version": "2.26.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "kuzzle", - "version": "2.25.0", + "version": "2.26.0", "license": "Apache-2.0", "dependencies": { "@elastic/elasticsearch": "https://github.com/elastic/elasticsearch-js/archive/refs/tags/v7.13.0.tar.gz", @@ -18,7 +18,6 @@ "denque": "^2.1.0", "didyoumean": "^1.2.2", "dumpme": "^1.0.3", - "eslint-plugin-kuzzle": "^0.0.6", "eventemitter3": "^4.0.7", "inquirer": "^9.1.4", "ioredis": "^5.3.0", @@ -44,7 +43,7 @@ "semver": "^7.3.8", "sorted-array": "^2.0.4", "uuid": "^9.0.0", - "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.7.0.tar.gz", + "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.23.0.tar.gz", "validator": "^13.9.0", "winston": "^3.8.2", "winston-elasticsearch": "0.17.1", @@ -66,6 +65,7 @@ "codecov": "^3.8.3", "cucumber": "^6.0.5", "ergol": "^1.0.2", + "eslint-plugin-kuzzle": "^0.0.6", "jest": "^29.4.1", "mocha": "^10.2.0", "mock-require": "^3.0.3", @@ -3876,7 +3876,8 @@ }, "node_modules/eslint-plugin-kuzzle": { "version": "0.0.6", - "license": "Apache 2", + "resolved": "https://registry.npmjs.org/eslint-plugin-kuzzle/-/eslint-plugin-kuzzle-0.0.6.tgz", + "integrity": "sha512-1tWOBxr0Fpe7yVFh3WLwrN8jgjaA39yKM0ohAkLNAN22P4HvPrN2rk0EhEUA8UFrpuRpX4wp4sF1HYUXJ2786g==", "dependencies": { "@typescript-eslint/eslint-plugin": "^5.38.0", "@typescript-eslint/parser": "^5.38.0", @@ -11239,9 +11240,9 @@ "license": "MIT" }, "node_modules/uWebSockets.js": { - "version": "20.7.0", - "resolved": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.7.0.tar.gz", - "integrity": "sha512-1SNylEM0lt36S+0cB6loCIf+qp1HQuSNPx68MUJrZNUgpygWtw9ukSCOxecDRF0qbviVvsphdbA6w6hgOoaNtw==" + "version": "20.23.0", + "resolved": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.23.0.tar.gz", + "integrity": "sha512-8jyrk0YF8P5LtfWcP1cdmbaL0tlPk4i24Y9+J9stOie+nrP6XCjZUb5knJoi0JgDZqWZDewx3EEuyttagSRDuQ==" }, "node_modules/v8-compile-cache": { "version": "2.3.0", @@ -14362,6 +14363,8 @@ }, "eslint-plugin-kuzzle": { "version": "0.0.6", + "resolved": "https://registry.npmjs.org/eslint-plugin-kuzzle/-/eslint-plugin-kuzzle-0.0.6.tgz", + "integrity": "sha512-1tWOBxr0Fpe7yVFh3WLwrN8jgjaA39yKM0ohAkLNAN22P4HvPrN2rk0EhEUA8UFrpuRpX4wp4sF1HYUXJ2786g==", "requires": { "@typescript-eslint/eslint-plugin": "^5.38.0", "@typescript-eslint/parser": "^5.38.0", @@ -19217,8 +19220,8 @@ "version": "1.1.0" }, "uWebSockets.js": { - "version": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.7.0.tar.gz", - "integrity": "sha512-1SNylEM0lt36S+0cB6loCIf+qp1HQuSNPx68MUJrZNUgpygWtw9ukSCOxecDRF0qbviVvsphdbA6w6hgOoaNtw==" + "version": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.23.0.tar.gz", + "integrity": "sha512-8jyrk0YF8P5LtfWcP1cdmbaL0tlPk4i24Y9+J9stOie+nrP6XCjZUb5knJoi0JgDZqWZDewx3EEuyttagSRDuQ==" }, "v8-compile-cache": { "version": "2.3.0", diff --git a/package.json b/package.json index aea640b4ca..4ff2e768a3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kuzzle", "author": "The Kuzzle Team ", - "version": "2.25.0", + "version": "2.26.0", "description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.", "bin": "bin/start-kuzzle-server", "scripts": { @@ -53,7 +53,6 @@ "denque": "^2.1.0", "didyoumean": "^1.2.2", "dumpme": "^1.0.3", - "eslint-plugin-kuzzle": "^0.0.6", "eventemitter3": "^4.0.7", "inquirer": "^9.1.4", "ioredis": "^5.3.0", @@ -79,7 +78,7 @@ "semver": "^7.3.8", "sorted-array": "^2.0.4", "uuid": "^9.0.0", - "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.7.0.tar.gz", + "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.23.0.tar.gz", "validator": "^13.9.0", "winston": "^3.8.2", "winston-elasticsearch": "0.17.1", @@ -102,6 +101,7 @@ "codecov": "^3.8.3", "cucumber": "^6.0.5", "ergol": "^1.0.2", + "eslint-plugin-kuzzle": "^0.0.6", "jest": "^29.4.1", "mocha": "^10.2.0", "mock-require": "^3.0.3", diff --git a/test/core/network/protocols/websocket.test.js b/test/core/network/protocols/websocket.test.js index 64f403543c..af9615b043 100644 --- a/test/core/network/protocols/websocket.test.js +++ b/test/core/network/protocols/websocket.test.js @@ -83,7 +83,7 @@ describe("core/network/protocols/websocket", () => { await httpWs.init(entryPoint); should(httpWs.server.ws).calledWithMatch("/*", { - idleTimeout: 60000, + idleTimeout: 60, }); should(kuzzle.log.warn).calledWith( @@ -126,7 +126,7 @@ describe("core/network/protocols/websocket", () => { should(httpWs.server.ws).calledWithMatch("/*", { compression: uWS.SHARED_COMPRESSOR, - idleTimeout: 12345, + idleTimeout: 12, maxBackPressure: sinon.match.number, maxPayloadLength: 1024, upgrade: sinon.match.func,