From 1fbbc6caaaf95e09044a67335e0810a63dd6aec0 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 17 Jun 2022 09:22:10 -0700 Subject: [PATCH] Fixed agent locking url when AgentAliasDNS is used. --- meshcentral.js | 4 +++- package.json | 17 ++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/meshcentral.js b/meshcentral.js index 8043ff2e..7dff6013 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -2865,7 +2865,9 @@ function CreateMeshCentralServer(config, args) { serverSignedAgentsPath = obj.path.join(obj.datapath, 'signedagents' + suffix); signDesc = (domain.title ? domain.title : agentSignCertInfo.cert.subject.hash); var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified - signUrl = 'https://' + ((domain.dns != null) ? domain.dns : obj.certificates.CommonName); + var httpsHost = ((domain.dns != null) ? domain.dns : obj.certificates.CommonName); + if (obj.args.agentaliasdns != null) { httpsHost = obj.args.agentaliasdns; } + signUrl = 'https://' + httpsHost; if (httpsPort != 443) { signUrl += ':' + httpsPort; } var xdomain = (domain.dns == null) ? domain.id : ''; if (xdomain != '') xdomain += '/'; diff --git a/package.json b/package.json index a83e8219..5753a7d6 100644 --- a/package.json +++ b/package.json @@ -37,34 +37,21 @@ "sample-config-advanced.json" ], "dependencies": { - "@yetzt/nedb": "^1.8.0", "archiver": "^5.3.1", "body-parser": "^1.19.0", "cbor": "~5.2.0", "compression": "^1.7.4", "cookie-session": "^1.4.0", - "esprima": "^4.0.1", "express": "^4.17.0", "express-handlebars": "^5.3.5", "express-ws": "^4.0.0", - "html-minifier": "^4.0.0", - "image-size": "^1.0.1", "ipcheck": "^0.1.0", - "jsdom": "^19.0.0", - "loadavg-windows": "^1.1.1", - "minify-js": "^0.0.4", "minimist": "^1.2.5", "multiparty": "^4.2.1", + "@yetzt/nedb": "^1.8.0", "node-forge": "^1.0.0", - "node-windows": "^0.1.4", - "nodemailer": "^6.7.5", - "otplib": "^10.2.3", - "pg": "^8.7.1", - "pgtools": "^0.3.2", - "web-push": "^3.5.0", "ws": "^5.2.3", - "yauzl": "^2.10.0", - "yubikeyotp": "^0.2.0" + "yauzl": "^2.10.0" }, "engines": { "node": ">=10.0.0"