From 70e158afbdc85614293599c95de864949fca390f Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 30 Jun 2022 19:55:24 -0700 Subject: [PATCH] You can now change HTTP and HTTPS ports, #4172 --- meshuser.js | 16 +++++++++++++++ views/default.handlebars | 44 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/meshuser.js b/meshuser.js index 12560ab4..aa2fe965 100644 --- a/meshuser.js +++ b/meshuser.js @@ -3026,6 +3026,22 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use } } + if ((typeof command.httpport == 'number') && (command.httpport > 0) && (command.httpport < 65536)) { + if ((command.httpport == 80) && (node.httpport != null)) { + delete node.httpport; change = 1; changes.push('httpport'); // Delete the HTTP port + } else { + node.httpport = command.httpport; change = 1; changes.push('httpport'); // Set the HTTP port + } + } + + if ((typeof command.httpsport == 'number') && (command.httpsport > 0) && (command.httpsport < 65536)) { + if ((command.httpsport == 443) && (node.httpsport != null)) { + delete node.httpsport; change = 1; changes.push('httpsport'); // Delete the HTTPS port + } else { + node.httpsport = command.httpsport; change = 1; changes.push('httpsport'); // Set the HTTPS port + } + } + if ((typeof command.ssh == 'number') && (command.ssh == 0)) { if ((node.ssh != null) && (node.ssh[user._id] != null)) { delete node.ssh[user._id]; change = 1; changes.push('ssh'); } // Delete the SSH cendentials } diff --git a/views/default.handlebars b/views/default.handlebars index 07876c20..3a206ab3 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -112,6 +112,12 @@ + +