From da45d4f80f7055a7a0e061cd07a1c4a31fce9c10 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Mon, 15 Oct 2018 17:51:03 -0700 Subject: [PATCH] Fixed a ClickOnce exception --- package.json | 2 +- .../MeshMiniRouter.application | 8 +++---- .../MeshMiniRouter.exe.config.deploy | 0 .../MeshMiniRouter.exe.deploy | Bin 186368 -> 186368 bytes .../MeshMiniRouter.exe.manifest | 8 +++---- .../MeshMiniRouter.ico.deploy | Bin .../minirouter/MeshMiniRouter.application | 8 +++---- public/clickonce/minirouter/publish.htm | 2 +- views/default.handlebars | 3 ++- webserver.js | 21 ++++++++++++------ 10 files changed, 30 insertions(+), 22 deletions(-) rename public/clickonce/minirouter/Application Files/{MeshMiniRouter_2_0_0_17 => MeshMiniRouter_2_0_0_18}/MeshMiniRouter.application (85%) rename public/clickonce/minirouter/Application Files/{MeshMiniRouter_2_0_0_17 => MeshMiniRouter_2_0_0_18}/MeshMiniRouter.exe.config.deploy (100%) rename public/clickonce/minirouter/Application Files/{MeshMiniRouter_2_0_0_17 => MeshMiniRouter_2_0_0_18}/MeshMiniRouter.exe.deploy (90%) rename public/clickonce/minirouter/Application Files/{MeshMiniRouter_2_0_0_17 => MeshMiniRouter_2_0_0_18}/MeshMiniRouter.exe.manifest (92%) rename public/clickonce/minirouter/Application Files/{MeshMiniRouter_2_0_0_17 => MeshMiniRouter_2_0_0_18}/MeshMiniRouter.ico.deploy (100%) 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 0d9a434875213fb2e658aa1907fdbd65f189d7ae..431b926e7e89c988377cb97c8b92d831715a2fd5 100644 GIT binary patch delta 3753 zcma)GKaSO!p%RI!BeJ5PR&n@6AWP%IN zxq5{M`d5bkJcw|#9l%!)z#-2EkmTt({L}H=-^t0@3zAOKpiwJ;V86kc^sZi{RHT?d zEPxRqjfe?N)&|XO|G~XFp<0Y{3$UHMm@t=|OYk*b5V8CPEGPsTun*d*V-fcDq8m~{ z$p>*Bn@R~-8gJTdVCueU-vV`koA!DzjZfd1m=x>i$I06P6r4sD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p_Ffj=IN@M8Y%Yz9|*4)uJ8x>$D~wf(Y$8mg+QQR7lH6QgI;LSi2kYYI-$xL z#7N-`nHH7^PitN^CdeN&Mf<{}M9{;tVj@`JWyCPJh!_ojLrj2Mh|3vf!#vunnO(uK zj$s?a^`O-z!e&U(mVpdm(mOB)yS4AYJ{UuM0P&iNV{k@$oqGb6>l}K!@p2MN=rmN) zX=s8@a}r{tc&5ZNB_5SqVi{A)m{P`+UZ(UirI#rOnR1XR2bpr3_rjR`X>*eA3;qUg z5t8v{6427OQK&NQ!&ln{{vhJAfQJ!3;bg>ipeTh>1$c^2G36FV?XzZz0#m+Wcuh+c zNkg+Dm@>*DQyJW<52T0ZoB z$UBAA0>7KShyYv+b&lW#Kka6mP%#-63-}&`pF6d@pr32s82(?Y5iUqS*FM3Q30QPT z!5TTbtzde6+b>ec3OVUPyJahEfMKvh7j(cN{;dSN{Lk?@vP%BtxUIGuJg99%e-FlW zVAKXw?D!MH4#iLg)ifT6zXP!bT#P{gWtI5cDPAy9UIqD32Ng#iy3e@p52xNZ@@iD+ z^!(zB#}@1K(;q!F#cRT~f${@#$n;6MOS4ZpIwKt=?N9i&Ikyh<*VmQ|r+G>wdM#U*R{`pUCvhfB(OZS?lipN!!I4<7!Y zy! - + - + @@ -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); } }