From 7360d2d6e1dc4b5be35f8ca5301e5bcb1c05e846 Mon Sep 17 00:00:00 2001 From: rolljee Date: Tue, 19 Sep 2023 15:35:13 +0200 Subject: [PATCH 1/4] Update doco, scripts, dockerfile to nodejs 18 --- .ci/scripts/run-monkey-tests.sh | 4 ++-- .ci/scripts/run-test-arm.sh | 4 ++-- .ci/scripts/run-test-cluster.sh | 4 ++-- .ci/scripts/run-test.sh | 4 ++-- .../controllers/server/health-check/index.md | 2 +- docker-compose.yml | 8 +++---- docker/docker-compose-swarm.yml | 4 ++-- docker/images/kuzzle/Dockerfile | 4 ++-- docker/images/kuzzle/README.md | 2 +- docker/images/plugin-dev/Dockerfile | 2 +- docker/images/plugin-dev/README.md | 22 +++++++++++++++++++ docker/scripts/docker-compose.test.yml | 11 +++++----- docker/scripts/run-dev.sh | 4 ++-- docker/scripts/run-test.sh | 4 ++-- lib/api/httpRoutes.js | 2 +- 15 files changed, 51 insertions(+), 30 deletions(-) diff --git a/.ci/scripts/run-monkey-tests.sh b/.ci/scripts/run-monkey-tests.sh index d2b278bd40..0c77e522f4 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_16_VERSION" - export NODE_VERSION=$NODE_16_VERSION + echo "Missing NODE_VERSION, use default NODE_18_VERSION" + export NODE_VERSION=$NODE_18_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 7d97c93195..4b3968024a 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_16_VERSION" - NODE_VERSION=$NODE_16_VERSION + echo "Missing NODE_VERSION, use default NODE_18_VERSION" + NODE_VERSION=$NODE_18_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 6cc29ce3a4..50836b7808 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_16_VERSION" - export NODE_VERSION=$NODE_16_VERSION + echo "Missing NODE_VERSION, use default NODE_18_VERSION" + export NODE_VERSION=$NODE_18_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 c91500c742..0a6f29f7d5 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_16_VERSION" - NODE_VERSION=$NODE_16_VERSION + echo "Missing NODE_VERSION, use default NODE_18_VERSION" + NODE_VERSION=$NODE_18_VERSION fi echo "Testing Kuzzle against node v$NODE_VERSION" diff --git a/doc/2/api/controllers/server/health-check/index.md b/doc/2/api/controllers/server/health-check/index.md index 67b4369d6f..effca05bfc 100644 --- a/doc/2/api/controllers/server/health-check/index.md +++ b/doc/2/api/controllers/server/health-check/index.md @@ -17,7 +17,7 @@ Returns the status of Kuzzle and it's internal services. ### HTTP ```http -URL: http://kuzzle:7512/_healthCheck[?services] +URL: http://kuzzle:7512/_healthcheck[?services] Method: GET ``` diff --git a/docker-compose.yml b/docker-compose.yml index 40c96d3a5e..cc728bf312 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,8 +36,6 @@ x-kuzzle-config: &kuzzle-config - KUZZLE_VAULT_KEY=${KUZZLE_VAULT_KEY:-secret-password} - KUZZLE_SECRETS_FILE=${KUZZLE_SECRETS_FILE:-/var/app/features/fixtures/secrets.enc.json} # 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 @@ -65,7 +63,7 @@ services: - '1883:1883' # Kuzzle MQTT port - '9229:9229' # Debug port healthcheck: - test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthCheck'] + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthcheck'] timeout: 1s interval: 2s retries: 10 @@ -78,7 +76,7 @@ services: - '11883:1883' # Kuzzle MQTT port - '9230:9229' # Debug port healthcheck: - test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthCheck'] + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthcheck'] timeout: 1s interval: 2s retries: 10 @@ -91,7 +89,7 @@ services: - '11884:1883' # Kuzzle MQTT port - '9231:9229' # Debug port healthcheck: - test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthCheck'] + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthcheck'] timeout: 1s interval: 2s retries: 10 diff --git a/docker/docker-compose-swarm.yml b/docker/docker-compose-swarm.yml index 1073fa89be..353c20cae9 100644 --- a/docker/docker-compose-swarm.yml +++ b/docker/docker-compose-swarm.yml @@ -34,7 +34,7 @@ services: sysctls: - net.core.somaxconn=8192 healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:7512/_healthCheck"] + test: ["CMD", "curl", "-f", "http://localhost:7512/_healthcheck"] timeout: 1s interval: 2s retries: 30 @@ -47,7 +47,7 @@ services: - "traefik.enable=true" # Kuzzle HTTP/WS - "traefik.http.services.kuzzle_http.loadbalancer.server.port=7512" - - "traefik.http.services.kuzzle_http.loadbalancer.healthCheck.path=/_healthCheck" + - "traefik.http.services.kuzzle_http.loadbalancer.healthCheck.path=/_healthcheck" - "traefik.http.services.kuzzle_http.loadbalancer.healthCheck.interval=5s" - "traefik.http.routers.kuzzle.entrypoints=kuzzle_http" - "traefik.http.routers.kuzzle.rule=Host(`localhost`)" diff --git a/docker/images/kuzzle/Dockerfile b/docker/images/kuzzle/Dockerfile index 6bdcd49dee..6a6280d03d 100644 --- a/docker/images/kuzzle/Dockerfile +++ b/docker/images/kuzzle/Dockerfile @@ -1,7 +1,7 @@ ################################################################################ # Production build image ################################################################################ -FROM node:16-bullseye-slim as builder +FROM node:18-bullseye-slim as builder RUN set -x \ && apt-get update \ @@ -45,7 +45,7 @@ RUN set -x \ ################################################################################ # Production build 2 image ################################################################################ -FROM node:16-bullseye-slim as minifier +FROM node:18-bullseye-slim as minifier ENV NODE_ENV=production diff --git a/docker/images/kuzzle/README.md b/docker/images/kuzzle/README.md index a252aeb080..a84eca7004 100644 --- a/docker/images/kuzzle/README.md +++ b/docker/images/kuzzle/README.md @@ -10,7 +10,7 @@ You should use this image as a base build your own application: ```dockerfile # Build image -FROM node:12.18.1-alpine3.11 as builder +FROM node:18-bullseye-slim as builder ADD . /your-plugin-name diff --git a/docker/images/plugin-dev/Dockerfile b/docker/images/plugin-dev/Dockerfile index 61dff0ab07..1d3227047b 100644 --- a/docker/images/plugin-dev/Dockerfile +++ b/docker/images/plugin-dev/Dockerfile @@ -1,7 +1,7 @@ ################################################################################ # Plugin development build image ################################################################################ -FROM node:16-bullseye-slim as builder +FROM node:18-bullseye-slim as builder RUN set -x \ && apt-get update && apt-get install -y \ diff --git a/docker/images/plugin-dev/README.md b/docker/images/plugin-dev/README.md index f014090baa..3c03681147 100644 --- a/docker/images/plugin-dev/README.md +++ b/docker/images/plugin-dev/README.md @@ -18,6 +18,7 @@ version: '3' services: kuzzle: image: kuzzleio/plugin-dev:2 + container_name: kuzzle_node volumes: - ".:/var/app/plugins/enabled/your-plugin-name" cap_add: @@ -40,12 +41,33 @@ services: - DEBUG=kuzzle:plugins # Customize here - KUZZLE_PLUGIN_NAME=your-plugin-name + healthcheck: + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthcheck'] + timeout: 1s + interval: 2s + retries: 10 redis: image: redis:6 + container_name: kuzzle_redis + ports: + - '6379:6379' + healthcheck: + test: ['CMD', 'redis-cli', 'ping'] + interval: 1s + timeout: 3s + retries: 30 elasticsearch: image: kuzzleio/elasticsearch:7 + container_name: kuzzle_elasticsearch + ports: + - '9200:9200' + healthcheck: + test: ['CMD', 'curl', '-f', 'http://localhost:9200'] + interval: 2s + timeout: 2s + retries: 10 ulimits: nofile: 65536 ``` diff --git a/docker/scripts/docker-compose.test.yml b/docker/scripts/docker-compose.test.yml index 2c2008c70b..b076010c06 100644 --- a/docker/scripts/docker-compose.test.yml +++ b/docker/scripts/docker-compose.test.yml @@ -37,8 +37,9 @@ x-kuzzle-config: &kuzzle-config - KUZZLE_VAULT_KEY=${KUZZLE_VAULT_KEY:-secret-password} - KUZZLE_SECRETS_FILE=${KUZZLE_SECRETS_FILE:-/var/app/features/fixtures/secrets.enc.json} # 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 @@ -63,7 +64,7 @@ services: - '1883:1883' # Kuzzle MQTT port - '9229:9229' # Debug port healthcheck: - test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthCheck'] + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthcheck'] timeout: 1s interval: 2s retries: 10 @@ -76,7 +77,7 @@ services: - '11883:1883' # Kuzzle MQTT port - '9230:9229' # Debug port healthcheck: - test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthCheck'] + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthcheck'] timeout: 1s interval: 2s retries: 10 @@ -89,7 +90,7 @@ services: - '11884:1883' # Kuzzle MQTT port - '9231:9229' # Debug port healthcheck: - test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthCheck'] + test: ['CMD', 'curl', '-f', 'http://kuzzle:7512/_healthcheck'] timeout: 1s interval: 2s retries: 10 diff --git a/docker/scripts/run-dev.sh b/docker/scripts/run-dev.sh index ec02339803..27cd6ab4f5 100755 --- a/docker/scripts/run-dev.sh +++ b/docker/scripts/run-dev.sh @@ -8,8 +8,8 @@ fi if [ -z "$NODE_VERSION" ]; then - echo "Missing NODE_VERSION, use default $NODE_14_VERSION" - n $NODE_14_VERSION + echo "Missing NODE_VERSION, use default $NODE_18_VERSION" + n $NODE_18_VERSION fi if [ -n "$TRAVIS" ] || [ -n "$REBUILD" ]; then diff --git a/docker/scripts/run-test.sh b/docker/scripts/run-test.sh index 2a1d016ae3..7a5da62d82 100755 --- a/docker/scripts/run-test.sh +++ b/docker/scripts/run-test.sh @@ -8,8 +8,8 @@ fi if [ -z "$NODE_VERSION" ]; then - echo "Missing NODE_VERSION, use default $NODE_14_VERSION" - n $NODE_14_VERSION + echo "Missing NODE_VERSION, use default $NODE_18_VERSION" + n $NODE_18_VERSION fi if [ -n "$TRAVIS" ] || [ -n "$REBUILD" ]; then diff --git a/lib/api/httpRoutes.js b/lib/api/httpRoutes.js index d90c1ad432..b4cb4a46ab 100644 --- a/lib/api/httpRoutes.js +++ b/lib/api/httpRoutes.js @@ -447,7 +447,7 @@ const routes = [ { verb: "get", path: "/", controller: "server", action: "info" }, { verb: "get", - path: "/_healthCheck", + path: "/_healthcheck", controller: "server", action: "healthCheck", }, From c15cf43bdd96757634cad764b94a3de8d26cd878 Mon Sep 17 00:00:00 2001 From: rolljee Date: Tue, 19 Sep 2023 15:55:50 +0200 Subject: [PATCH 2/4] Revert change inside httpRoutes.js --- lib/api/httpRoutes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api/httpRoutes.js b/lib/api/httpRoutes.js index b4cb4a46ab..d90c1ad432 100644 --- a/lib/api/httpRoutes.js +++ b/lib/api/httpRoutes.js @@ -447,7 +447,7 @@ const routes = [ { verb: "get", path: "/", controller: "server", action: "info" }, { verb: "get", - path: "/_healthcheck", + path: "/_healthCheck", controller: "server", action: "healthCheck", }, From 7d93449be4bf1098d03bfe82ae08eb363db3ac4e Mon Sep 17 00:00:00 2001 From: rolljee Date: Tue, 19 Sep 2023 17:15:09 +0200 Subject: [PATCH 3/4] Update uWebsocket to his latest version available --- lib/core/network/protocols/httpMessage.js | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/core/network/protocols/httpMessage.js b/lib/core/network/protocols/httpMessage.js index 474a96d85a..9e2dda5618 100644 --- a/lib/core/network/protocols/httpMessage.js +++ b/lib/core/network/protocols/httpMessage.js @@ -33,7 +33,7 @@ class HttpMessage { this.connection = connection; this._content = null; this.ips = connection.ips; - this.query = request.getQuery(); + this.query = request.getQuery() || ""; this.path = request.getUrl(); if (this.query.length > 0) { diff --git a/package-lock.json b/package-lock.json index d0b94b938f..eb5788a183 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "semver": "^7.3.8", "sorted-array": "^2.0.4", "uuid": "9.0.1", - "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.23.0.tar.gz", + "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.31.0.tar.gz", "validator": "13.11.0", "winston": "3.10.0", "winston-elasticsearch": "0.17.4", @@ -12729,9 +12729,9 @@ "integrity": "sha512-OdmXxA8rDsQ7YpNVbKSJkNzTw2I+S5WsbMDnCtIWSQaosNAcWtFuI/YK1TjzUI6nbkgiqEyh8gWngfcv8Asd9A==" }, "node_modules/uWebSockets.js": { - "version": "20.23.0", - "resolved": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.23.0.tar.gz", - "integrity": "sha512-8jyrk0YF8P5LtfWcP1cdmbaL0tlPk4i24Y9+J9stOie+nrP6XCjZUb5knJoi0JgDZqWZDewx3EEuyttagSRDuQ==" + "version": "20.31.0", + "resolved": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.31.0.tar.gz", + "integrity": "sha512-GMOdHCHYahydO5pUJ6z0VzV9SnuJnmR1qCHjjqv1kDnqi9rOW1OBXa8HBlhd7N35/yuerHM/xd8d2te8FuLNhA==" }, "node_modules/v8-compile-cache": { "version": "2.4.0", diff --git a/package.json b/package.json index 369f4b354d..90b579f7b6 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "semver": "^7.3.8", "sorted-array": "^2.0.4", "uuid": "9.0.1", - "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.23.0.tar.gz", + "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.31.0.tar.gz", "validator": "13.11.0", "winston": "3.10.0", "winston-elasticsearch": "0.17.4", From 0a503d556fb1a584effcc4d4ca44c34ddde3eee7 Mon Sep 17 00:00:00 2001 From: rolljee Date: Wed, 20 Sep 2023 17:25:49 +0200 Subject: [PATCH 4/4] Release 2.26.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb5788a183..1f5e453466 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kuzzle", - "version": "2.26.1", + "version": "2.26.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kuzzle", - "version": "2.26.1", + "version": "2.26.2", "license": "Apache-2.0", "dependencies": { "@elastic/elasticsearch": "https://github.com/elastic/elasticsearch-js/archive/refs/tags/v7.13.0.tar.gz", diff --git a/package.json b/package.json index 90b579f7b6..58ead608f5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kuzzle", "author": "The Kuzzle Team ", - "version": "2.26.1", + "version": "2.26.2", "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": {