From bcc2a8607e1bd11a8a064bd3ef53694d76d87fb1 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Mon, 11 Jul 2022 23:26:54 -0700 Subject: [PATCH] Fix for web relay using ports. --- meshcentral.js | 2 +- webrelayserver.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meshcentral.js b/meshcentral.js index 77867e70..1e6de486 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -1654,7 +1654,7 @@ function CreateMeshCentralServer(config, args) { if (obj.common.validateStrArray(obj.args.relaydns, 1) == false) { delete obj.args.relaydns; } // Start the HTTP relay web server if needed - if ((obj.args.relaydns != null) && (typeof obj.args.relayport == 'number') && (obj.args.relayport != 0)) { + if ((obj.args.relaydns == null) && (typeof obj.args.relayport == 'number') && (obj.args.relayport != 0)) { obj.webrelayserver = require('./webrelayserver.js').CreateWebRelayServer(obj, obj.db, obj.args, obj.certificates, function () { }); } diff --git a/webrelayserver.js b/webrelayserver.js index 85cd7364..e9f70353 100644 --- a/webrelayserver.js +++ b/webrelayserver.js @@ -63,7 +63,7 @@ module.exports.CreateWebRelayServer = function (parent, db, args, certificates, // Setup a keygrip instance with higher default security, default hash is SHA1, we want to bump that up with SHA384 // If multiple instances of this server are behind a load-balancer, this secret must be the same for all instances // If args.sessionkey is a string, use it as a single key, but args.sessionkey can also be used as an array of keys. - const keygrip = require('keygrip')((typeof obj.args.sessionkey == 'string') ? [obj.args.sessionkey] : obj.args.sessionkey, 'sha384', 'base64'); + const keygrip = require('keygrip')((typeof args.sessionkey == 'string') ? [args.sessionkey] : args.sessionkey, 'sha384', 'base64'); // Setup cookie session const sessionOptions = {