diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index 85256a0a..5a43721e 100644 Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ diff --git a/agents/MeshCmd64-signed.exe b/agents/MeshCmd64-signed.exe index 2d4ccf3a..67502c5f 100644 Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ diff --git a/agents/MeshService-signed.exe b/agents/MeshService-signed.exe index 7dcbff2c..d95330f8 100644 Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ diff --git a/agents/MeshService.exe b/agents/MeshService.exe index acc61f2f..d300c71e 100644 Binary files a/agents/MeshService.exe and b/agents/MeshService.exe differ diff --git a/agents/MeshService64-signed.exe b/agents/MeshService64-signed.exe index 1c209b3c..f0357e1e 100644 Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ diff --git a/agents/MeshService64.exe b/agents/MeshService64.exe index 9298d169..27dea3f6 100644 Binary files a/agents/MeshService64.exe and b/agents/MeshService64.exe differ diff --git a/agents/meshcmd.js b/agents/meshcmd.js index 8c1225e9..22ec6bcf 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -342,9 +342,9 @@ function run(argv) { var amtMeiModule = require('amt-mei'); var amtMei = new amtMeiModule(); amtMei.on('error', function (e) { console.log('ERROR: ' + e); exit(1); return; }); - amtMei.getVersion(function (val) { for (var version in val.Versions) { if (val.Versions[version].Description == 'AMT') { mestate.ver = val.Versions[version].Version; } } }); - amtMei.getProvisioningState(function (result) { mestate.ProvisioningState = result; }); - amtMei.getProvisioningMode(function (result) { mestate.ProvisioningMode = result; }); + amtMei.getVersion(function (result) { if (result) { for (var version in result.Versions) { if (result.Versions[version].Description == 'AMT') { mestate.ver = result.Versions[version].Version; } } } }); + amtMei.getProvisioningState(function (result) { if (result) { mestate.ProvisioningState = result; } }); + amtMei.getProvisioningMode(function (result) { if (result) { mestate.ProvisioningMode = result; } }); amtMei.getEHBCState(function (result) { if (result) { mestate.ehbc = result; } }); amtMei.getControlMode(function (result) { if (result) { mestate.controlmode = result; } }); amtMei.getMACAddresses(function (result) { if (result) { mestate.mac = result; } }); @@ -352,24 +352,28 @@ function run(argv) { amtMei.getLanInterfaceSettings(1, function (result) { if (result) { mestate.net1 = result; } }); amtMei.getUuid(function (result) { if ((result != null) && (result.uuid != null)) { mestate.uuid = result.uuid; } }); amtMei.getDnsSuffix(function (result) { - mestate.dns = result; - var str = 'Intel AMT v' + mestate.ver; - if (mestate.ProvisioningState.stateStr == 'PRE') { str += ', pre-provisioning state'; } - else if (mestate.ProvisioningState.stateStr == 'IN') { str += ', in-provisioning state'; } - else if (mestate.ProvisioningState.stateStr == 'POST') { - if (mestate.ProvisioningMode) { - if (mestate.controlmode) { - if (mestate.ProvisioningMode.modeStr == 'ENTERPRISE') { str += ', activated in ' + ["none", "client control mode", "admin control mode", "remote assistance mode"][mestate.controlmode.controlMode]; } else { str += ', activated in ' + mestate.ProvisioningMode.modeStr; } - } else { - str += ', activated in ' + mestate.ProvisioningMode.modeStr; + if (result) { mestate.dns = result; } + if (mestate.ver && mestate.ProvisioningState && mestate.ProvisioningMode) { + var str = 'Intel AMT v' + mestate.ver; + if (mestate.ProvisioningState.stateStr == 'PRE') { str += ', pre-provisioning state'; } + else if (mestate.ProvisioningState.stateStr == 'IN') { str += ', in-provisioning state'; } + else if (mestate.ProvisioningState.stateStr == 'POST') { + if (mestate.ProvisioningMode) { + if (mestate.controlmode) { + if (mestate.ProvisioningMode.modeStr == 'ENTERPRISE') { str += ', activated in ' + ["none", "client control mode", "admin control mode", "remote assistance mode"][mestate.controlmode.controlMode]; } else { str += ', activated in ' + mestate.ProvisioningMode.modeStr; } + } else { + str += ', activated in ' + mestate.ProvisioningMode.modeStr; + } } } + if ((mestate.ehbc) && (mestate.ehbc.EHBC == true)) { str += ', EHBC enabled'; } + str += '.'; + if (mestate.net0 != null) { str += '\r\nWired ' + ((mestate.net0.enabled == 1) ? 'Enabled' : 'Disabled') + ((mestate.net0.dhcpEnabled == 1) ? ', DHCP' : ', Static') + ', ' + mestate.net0.mac + (mestate.net0.address == '0.0.0.0' ? '' : (', ' + mestate.net0.address)); } + if (mestate.net1 != null) { str += '\r\nWireless ' + ((mestate.net1.enabled == 1) ? 'Enabled' : 'Disabled') + ((mestate.net1.dhcpEnabled == 1) ? ', DHCP' : ', Static') + ', ' + mestate.net1.mac + (mestate.net1.address == '0.0.0.0' ? '' : (', ' + mestate.net1.address)); } + console.log(str + '.'); + } else { + console.log('Intel(R) AMT not supported.'); } - if ((mestate.ehbc) && (mestate.ehbc.EHBC == true)) { str += ', EHBC enabled'; } - str += '.'; - if (mestate.net0 != null) { str += '\r\nWired ' + ((mestate.net0.enabled == 1) ? 'Enabled' : 'Disabled') + ((mestate.net0.dhcpEnabled == 1) ? ', DHCP' : ', Static') + ', ' + mestate.net0.mac + (mestate.net0.address == '0.0.0.0' ? '' : (', ' + mestate.net0.address)); } - if (mestate.net1 != null) { str += '\r\nWireless ' + ((mestate.net1.enabled == 1) ? 'Enabled' : 'Disabled') + ((mestate.net1.dhcpEnabled == 1) ? ', DHCP' : ', Static') + ', ' + mestate.net1.mac + (mestate.net1.address == '0.0.0.0' ? '' : (', ' + mestate.net1.address)); } - console.log(str + '.'); exit(1); }); } else if (settings.action == 'amtinfodebug') { diff --git a/agents/modules_meshcore/linux-dbus.js b/agents/modules_meshcore/linux-dbus.js index 390bbfea..cdd6d82e 100644 --- a/agents/modules_meshcore/linux-dbus.js +++ b/agents/modules_meshcore/linux-dbus.js @@ -25,7 +25,7 @@ function dbus(address, uid) .createEvent('signal'); Object.defineProperty(this, "uid", { value: uid }); this._child = require('child_process').execFile("/bin/sh", ["sh"], { type: require('child_process').SpawnTypes.TERM, uid: uid == null ? -1 : uid }); - this._child.stdin.write('dbus-monitor --session "type=\'signal\', interface=\'' + address + '\'" | ( while true; do read X; echo "$X"; done )\n'); + this._child.stdin.write('dbus-monitor --session "type=\'signal\', interface=\'' + address + '\'" | ( while read X; do echo "$X"; done )\n'); this._child.stdout.dbus = this; this._child.stdout.on('data', function (chunk) { diff --git a/meshuser.js b/meshuser.js index c9696732..b5f611bd 100644 --- a/meshuser.js +++ b/meshuser.js @@ -86,7 +86,10 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) { req.session.currentNode = ''; } else { // Close the websocket connection - try { obj.ws.close(); } catch (e) { } return; + console.log('NOAUTH1'); + ws.send(JSON.stringify({ action: 'close', cause: 'noauth' })); + try { obj.ws.close(); } catch (e) { } + return; } } req.session.ws = obj.ws; // Associate this websocket session with the web session @@ -120,8 +123,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) { } }; - user.subscriptions = obj.parent.subscribe(user._id, ws); // Subscribe to events - obj.ws._socket.setKeepAlive(true, 240000); // Set TCP keep alive + user.subscriptions = obj.parent.subscribe(user._id, ws); // Subscribe to events + try { obj.ws._socket.setKeepAlive(true, 240000); } catch (ex) { } // Set TCP keep alive // Send current server statistics obj.SendServerStats = function () { @@ -329,7 +332,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) { command.sessionid = ws.sessionId; // Set the session id, required for responses. command.rights = rights.rights; // Add user rights flags to the message delete command.nodeid; // Remove the nodeid since it's implyed. - agent.send(JSON.stringify(command)); + try { agent.send(JSON.stringify(command)); } catch (ex) { } } } else { // Check if a peer server is connected to this agent @@ -601,7 +604,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) { // Get the list of sessions for this user var sessions = obj.parent.wssessions[command.userid]; - if (sessions != null) { for (i in sessions) { sessions[i].send(JSON.stringify(notification)); } } + if (sessions != null) { for (i in sessions) { try { sessions[i].send(JSON.stringify(notification)); } catch (ex) { } } } if (obj.parent.parent.multiServer != null) { // TODO: Add multi-server support @@ -925,7 +928,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) { var agent = obj.parent.wsagents[i]; if ((targetMeshes.indexOf(agent.dbMeshKey) >= 0) && (agent.authenticated == 2)) { //console.log('Asking agent ' + agent.dbNodeKey + ' to wake ' + macs.join(',')); - agent.send(JSON.stringify({ action: 'wakeonlan', macs: macs })); + try { agent.send(JSON.stringify({ action: 'wakeonlan', macs: macs })); } catch (ex) { } wakeActions++; } } @@ -966,7 +969,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) { var agent = obj.parent.wsagents[node._id]; if (agent != null) { // Send the power command - agent.send(JSON.stringify({ action: 'poweraction', actiontype: command.actiontype })); + try { agent.send(JSON.stringify({ action: 'poweraction', actiontype: command.actiontype })); } catch (ex) { } powerActions++; } } @@ -1004,7 +1007,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) { var agent = obj.parent.wsagents[node._id]; if (agent != null) { // Send the power command - agent.send(JSON.stringify({ action: 'toast', title: command.title, msg: command.msg })); + try { agent.send(JSON.stringify({ action: 'toast', title: command.title, msg: command.msg })); } catch (ex) { } } } } diff --git a/mpsserver.js b/mpsserver.js index 3ea365a1..8517636b 100644 --- a/mpsserver.js +++ b/mpsserver.js @@ -679,7 +679,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { }; function ChangeHostname(socket, host) { - if (socket.tag.host == host) return; // Nothing to change + if (socket.tag.host === host) return; // Nothing to change socket.tag.host = host; // Change the device diff --git a/package.json b/package.json index 3aded37c..c81dc1c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.2.2-c", + "version": "0.2.2-d", "keywords": [ "Remote Management", "Intel AMT", diff --git a/views/default.handlebars b/views/default.handlebars index 38f2ec44..a11a44cd 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -155,58 +155,59 @@
+ | + + + + OS Name + | ++ + + Auto + + | ++ + + + | +
+
+ Sort
+
+
+
+
+ Size
+
+
+
+ |
+
+ + |