From 66842d53c9e302e98e219757afac86bd0bda324d Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 2 Nov 2021 21:53:23 -0700 Subject: [PATCH] MeshCMD route error handling. --- agents/meshcmd.js | 1 + meshcentral.js | 2 +- package.json | 18 ++---------------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/agents/meshcmd.js b/agents/meshcmd.js index 775b7445..2fae4b10 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -2050,6 +2050,7 @@ function startRouter() { settings.websocket = http.request(options); settings.websocket.upgrade = OnServerWebSocket; settings.websocket.on('error', function (ex) { console.log("Unable to connect to server: " + JSON.stringify(ex)); process.exit(1); return; }); + settings.websocket.on('response', function (rsp) { console.log("Unable to connect to server: " + rsp.statusMessage + " (" + rsp.statusCode + ")"); process.exit(1); return; }); settings.websocket.end(); } diff --git a/meshcentral.js b/meshcentral.js index d61fa0a7..1ae0eb43 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -3344,7 +3344,7 @@ function mainStart() { if (config.settings.postgres != null) { modules.push('pg@8.7.1'); modules.push('pgtools@0.3.2'); } // Add Postgres, Postgres driver. if (config.settings.mariadb != null) { modules.push('mariadb'); } // Add MariaDB, official driver. if (config.settings.vault != null) { modules.push('node-vault'); } // Add official HashiCorp's Vault module. - if (config.settings.plugins != null) { modules.push('semver'); } // Required for version compat testing and update checks + if (config.settings.plugins != null) { modules.push('semver'); } // Required for version compat testing and update checks if ((config.settings.plugins != null) && (config.settings.plugins.proxy != null)) { modules.push('https-proxy-agent'); } // Required for HTTP/HTTPS proxy support else if (config.settings.xmongodb != null) { modules.push('mongojs'); } // Add MongoJS, old driver. if (nodemailer || (config.smtp != null)) { modules.push('nodemailer'); } // Add SMTP support diff --git a/package.json b/package.json index 756dc7d1..c6187662 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,6 @@ "sample-config-advanced.json" ], "dependencies": { - "@yetzt/nedb": "^1.8.0", - "archiver": "^4.0.2", - "archiver-zip-encrypted": "^1.0.10", "body-parser": "^1.19.0", "cbor": "~5.2.0", "compression": "^1.7.4", @@ -46,24 +43,13 @@ "express": "^4.17.0", "express-handlebars": "^3.1.0", "express-ws": "^4.0.0", - "image-size": "^1.0.0", "ipcheck": "^0.1.0", - "loadavg-windows": "^1.1.1", "minimist": "^1.2.5", - "mongodb": "^4.1.0", "multiparty": "^4.2.1", + "@yetzt/nedb": "^1.8.0", "node-forge": "^0.10.0", - "node-rdpjs-2": "^0.3.5", - "node-windows": "^0.1.4", - "otplib": "^10.2.3", - "pg": "^8.7.1", - "pgtools": "^0.3.2", - "saslprep": "^1.0.3", - "ssh2": "^1.5.0", - "web-push": "^3.4.5", "ws": "^5.2.3", - "yauzl": "^2.10.0", - "yubikeyotp": "^0.2.0" + "yauzl": "^2.10.0" }, "repository": { "type": "git",