From 4fc921c14f0ae9d3281d73925064ed48586c7e59 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Sun, 18 May 2025 17:01:14 +0100 Subject: [PATCH] upgrade mongodb+image-size, fix package installs again, stop docker installing translate packages Signed-off-by: Simon Smith --- docker/Dockerfile | 5 +++-- meshcentral.js | 8 +++++--- package-lock.json | 10 +++++----- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 67b0e6ec..279da057 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -30,6 +30,7 @@ RUN if [ -z "$DISABLE_MINIFY" ]; then cd meshcentral/translate && node translate RUN if [ -z "$DISABLE_TRANSLATE" ]; then cd meshcentral/translate && node translate.js translateall; fi # cleanup +RUN if [ -z "$DISABLE_MINIFY" ] || [ -z "$DISABLE_TRANSLATE" ]; then cd meshcentral && npm remove html-minifier jsdom esprima; fi RUN rm -rf /opt/meshcentral/meshcentral/docker RUN rm -rf /opt/meshcentral/meshcentral/node_modules @@ -88,8 +89,8 @@ COPY ./docker/config.json.template /opt/meshcentral/config.json.template RUN cd meshcentral && npm install # NOTE: ALL MODULES MUST HAVE A VERSION NUMBER AND THE VERSION MUST MATCH THAT USED IN meshcentral.js mainStart() -RUN if ! [ -z "$INCLUDE_MONGODBTOOLS" ]; then cd meshcentral && npm install mongodb@4.13.0 saslprep@1.0.3; fi -RUN if ! [ -z "$PREINSTALL_LIBS" ] && [ "$PREINSTALL_LIBS" == "true" ]; then cd meshcentral && npm install ssh2@1.16.0 semver@7.5.4 nodemailer@6.9.15 image-size@1.1.1 wildleek@2.0.0 otplib@12.0.1 yubikeyotp@0.2.0; fi +RUN if ! [ -z "$INCLUDE_MONGODBTOOLS" ]; then cd meshcentral && npm install mongodb@4.17.2; fi +RUN if ! [ -z "$PREINSTALL_LIBS" ] && [ "$PREINSTALL_LIBS" == "true" ]; then cd meshcentral && npm install ssh2@1.16.0 semver@7.5.4 nodemailer@6.9.15 image-size@1.2.1 wildleek@2.0.0 otplib@12.0.1 yubikeyotp@0.2.0; fi EXPOSE 80 443 4433 diff --git a/meshcentral.js b/meshcentral.js index 5665b727..2238a182 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -4103,6 +4103,8 @@ function InstallModules(modules, args, func) { // If the module is not installed, but we get the ERR_PACKAGE_PATH_NOT_EXPORTED error, try a second way. if ((versionMatch == false) && (modulePath != null)) { if (JSON.parse(require('fs').readFileSync(modulePath, 'utf8')).version != moduleVersion) { throw new Error(); } + } else if (versionMatch == false) { + throw new Error(); } } else { // For all other modules, do the check here. @@ -4292,12 +4294,12 @@ function mainStart() { if (passport != null) { modules.push(...passport); } if (captcha == true) { modules.push('svg-captcha@1.4.0'); } - if (sessionRecording == true) { modules.push('image-size@1.1.1'); } // Need to get the remote desktop JPEG sizes to index the recodring file. + if (sessionRecording == true) { modules.push('image-size@1.2.1'); } // Need to get the remote desktop JPEG sizes to index the recodring file. if (config.letsencrypt != null) { modules.push('acme-client@4.2.5'); } // Add acme-client module. We need to force v4.2.4 or higher since olver versions using SHA-1 which is no longer supported by Let's Encrypt. if (config.settings.mqtt != null) { modules.push('aedes@0.39.0'); } // Add MQTT Modules if (config.settings.mysql != null) { modules.push('mysql2@3.11.4'); } // Add MySQL. //if (config.settings.mysql != null) { modules.push('@mysql/xdevapi@8.0.33'); } // Add MySQL, official driver (https://dev.mysql.com/doc/dev/connector-nodejs/8.0/) - if (config.settings.mongodb != null) { modules.push('mongodb@4.13.0'); modules.push('saslprep@1.0.3'); } // Add MongoDB, official driver. + if (config.settings.mongodb != null) { modules.push('mongodb@4.17.2'); } // Add MongoDB, official driver. 4.17.0 and above now includes saslprep by default https://github.com/mongodb/node-mongodb-native/releases/tag/v4.17.0 if (config.settings.postgres != null) { modules.push('pg@8.14.1') } // Add Postgres, official driver. if (config.settings.mariadb != null) { modules.push('mariadb@3.4.0'); } // Add MariaDB, official driver. if (config.settings.acebase != null) { modules.push('acebase@1.29.5'); } // Add AceBase, official driver. @@ -4336,7 +4338,7 @@ function mainStart() { } // Desktop multiplexor support - if (config.settings.desktopmultiplex === true) { modules.push('image-size@1.1.1'); } + if (config.settings.desktopmultiplex === true) { modules.push('image-size@1.2.1'); } // SMS support if (config.sms != null) { diff --git a/package-lock.json b/package-lock.json index 57387292..92a64821 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "meshcentral", - "version": "1.1.42", + "version": "1.1.44", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "meshcentral", - "version": "1.1.42", + "version": "1.1.44", "license": "Apache-2.0", "dependencies": { "@seald-io/nedb": "4.0.4", @@ -238,9 +238,9 @@ "license": "MIT" }, "node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.0.tgz", + "integrity": "sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA==", "license": "MIT", "engines": { "node": "*"