ClickOnce Fix
Ylian Saint-Hilaire committed
Dec 11, 2018 at 17:52 UTC
f1a28c0e862ae394c0524a6a654353d9e5b0bad0
10 files changed
+38
-22
meshrelay.js
+9
-3
@@ -177,19 +177,25 @@ module.exports.CreateMeshRelay = function (parent, ws, req, domain, user, cookie
177
}
178
}
179
180
- ws.flushSink = function () { try { ws._socket.resume(); } catch (e) { } };
180
+ ws.flushSink = function () { try { ws._socket.resume(); } catch (ex) { console.log(ex); } };
181
182
// When data is received from the mesh relay web socket
183
ws.on('message', function (data) {
184
//console.log(typeof data, data.length);
185
if (this.peer != null) {
186
//if (typeof data == 'string') { console.log('Relay: ' + data); } else { console.log('Relay:' + data.length + ' byte(s)'); }
187
- try { this._socket.pause(); this.peer.send(data, ws.flushSink); } catch (e) { }
187
+ try {
188
+ this._socket.pause();
189
+ this.peer.send(data, ws.flushSink);
190
+ } catch (ex) { console.log(ex); }
191
}
192
});
193
194
// If error, do nothing
192
- ws.on('error', function (err) { /*console.log('Relay Error: ' + err);*/ });
195
+ ws.on('error', function (err) {
196
+ console.log('Relay Error', err);
197
+ obj.close();
198
+ });
199
200
// If the mesh relay web socket is closed
201
ws.on('close', function (req) {
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.2.4-e",
3
+ "version": "0.2.4-g",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_22/MeshMiniRouter.application
renamed
+4
-4
@@ -1,20 +1,20 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
3
- <assemblyIdentity name="MeshMiniRouter.application" version="2.0.0.19" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
3
+ <assemblyIdentity name="MeshMiniRouter.application" version="2.0.0.22" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
4
<description asmv2:publisher="Meshcentral.com" asmv2:product="MeshCentral Mini-Router" asmv2:supportUrl="https://meshcentral.com/" xmlns="urn:schemas-microsoft-com:asm.v1" />
5
<deployment install="false" mapFileExtensions="true" trustURLParameters="true" />
6
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
7
<framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
8
</compatibleFrameworks>
9
<dependency>
10
- <dependentAssembly dependencyType="install" codebase="Application Files\MeshMiniRouter_2_0_0_19\MeshMiniRouter.exe.manifest" size="4712">
11
- <assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.19" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
10
+ <dependentAssembly dependencyType="install" codebase="Application Files\MeshMiniRouter_2_0_0_22\MeshMiniRouter.exe.manifest" size="4712">
11
+ <assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.22" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
12
<hash>
13
<dsig:Transforms>
14
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
15
</dsig:Transforms>
16
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
17
- <dsig:DigestValue>OrVnTQLTKIxVLZNkTlIIvRGSS1WhevCMECD0a58kSYI=</dsig:DigestValue>
17
+ <dsig:DigestValue>WOFMexmFiT1cRB5ZPY6zmeQ7x/Cbx//7QyPjwnjKGnA=</dsig:DigestValue>
18
</hash>
19
</dependentAssembly>
20
</dependency>
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_22/MeshMiniRouter.exe.config.deploy
renamed
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_22/MeshMiniRouter.exe.deploy
renamed
Binary files a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_19/MeshMiniRouter.exe.deploy and b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_22/MeshMiniRouter.exe.deploy differ
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_22/MeshMiniRouter.exe.manifest
renamed
+5
-5
@@ -1,10 +1,10 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
3
- <asmv1:assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.19" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
3
+ <asmv1:assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.22" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
4
<description asmv2:iconFile="MeshMiniRouter.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
5
<application />
6
<entryPoint>
7
- <assemblyIdentity name="MeshMiniRouter" version="1.0.6913.24939" language="neutral" processorArchitecture="msil" />
7
+ <assemblyIdentity name="MeshMiniRouter" version="1.0.6919.31937" language="neutral" processorArchitecture="msil" />
8
<commandLine file="MeshMiniRouter.exe" parameters="" />
9
</entryPoint>
10
<trustInfo>
@@ -43,14 +43,14 @@
43
</dependentAssembly>
44
</dependency>
45
<dependency>
46
- <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MeshMiniRouter.exe" size="186368">
47
- <assemblyIdentity name="MeshMiniRouter" version="1.0.6913.24939" language="neutral" processorArchitecture="msil" />
46
+ <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MeshMiniRouter.exe" size="186880">
47
+ <assemblyIdentity name="MeshMiniRouter" version="1.0.6919.31937" language="neutral" processorArchitecture="msil" />
48
<hash>
49
<dsig:Transforms>
50
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
51
</dsig:Transforms>
52
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
53
- <dsig:DigestValue>06I3GLTLWQ3HjlpCbxpboVtNzeTJZ6nWgSqw191sAuE=</dsig:DigestValue>
53
+ <dsig:DigestValue>e/EE2UyAOSDkWCqJcDJPIiu7cOLRXJszqGGnayICf5I=</dsig:DigestValue>
54
</hash>
55
</dependentAssembly>
56
</dependency>
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_22/MeshMiniRouter.ico.deploy
renamed
public/clickonce/minirouter/MeshMiniRouter.application
+4
-4
@@ -1,20 +1,20 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
3
- <assemblyIdentity name="MeshMiniRouter.application" version="2.0.0.19" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
3
+ <assemblyIdentity name="MeshMiniRouter.application" version="2.0.0.22" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
4
<description asmv2:publisher="Meshcentral.com" asmv2:product="MeshCentral Mini-Router" asmv2:supportUrl="https://meshcentral.com/" xmlns="urn:schemas-microsoft-com:asm.v1" />
5
<deployment install="false" mapFileExtensions="true" trustURLParameters="true" />
6
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
7
<framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
8
</compatibleFrameworks>
9
<dependency>
10
- <dependentAssembly dependencyType="install" codebase="Application Files\MeshMiniRouter_2_0_0_19\MeshMiniRouter.exe.manifest" size="4712">
11
- <assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.19" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
10
+ <dependentAssembly dependencyType="install" codebase="Application Files\MeshMiniRouter_2_0_0_22\MeshMiniRouter.exe.manifest" size="4712">
11
+ <assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.22" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
12
<hash>
13
<dsig:Transforms>
14
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
15
</dsig:Transforms>
16
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
17
- <dsig:DigestValue>OrVnTQLTKIxVLZNkTlIIvRGSS1WhevCMECD0a58kSYI=</dsig:DigestValue>
17
+ <dsig:DigestValue>WOFMexmFiT1cRB5ZPY6zmeQ7x/Cbx//7QyPjwnjKGnA=</dsig:DigestValue>
18
</hash>
19
</dependentAssembly>
20
</dependency>
public/clickonce/minirouter/publish.htm
+1
-1
@@ -59,7 +59,7 @@ FONT.key {font-weight: bold; color: darkgreen}
59
<TR><TD ALIGN="LEFT"><TABLE CELLPADDING="2" CELLSPACING="0" BORDER="0" WIDTH="540"><TR><TD WIDTH="496">
60
61
<!-- Begin AppInfo -->
62
-<TABLE><TR><TD COLSPAN="3"> </TD></TR><TR><TD><B>Name:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>MeshCentral Mini-Router</TD></TR><TR><TD COLSPAN="3"> </TD></TR><TR><TD><B>Version:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>2.0.0.19</TD></TR><TR><TD COLSPAN="3"> </TD></TR><TR><TD><B>Publisher:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>Meshcentral.com</TD></TR><tr><td colspan="3"> </td></tr></TABLE>
62
+<TABLE><TR><TD COLSPAN="3"> </TD></TR><TR><TD><B>Name:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>MeshCentral Mini-Router</TD></TR><TR><TD COLSPAN="3"> </TD></TR><TR><TD><B>Version:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>2.0.0.22</TD></TR><TR><TD COLSPAN="3"> </TD></TR><TR><TD><B>Publisher:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>Meshcentral.com</TD></TR><tr><td colspan="3"> </td></tr></TABLE>
63
<!-- End AppInfo -->
64
65
webserver.js
+14
-4
@@ -161,7 +161,14 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
161
for (i in obj.certificates.dns) { if (obj.parent.config.domains[i].dns != null) { obj.dnsDomains[obj.parent.config.domains[i].dns.toLowerCase()] = obj.parent.config.domains[i]; obj.tlsSniCredentials[obj.parent.config.domains[i].dns] = obj.tls.createSecureContext(obj.certificates.dns[i]).context; dnscount++; } }
162
if (dnscount > 0) { obj.tlsSniCredentials[''] = obj.tls.createSecureContext({ cert: obj.certificates.web.cert, key: obj.certificates.web.key, ca: obj.certificates.web.ca }).context; } else { obj.tlsSniCredentials = null; }
163
}
164
- function TlsSniCallback(name, cb) { var c = obj.tlsSniCredentials[name]; if (c != null) { cb(null, c); } else { cb(null, obj.tlsSniCredentials['']); } }
164
+ function TlsSniCallback(name, cb) {
165
+ var c = obj.tlsSniCredentials[name];
166
+ if (c != null) {
167
+ cb(null, c);
168
+ } else {
169
+ cb(null, obj.tlsSniCredentials['']);
170
+ }
171
+ }
172
173
function EscapeHtml(x) { if (typeof x == "string") return x.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<').replace(/"/g, '"').replace(/'/g, '''); if (typeof x == "boolean") return x; if (typeof x == "number") return x; }
174
//function EscapeHtmlBreaks(x) { if (typeof x == "string") return x.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<').replace(/"/g, '"').replace(/'/g, ''').replace(/\r/g, '<br />').replace(/\n/g, '').replace(/\t/g, ' '); if (typeof x == "boolean") return x; if (typeof x == "number") return x; }
@@ -174,6 +181,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
181
var tlsOptions = { cert: obj.certificates.web.cert, key: obj.certificates.web.key, ca: obj.certificates.web.ca, rejectUnauthorized: true, secureOptions: obj.constants.SSL_OP_NO_SSLv2 | obj.constants.SSL_OP_NO_SSLv3 | obj.constants.SSL_OP_NO_COMPRESSION | obj.constants.SSL_OP_CIPHER_SERVER_PREFERENCE | obj.constants.SSL_OP_NO_TLSv1 | obj.constants.SSL_OP_NO_TLSv11 };
182
if (obj.tlsSniCredentials != null) { tlsOptions.SNICallback = TlsSniCallback; } // We have multiple web server certificate used depending on the domain name
183
obj.tlsServer = require('https').createServer(tlsOptions, obj.app);
184
+ obj.tlsServer.on('secureConnection', function () { });
185
+ obj.tlsServer.on('error', function (a, b, c) { console.log('tlsServer error', a, b, c); });
186
obj.expressWs = require('express-ws')(obj.app, obj.tlsServer);
187
}
188
@@ -279,9 +288,10 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
288
function checkUserIpAddressEx(req, res, allowedIpList) {
289
if (allowedIpList == null) { return true; }
290
try {
282
- var ip = req.ip, type = 0;
283
- if (req.connection) { type = 1; } // HTTP(S) request
284
- else if (req._socket) { type = 2; } // WebSocket request
291
+ var ip, type = 0;
292
+ if (req.connection) { type = 1; ip = req.ip; } // HTTP(S) request
293
+ else if (req._socket) { type = 2; ip = req._socket.remoteAddress; } // WebSocket request
294
+ if (!ip) return false;
295
if (ip.startsWith('::ffff:')) { ip = ip.substring(7); } // Fix IPv4 IP's encoded in IPv6 form
296
if ((ip != null) && (allowedIpList.indexOf(ip) >= 0)) { return true; }
297
if (type == 1) { res.sendStatus(401); }