Updated Assistant & Router, fix for multi-domain servers, #2873.
Ylian Saint-Hilaire committed
Jul 8, 2021 at 11:43 UTC
27d76b0d7b4f7f91dfc00b6d78984a6b62e5a76e
5 files changed
+7
-1
agents/MeshCentralAssistant.exe
Binary files a/agents/MeshCentralAssistant.exe and b/agents/MeshCentralAssistant.exe differ
agents/MeshCentralRouter.exe
Binary files a/agents/MeshCentralRouter.exe and b/agents/MeshCentralRouter.exe differ
agents/MeshCmd-signed.exe
Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ
agents/MeshCmd64-signed.exe
Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ
meshagent.js
+7
-1
@@ -1498,8 +1498,14 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1498
if (typeof command.name != 'string') break;
1499
var info = parent.parent.meshToolsBinaries[command.name];
1500
if ((command.hash != null) && (info.hash == command.hash)) return;
1501
+
1502
+ // To build the connection URL, if we are using a sub-domain or one with a DNS, we need to craft the URL correctly.
1503
+ var xdomain = (domain.dns == null) ? domain.id : '';
1504
+ if (xdomain != '') xdomain += '/';
1505
+
1506
+ // Build the response
1507
const responseCmd = { action: 'meshToolInfo', name: command.name, tag: command.tag, sessionid: command.sessionid, hash: info.hash, size: info.size, url: info.url };
1502
- if ((command.name == 'MeshCentralAssistant') && (command.msh == true)) { responseCmd.url = "*/meshagents?id=10006"; } // If this is Assistant and the MSH needs to be included in the executable, change the URL.
1508
+ if ((command.name == 'MeshCentralAssistant') && (command.msh == true)) { responseCmd.url = '*/' + xdomain + 'meshagents?id=10006'; } // If this is Assistant and the MSH needs to be included in the executable, change the URL.
1509
if (command.cookie === true) { responseCmd.url += ('&auth=' + parent.parent.encodeCookie({ download: info.dlname }, parent.parent.loginCookieEncryptionKey)); }
1510
if (command.pipe === true) { responseCmd.pipe = true; }
1511
if (parent.webCertificateHashs[domain.id] != null) { responseCmd.serverhash = Buffer.from(parent.webCertificateHashs[domain.id], 'binary').toString('hex'); }