diff --git a/package.json b/package.json index 87ca4eed..3207b3a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.2.2-g", + "version": "0.2.2-i", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.application b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.application similarity index 85% rename from public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.application rename to public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.application index 4a987888..ce304f52 100644 --- a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.application +++ b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.application @@ -1,20 +1,20 @@  - + - - + + - nyBHr6mVUVhjU6l4Bmrfa0juzDDrPD6BiiYzVMhKKVA= + MRs3i+wWL3/q3ug0vDLnjcM9sWnwJ7cH8RmaFbWEqBs= diff --git a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.exe.config.deploy b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.config.deploy similarity index 100% rename from public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.exe.config.deploy rename to public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.config.deploy diff --git a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.exe.deploy b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.deploy similarity index 90% rename from public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.exe.deploy rename to public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.deploy index 0d9a4348..431b926e 100644 Binary files a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.exe.deploy and b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.deploy differ diff --git a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.exe.manifest b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.manifest similarity index 92% rename from public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.exe.manifest rename to public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.manifest index 41e8fa6d..a62d2369 100644 --- a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.exe.manifest +++ b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.manifest @@ -1,10 +1,10 @@  - + - + @@ -44,13 +44,13 @@ - + - H+qrBKAsVVx/APIHP2Tq2cK3/FUh4SIShsjM6eo0fUw= + 9CBRw9I6oJzioNiqBO2hWNS8fPrKJs8WKO4N99KM6NY= diff --git a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.ico.deploy b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.ico.deploy similarity index 100% rename from public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.ico.deploy rename to public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.ico.deploy diff --git a/public/clickonce/minirouter/MeshMiniRouter.application b/public/clickonce/minirouter/MeshMiniRouter.application index 4a987888..ce304f52 100644 --- a/public/clickonce/minirouter/MeshMiniRouter.application +++ b/public/clickonce/minirouter/MeshMiniRouter.application @@ -1,20 +1,20 @@  - + - - + + - nyBHr6mVUVhjU6l4Bmrfa0juzDDrPD6BiiYzVMhKKVA= + MRs3i+wWL3/q3ug0vDLnjcM9sWnwJ7cH8RmaFbWEqBs= diff --git a/public/clickonce/minirouter/publish.htm b/public/clickonce/minirouter/publish.htm index 49e4503b..7c4e5986 100644 --- a/public/clickonce/minirouter/publish.htm +++ b/public/clickonce/minirouter/publish.htm @@ -59,7 +59,7 @@ FONT.key {font-weight: bold; color: darkgreen}
-
 
Name:MeshCentral Mini-Router
 
Version:2.0.0.17
 
Publisher:Meshcentral.com
 
+
 
Name:MeshCentral Mini-Router
 
Version:2.0.0.18
 
Publisher:Meshcentral.com
 
diff --git a/views/default.handlebars b/views/default.handlebars index 6f24583f..9f002b53 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -1271,7 +1271,8 @@ case 'getcookie': { if (message.tag == 'clickonce') { var basicPort = "{{{serverRedirPort}}}"==""?"{{{serverPublicPort}}}":"{{{serverRedirPort}}}"; - var rdpurl = "http://" + window.location.hostname + ":" + basicPort + "/clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F" + window.location.hostname + "%2Fmeshrelay.ashx%3Fauth=" + message.cookie + "&CH={{{webcerthash}}}&AP=" + message.protocol + "&HOL=1"; + //var rdpurl = "http://" + window.location.hostname + ":" + basicPort + "/clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F" + window.location.hostname + "%2Fmeshrelay.ashx%3Fauth=" + message.cookie + "&CH={{{webcerthash}}}&AP=" + message.protocol + "&HOL=1"; + var rdpurl = "http://" + window.location.hostname + ":" + basicPort + "/clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F" + window.location.hostname + "%2Fmeshrelay.ashx%3Fauth=" + message.cookie + "&CH={{{webcerthash}}}&AP=" + message.protocol; window.open(rdpurl, '_blank'); } break; diff --git a/webserver.js b/webserver.js index 44577c6c..d9fdf54a 100644 --- a/webserver.js +++ b/webserver.js @@ -1792,10 +1792,10 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { obj.app.post(url + 'uploadmeshcorefile.ashx', handleUploadMeshCoreFile); obj.app.get(url + 'userfiles/*', handleDownloadUserFiles); obj.app.ws(url + 'echo.ashx', handleEchoWebSocket); - obj.app.ws(url + 'meshrelay.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, function (ws1, req1, domain, user, cookie) { obj.meshRelayHandler.CreateMeshRelay(obj, ws1, req1, domain, user, cookie); }); }); + obj.app.ws(url + 'meshrelay.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, true, function (ws1, req1, domain, user, cookie) { obj.meshRelayHandler.CreateMeshRelay(obj, ws1, req1, domain, user, cookie); }); }); obj.app.get(url + 'webrelay.ashx', function (req, res) { res.send('Websocket connection expected'); }); - obj.app.ws(url + 'webrelay.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, handleRelayWebSocket); }); - obj.app.ws(url + 'control.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, function (ws1, req1, domain, user, cookie) { obj.meshUserHandler.CreateMeshUser(obj, obj.db, ws1, req1, obj.args, domain); }); }); + obj.app.ws(url + 'webrelay.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, false, handleRelayWebSocket); }); + obj.app.ws(url + 'control.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, false, function (ws1, req1, domain, user, cookie) { obj.meshUserHandler.CreateMeshUser(obj, obj.db, ws1, req1, obj.args, domain); }); }); // Server picture obj.app.get(url + 'serverpic.ashx', function (req, res) { @@ -1829,7 +1829,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { } // Authenticates a session and forwards - function PerformWSSessionAuth(ws, req, func) { + function PerformWSSessionAuth(ws, req, noAuthOk, func) { try { // Check IP filtering and domain var domain = checkUserIpAddress(ws, req); @@ -1870,9 +1870,16 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { func(ws, req, domain, req.session.userid); return; } - // If not authenticated, close the websocket connection - Debug(1, 'ERR: Websocket no auth'); - try { ws.send(JSON.stringify({ action: 'close', cause: 'noauth' })); ws.close(); } catch (e) { } + + if (noAuthOk != true) { + // If not authenticated, close the websocket connection + Debug(1, 'ERR: Websocket no auth'); + try { ws.send(JSON.stringify({ action: 'close', cause: 'noauth' })); ws.close(); } catch (e) { } + } else { + // Continue this session without user authentication, + // this is expected if the agent is connecting for a tunnel. + func(ws, req, domain, null); + } } catch (e) { console.log(e); } }