upgrade mongodb+image-size, fix package installs again, stop docker installing translate packages

Signed-off-by: Simon Smith <simonsmith5521@gmail.com>

Simon Smith committed May 18, 2025 at 17:01 UTC 4fc921c14f0ae9d3281d73925064ed48586c7e59
3 files changed +13 -10
docker/Dockerfile
+3 -2
@@ -30,6 +30,7 @@ RUN if [ -z "$DISABLE_MINIFY" ]; then cd meshcentral/translate && node translate
30 RUN if [ -z "$DISABLE_TRANSLATE" ]; then cd meshcentral/translate && node translate.js translateall; fi
31
32 # cleanup
33 +RUN if [ -z "$DISABLE_MINIFY" ] || [ -z "$DISABLE_TRANSLATE" ]; then cd meshcentral && npm remove html-minifier jsdom esprima; fi
34 RUN rm -rf /opt/meshcentral/meshcentral/docker
35 RUN rm -rf /opt/meshcentral/meshcentral/node_modules
36
@@ -88,8 +89,8 @@ COPY ./docker/config.json.template /opt/meshcentral/config.json.template
89 RUN cd meshcentral && npm install
90
91 # NOTE: ALL MODULES MUST HAVE A VERSION NUMBER AND THE VERSION MUST MATCH THAT USED IN meshcentral.js mainStart()
91 -RUN if ! [ -z "$INCLUDE_MONGODBTOOLS" ]; then cd meshcentral && npm install mongodb@4.13.0 saslprep@1.0.3; fi
92 -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
92 +RUN if ! [ -z "$INCLUDE_MONGODBTOOLS" ]; then cd meshcentral && npm install mongodb@4.17.2; fi
93 +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
94
95 EXPOSE 80 443 4433
96
meshcentral.js
+5 -3
@@ -4103,6 +4103,8 @@ function InstallModules(modules, args, func) {
4103 // If the module is not installed, but we get the ERR_PACKAGE_PATH_NOT_EXPORTED error, try a second way.
4104 if ((versionMatch == false) && (modulePath != null)) {
4105 if (JSON.parse(require('fs').readFileSync(modulePath, 'utf8')).version != moduleVersion) { throw new Error(); }
4106 + } else if (versionMatch == false) {
4107 + throw new Error();
4108 }
4109 } else {
4110 // For all other modules, do the check here.
@@ -4292,12 +4294,12 @@ function mainStart() {
4294 if (passport != null) { modules.push(...passport); }
4295 if (captcha == true) { modules.push('svg-captcha@1.4.0'); }
4296
4295 - if (sessionRecording == true) { modules.push('image-size@1.1.1'); } // Need to get the remote desktop JPEG sizes to index the recodring file.
4297 + if (sessionRecording == true) { modules.push('image-size@1.2.1'); } // Need to get the remote desktop JPEG sizes to index the recodring file.
4298 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.
4299 if (config.settings.mqtt != null) { modules.push('aedes@0.39.0'); } // Add MQTT Modules
4300 if (config.settings.mysql != null) { modules.push('mysql2@3.11.4'); } // Add MySQL.
4301 //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/)
4300 - if (config.settings.mongodb != null) { modules.push('mongodb@4.13.0'); modules.push('saslprep@1.0.3'); } // Add MongoDB, official driver.
4302 + 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
4303 if (config.settings.postgres != null) { modules.push('pg@8.14.1') } // Add Postgres, official driver.
4304 if (config.settings.mariadb != null) { modules.push('mariadb@3.4.0'); } // Add MariaDB, official driver.
4305 if (config.settings.acebase != null) { modules.push('acebase@1.29.5'); } // Add AceBase, official driver.
@@ -4336,7 +4338,7 @@ function mainStart() {
4338 }
4339
4340 // Desktop multiplexor support
4339 - if (config.settings.desktopmultiplex === true) { modules.push('image-size@1.1.1'); }
4341 + if (config.settings.desktopmultiplex === true) { modules.push('image-size@1.2.1'); }
4342
4343 // SMS support
4344 if (config.sms != null) {
package-lock.json
+5 -5
@@ -1,12 +1,12 @@
1 {
2 "name": "meshcentral",
3 - "version": "1.1.42",
3 + "version": "1.1.44",
4 "lockfileVersion": 3,
5 "requires": true,
6 "packages": {
7 "": {
8 "name": "meshcentral",
9 - "version": "1.1.42",
9 + "version": "1.1.44",
10 "license": "Apache-2.0",
11 "dependencies": {
12 "@seald-io/nedb": "4.0.4",
@@ -238,9 +238,9 @@
238 "license": "MIT"
239 },
240 "node_modules/bignumber.js": {
241 - "version": "9.1.2",
242 - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz",
243 - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==",
241 + "version": "9.3.0",
242 + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.0.tgz",
243 + "integrity": "sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA==",
244 "license": "MIT",
245 "engines": {
246 "node": "*"