Fixed web app error, display stderr on the console.

This commit is contained in:
Ylian Saint-Hilaire 2019-12-03 17:44:08 -08:00
parent 0d662950a6
commit c3bcb6f186
8 changed files with 29 additions and 50 deletions

View File

@ -241,8 +241,21 @@ function CreateMeshCentralServer(config, args) {
} }
} }
}); });
childProcess.stdout.on('data', function (data) { if (data[data.length - 1] == '\n') { data = data.substring(0, data.length - 1); } if (data.indexOf('Updating settings folder...') >= 0) { childProcess.xrestart = 1; } else if (data.indexOf('Updating server certificates...') >= 0) { childProcess.xrestart = 1; } else if (data.indexOf('Server Ctrl-C exit...') >= 0) { childProcess.xrestart = 2; } else if (data.indexOf('Starting self upgrade...') >= 0) { childProcess.xrestart = 3; } else if (data.indexOf('Server restart...') >= 0) { childProcess.xrestart = 1; } console.log(data); }); childProcess.stdout.on('data', function (data) {
if (data[data.length - 1] == '\n') { data = data.substring(0, data.length - 1); }
if (data.indexOf('Updating settings folder...') >= 0) { childProcess.xrestart = 1; }
else if (data.indexOf('Updating server certificates...') >= 0) { childProcess.xrestart = 1; }
else if (data.indexOf('Server Ctrl-C exit...') >= 0) { childProcess.xrestart = 2; }
else if (data.indexOf('Starting self upgrade...') >= 0) { childProcess.xrestart = 3; }
else if (data.indexOf('Server restart...') >= 0) { childProcess.xrestart = 1; }
var datastr = data;
while (datastr.endsWith('\r') || datastr.endsWith('\n')) { datastr = datastr.substring(0, datastr.length - 1); }
console.log(datastr);
});
childProcess.stderr.on('data', function (data) { childProcess.stderr.on('data', function (data) {
var datastr = data;
while (datastr.endsWith('\r') || datastr.endsWith('\n')) { datastr = datastr.substring(0, datastr.length - 1); }
console.log('ERR: ' + datastr);
if (data.startsWith('le.challenges[tls-sni-01].loopback')) { return; } // Ignore this error output from GreenLock if (data.startsWith('le.challenges[tls-sni-01].loopback')) { return; } // Ignore this error output from GreenLock
if (data[data.length - 1] == '\n') { data = data.substring(0, data.length - 1); } if (data[data.length - 1] == '\n') { data = data.substring(0, data.length - 1); }
try { try {

View File

@ -1,6 +1,6 @@
{ {
"name": "meshcentral", "name": "meshcentral",
"version": "0.4.5-d", "version": "0.4.5-f",
"keywords": [ "keywords": [
"Remote Management", "Remote Management",
"Intel AMT", "Intel AMT",

File diff suppressed because one or more lines are too long

View File

@ -1414,7 +1414,7 @@
if (updateNaggleFlags & 128) { updateMeshes(); } if (updateNaggleFlags & 128) { updateMeshes(); }
if (updateNaggleFlags & 4) { updateDevices(); } if (updateNaggleFlags & 4) { updateDevices(); }
if (updateNaggleFlags & 8) { drawNotifications(); } if (updateNaggleFlags & 8) { drawNotifications(); }
if (updateNaggleFlags & 16) { updateMapMarkers(); } {{{StartGeoLocationJS}}}if (updateNaggleFlags & 16) { updateMapMarkers(); }{{{EndGeoLocationJS}}}
if (updateNaggleFlags & 32) { eventsUpdate(); } if (updateNaggleFlags & 32) { eventsUpdate(); }
{{{StartGeoLocationJS}}}if (updateNaggleFlags & 64) { refreshMap(false, true); }{{{EndGeoLocationJS}}} {{{StartGeoLocationJS}}}if (updateNaggleFlags & 64) { refreshMap(false, true); }{{{EndGeoLocationJS}}}
if (updateNaggleFlags & 256) { drawDeviceTimeline(); } if (updateNaggleFlags & 256) { drawDeviceTimeline(); }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -893,23 +893,6 @@
</div> </div>
<div id="p19" style="display:none"> <div id="p19" style="display:none">
<h1>Pluginy - <span id="p19deviceName"></span></h1> <h1>Pluginy - <span id="p19deviceName"></span></h1>
<style>
#p19headers {
padding-right: 7px;
padding-bottom: 10px;
font-weight: bold;
border-bottom: 1px dotted blue;
}
#p19headers > span:nth-child(n+2) {
border-left: 1px solid black;
}
#p19headers > span {
padding-left: 4px;
padding-right: 4px;
}
</style>
<div id="p19headers"></div> <div id="p19headers"></div>
<div id="p19pages"></div> <div id="p19pages"></div>
</div> </div>
@ -1429,7 +1412,7 @@
if (updateNaggleFlags & 128) { updateMeshes(); } if (updateNaggleFlags & 128) { updateMeshes(); }
if (updateNaggleFlags & 4) { updateDevices(); } if (updateNaggleFlags & 4) { updateDevices(); }
if (updateNaggleFlags & 8) { drawNotifications(); } if (updateNaggleFlags & 8) { drawNotifications(); }
if (updateNaggleFlags & 16) { updateMapMarkers(); } {{{StartGeoLocationJS}}}if (updateNaggleFlags & 16) { updateMapMarkers(); }{{{EndGeoLocationJS}}}
if (updateNaggleFlags & 32) { eventsUpdate(); } if (updateNaggleFlags & 32) { eventsUpdate(); }
{{{StartGeoLocationJS}}}if (updateNaggleFlags & 64) { refreshMap(false, true); }{{{EndGeoLocationJS}}} {{{StartGeoLocationJS}}}if (updateNaggleFlags & 64) { refreshMap(false, true); }{{{EndGeoLocationJS}}}
if (updateNaggleFlags & 256) { drawDeviceTimeline(); } if (updateNaggleFlags & 256) { drawDeviceTimeline(); }
@ -4545,7 +4528,7 @@
QV('MainDevFiles', ((mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 4) != 0))) && (meshrights & 8) && fileAccess); QV('MainDevFiles', ((mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 4) != 0))) && (meshrights & 8) && fileAccess);
QV('MainDevAmt', (node.intelamt != null) && ((node.intelamt.state == 2) || (node.conn & 2)) && (meshrights & 8) && amtAccess); QV('MainDevAmt', (node.intelamt != null) && ((node.intelamt.state == 2) || (node.conn & 2)) && (meshrights & 8) && amtAccess);
QV('MainDevConsole', (consoleRights && (mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (meshrights & 8)); QV('MainDevConsole', (consoleRights && (mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (meshrights & 8));
QV('MainDevPlugins', pluginHandler != null); QV('MainDevPlugins', false);
QV('p15uploadCore', (node.agent != null) && (node.agent.caps != null) && ((node.agent.caps & 16) != 0)); QV('p15uploadCore', (node.agent != null) && (node.agent.caps != null) && ((node.agent.caps & 16) != 0));
QH('p15coreName', ((node.agent != null) && (node.agent.core != null))?node.agent.core:''); QH('p15coreName', ((node.agent != null) && (node.agent.core != null))?node.agent.core:'');

View File

@ -893,23 +893,6 @@
</div> </div>
<div id="p19" style="display:none"> <div id="p19" style="display:none">
<h1>Plugins - <span id="p19deviceName"></span></h1> <h1>Plugins - <span id="p19deviceName"></span></h1>
<style>
#p19headers {
padding-right: 7px;
padding-bottom: 10px;
font-weight: bold;
border-bottom: 1px dotted blue;
}
#p19headers > span:nth-child(n+2) {
border-left: 1px solid black;
}
#p19headers > span {
padding-left: 4px;
padding-right: 4px;
}
</style>
<div id="p19headers"></div> <div id="p19headers"></div>
<div id="p19pages"></div> <div id="p19pages"></div>
</div> </div>
@ -1429,7 +1412,7 @@
if (updateNaggleFlags & 128) { updateMeshes(); } if (updateNaggleFlags & 128) { updateMeshes(); }
if (updateNaggleFlags & 4) { updateDevices(); } if (updateNaggleFlags & 4) { updateDevices(); }
if (updateNaggleFlags & 8) { drawNotifications(); } if (updateNaggleFlags & 8) { drawNotifications(); }
if (updateNaggleFlags & 16) { updateMapMarkers(); } {{{StartGeoLocationJS}}}if (updateNaggleFlags & 16) { updateMapMarkers(); }{{{EndGeoLocationJS}}}
if (updateNaggleFlags & 32) { eventsUpdate(); } if (updateNaggleFlags & 32) { eventsUpdate(); }
{{{StartGeoLocationJS}}}if (updateNaggleFlags & 64) { refreshMap(false, true); }{{{EndGeoLocationJS}}} {{{StartGeoLocationJS}}}if (updateNaggleFlags & 64) { refreshMap(false, true); }{{{EndGeoLocationJS}}}
if (updateNaggleFlags & 256) { drawDeviceTimeline(); } if (updateNaggleFlags & 256) { drawDeviceTimeline(); }
@ -4545,7 +4528,7 @@
QV('MainDevFiles', ((mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 4) != 0))) && (meshrights & 8) && fileAccess); QV('MainDevFiles', ((mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 4) != 0))) && (meshrights & 8) && fileAccess);
QV('MainDevAmt', (node.intelamt != null) && ((node.intelamt.state == 2) || (node.conn & 2)) && (meshrights & 8) && amtAccess); QV('MainDevAmt', (node.intelamt != null) && ((node.intelamt.state == 2) || (node.conn & 2)) && (meshrights & 8) && amtAccess);
QV('MainDevConsole', (consoleRights && (mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (meshrights & 8)); QV('MainDevConsole', (consoleRights && (mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (meshrights & 8));
QV('MainDevPlugins', pluginHandler != null); QV('MainDevPlugins', false);
QV('p15uploadCore', (node.agent != null) && (node.agent.caps != null) && ((node.agent.caps & 16) != 0)); QV('p15uploadCore', (node.agent != null) && (node.agent.caps != null) && ((node.agent.caps & 16) != 0));
QH('p15coreName', ((node.agent != null) && (node.agent.core != null))?node.agent.core:''); QH('p15coreName', ((node.agent != null) && (node.agent.core != null))?node.agent.core:'');