fix agentaliasdns display (#5518)

Simon Smith committed Nov 7, 2023 at 00:10 UTC b7385e382c6be3ffcac8f44051fabb3e31a37692
1 file changed +3 -1
webserver.js
+3 -1
@@ -7829,12 +7829,14 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
7829 function StartAltWebServer(port, addr) {
7830 if ((port < 1) || (port > 65535)) return;
7831 var agentAliasPort = null;
7832 + var agentAliasDns = null;
7833 if (args.agentaliasport != null) { agentAliasPort = args.agentaliasport; }
7834 + if (args.agentaliasdns != null) { agentAliasDns = args.agentaliasdns; }
7835 if (obj.tlsAltServer != null) {
7836 if (obj.args.lanonly == true) {
7837 obj.tcpAltServer = obj.tlsAltServer.listen(port, addr, function () { console.log('MeshCentral HTTPS agent-only server running on port ' + port + ((agentAliasPort != null) ? (', alias port ' + agentAliasPort) : '') + '.'); });
7838 } else {
7837 - obj.tcpAltServer = obj.tlsAltServer.listen(port, addr, function () { console.log('MeshCentral HTTPS agent-only server running on ' + certificates.CommonName + ':' + port + ((agentAliasPort != null) ? (', alias port ' + agentAliasPort) : '') + '.'); });
7839 + obj.tcpAltServer = obj.tlsAltServer.listen(port, addr, function () { console.log('MeshCentral HTTPS agent-only server running on ' + ((agentAliasDns != null) ? agentAliasDns : certificates.CommonName) + ':' + port + ((agentAliasPort != null) ? (', alias port ' + agentAliasPort) : '') + '.'); });
7840 }
7841 obj.parent.authLog('https', 'Server listening on 0.0.0.0 port ' + port + '.');
7842 obj.parent.updateServerState('https-agent-port', port);