Fixed RedirTrace.
Ylian Saint-Hilaire committed
Dec 16, 2019 at 17:20 UTC
f2f23aafb0bf77202531a750e8304918409be6a6
9 files changed
+15
-14
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.4.5-v",
3
+ "version": "0.4.5-w",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",
public/scripts/agent-redir-ws-0.1.1.js
+5
-4
@@ -69,6 +69,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
69
try { controlMsg = JSON.parse(msg); } catch (e) { return; }
70
if (controlMsg.ctrlChannel != '102938') { obj.xxOnSocketData(msg); return; }
71
//console.log(controlMsg);
72
+ if ((typeof args != 'undefined') && args.redirtrace) { console.log('RedirRecv', controlMsg); }
73
if (controlMsg.type == 'console') {
74
obj.consoleMessage = controlMsg.msg;
75
if (obj.onConsoleMessageChange) { obj.onConsoleMessageChange(obj, obj.consoleMessage); }
@@ -102,7 +103,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
103
if (obj.State < 3) {
104
if ((e.data == 'c') || (e.data == 'cr')) {
105
if (e.data == 'cr') { obj.serverIsRecording = true; }
105
- if (obj.options != null) { delete obj.options.action; obj.options.type = 'options'; try { obj.socket.send(JSON.stringify(obj.options)); } catch (ex) { } }
106
+ if (obj.options != null) { delete obj.options.action; obj.options.type = 'options'; try { obj.sendCtrlMsg(JSON.stringify(obj.options)); } catch (ex) { } }
107
try { obj.socket.send(obj.protocol); } catch (ex) { }
108
obj.xxStateChange(3);
109
@@ -119,7 +120,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
120
obj.webchannel.onclose = function (event) { if (obj.webRtcActive) { obj.Stop(); } }
121
obj.webrtc.onicecandidate = function (e) {
122
if (e.candidate == null) {
122
- try { obj.socket.send(JSON.stringify(obj.webrtcoffer)); } catch (ex) { } // End of candidates, send the offer
123
+ try { obj.sendCtrlMsg(JSON.stringify(obj.webrtcoffer)); } catch (ex) { } // End of candidates, send the offer
124
} else {
125
obj.webrtcoffer.sdp += ("a=" + e.candidate.candidate + "\r\n"); // New candidate, add it to the SDP
126
}
@@ -215,7 +216,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
216
}
217
else if (typeof data !== 'string') return;
218
//console.log("xxOnSocketData", rstr2hex(data));
218
- if ((typeof args != 'undefined') && args.redirtrace) { console.log("RedirRecv", typeof data, data.length, data); }
219
+ if ((typeof args != 'undefined') && args.redirtrace) { console.log('RedirRecv', typeof data, data.length, (data[0] == '{')?data:rstr2hex(data).substring(0, 64)); }
220
return obj.m.ProcessData(data);
221
}
222
@@ -227,7 +228,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
228
obj.send = function (x) {
229
//obj.debug("Agent Redir Send(" + obj.webRtcActive + ", " + x.length + "): " + rstr2hex(x));
230
//console.log("Agent Redir Send(" + obj.webRtcActive + ", " + x.length + "): " + ((typeof x == 'string')?x:rstr2hex(x)));
230
- if ((typeof args != 'undefined') && args.redirtrace) { console.log('RedirSend', typeof x, x.length, x); }
231
+ if ((typeof args != 'undefined') && args.redirtrace) { console.log('RedirSend', typeof x, x.length, (x[0] == '{') ? x : rstr2hex(x).substring(0, 64)); }
232
try {
233
if (obj.socket != null && obj.socket.readyState == WebSocket.OPEN) {
234
if (typeof x == 'string') {
public/styles/style.css
+2
-2
@@ -134,8 +134,8 @@ body {
134
float: left;
135
height: 66px;
136
color: #c8c8c8;
137
- padding-left: 20px;
138
- padding-top: 8px;
137
+ padding-left: 14px;
138
+ padding-top: 7px;
139
font-size: 46px;
140
font-family: Arial,Helvetica,sans-serif;
141
font-weight: bold;
views/agentinvite.handlebars
+1
-1
@@ -48,7 +48,7 @@
48
<!-- Begin Masthead -->
49
<div id="masthead" class=noselect style="background:url(logo.png) 0px 0px;background-color:#036;background-repeat:no-repeat;height:66px;width:100%;overflow:hidden;">
50
<div style="float:left">{{{titlehtml}}}</div>
51
- <div style="float:left; height: 66px; color:#c8c8c8; padding-left:20px; padding-top:8px">
51
+ <div style="float:left; height: 66px; color:#c8c8c8; padding-left:14px; padding-top:7px">
52
<strong><font style="font-size:46px; font-family: Arial, Helvetica, sans-serif;">{{{title1}}}</font></strong>
53
</div>
54
<div style="float:left; height: 66px; color:#c8c8c8; padding-left:5px; padding-top:14px">
views/download.handlebars
+1
-1
@@ -14,7 +14,7 @@
14
<div id=mastheadx></div>
15
<div id=masthead style="background:url(logo.png) 0px 0px;background-color:#036;background-repeat:no-repeat;height:66px;width:100%;overflow:hidden">
16
<div style="float:left">{{{titlehtml}}}</div>
17
- <div style=float:left;height:66px;color:#c8c8c8;padding-left:20px;padding-top:8px>
17
+ <div style=float:left;height:66px;color:#c8c8c8;padding-left:14px;padding-top:7px>
18
<strong><font style="font-size:46px;font-family:Arial,Helvetica,sans-serif">{{{title1}}}</font></strong>
19
</div>
20
<div style=float:left;height:66px;color:#c8c8c8;padding-left:5px;padding-top:14px>
views/error404.handlebars
+1
-1
@@ -15,7 +15,7 @@
15
<!-- Begin Masthead -->
16
<div id="masthead" class=noselect style="background:url(logo.png) 0px 0px;background-color:#036;background-repeat:no-repeat;height:66px;width:100%;overflow:hidden;">
17
<div style="float:left">{{{titlehtml}}}</div>
18
- <div style="float:left; height: 66px; color:#c8c8c8; padding-left:20px; padding-top:8px">
18
+ <div style="float:left; height: 66px; color:#c8c8c8; padding-left:16px; padding-top:7px">
19
<strong><font style="font-size:46px; font-family: Arial, Helvetica, sans-serif;">{{{title1}}}</font></strong>
20
</div>
21
<div style="float:left; height: 66px; color:#c8c8c8; padding-left:5px; padding-top:14px">
views/message.handlebars
+1
-1
@@ -14,7 +14,7 @@
14
<div id=mastheadx></div>
15
<div id=masthead style="background:url(logo.png) 0px 0px;background-color:#036;background-repeat:no-repeat;height:66px;width:100%;overflow:hidden">
16
<div style="float:left">{{{titlehtml}}}</div>
17
- <div style=float:left;height:66px;color:#c8c8c8;padding-left:20px;padding-top:8px>
17
+ <div style=float:left;height:66px;color:#c8c8c8;padding-left:14px;padding-top:7px>
18
<strong><font style="font-size:46px;font-family:Arial,Helvetica,sans-serif">{{{title1}}}</font></strong>
19
</div>
20
<div style=float:left;height:66px;color:#c8c8c8;padding-left:5px;padding-top:14px>
views/terms.handlebars
+1
-1
@@ -15,7 +15,7 @@
15
<!-- Begin Masthead -->
16
<div id="masthead" class=noselect style="background:url(logo.png) 0px 0px;background-color:#036;background-repeat:no-repeat;height:66px;width:100%;overflow:hidden;">
17
<div style="float:left">{{{titlehtml}}}</div>
18
- <div style="float:left; height: 66px; color:#c8c8c8; padding-left:20px; padding-top:8px">
18
+ <div style="float:left; height: 66px; color:#c8c8c8; padding-left:14px; padding-top:7px">
19
<strong><font style="font-size:46px; font-family: Arial, Helvetica, sans-serif;">{{{title1}}}</font></strong>
20
</div>
21
<div style="float:left; height: 66px; color:#c8c8c8; padding-left:5px; padding-top:14px">
webserver.js
+2
-2
@@ -2338,7 +2338,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2338
chnl.onData = function (ciraconn, data) {
2339
// CIRA ---> TLS
2340
parent.debug('webrelay', 'Relay TLS CIRA data', data.length);
2341
- if (data.length > 0) { try { ser.updateBuffer(Buffer.from(data, 'binary')); } catch (e) { } }
2341
+ if (data.length > 0) { try { ser.updateBuffer(Buffer.from(data, 'binary')); } catch (ex) { console.log(ex); } }
2342
};
2343
2344
// Handle CIRA tunnel state change
@@ -2438,7 +2438,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2438
} else {
2439
// Log to recording file
2440
data = Buffer.from(data, 'binary');
2441
- recordingEntry(ws.logfile.fd, 2, 0, data, function () { try { ws.send(data); } catch (e) { } }); // TODO: Add TLS support
2441
+ recordingEntry(ws.logfile.fd, 2, 0, data, function () { try { ws.send(data); } catch (ex) { console.log(ex); } }); // TODO: Add TLS support
2442
}
2443
}
2444
};