diff --git a/agents/MeshCentralRouter.exe b/agents/MeshCentralRouter.exe
index 7062aea2..ec511a96 100644
Binary files a/agents/MeshCentralRouter.exe and b/agents/MeshCentralRouter.exe differ
diff --git a/meshagent.js b/meshagent.js
index 7b376773..40425d19 100644
--- a/meshagent.js
+++ b/meshagent.js
@@ -220,6 +220,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
parent.parent.taskLimiter.launch(function (argument, taskid, taskLimiterQueue) {
if (obj.authenticated != 2) { parent.parent.taskLimiter.completed(taskid); return; } // If agent disconnection, complete and exit now.
if (obj.nodeid != null) { parent.parent.debug(1, 'Agent update required, NodeID=0x' + obj.nodeid.substring(0, 16) + ', ' + obj.agentExeInfo.desc); }
+ parent.agentStats.agentBinaryUpdate++;
if (obj.agentExeInfo.data == null) {
// Read the agent from disk
parent.fs.open(obj.agentExeInfo.path, 'r', function (err, fd) {
@@ -457,6 +458,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
// If the mesh agent web socket is closed, clean up.
ws.on('close', function (req) {
+ parent.agentStats.agentClose++;
if (obj.nodeid != null) {
const agentId = (obj.agentInfo && obj.agentInfo.agentId) ? obj.agentInfo.agentId : 'Unknown';
//console.log('Agent disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ') id=' + agentId);
diff --git a/package.json b/package.json
index ec2416e6..6d6cee2f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "meshcentral",
- "version": "0.3.5-d",
+ "version": "0.3.5-f",
"keywords": [
"Remote Management",
"Intel AMT",
diff --git a/views/default-min.handlebars b/views/default-min.handlebars
index 23aefd15..1f950ab7 100644
--- a/views/default-min.handlebars
+++ b/views/default-min.handlebars
@@ -1 +1 @@
-
{{{title}}} My Devices | My Account | My Events | My Files | My Users | My Server | |
General | Desktop | Terminal | Files | Events | Intel® AMT | Console | |
Server disconnected, click to reconnect.
My Devices
| No device groups. |
My Account
Device Groups ( New ) My Files
These files are shared publicly, click "link" to get public url.
✓
✗
My Server
Server Statistics
Intel® AMT Redirection port or KVM feature is disabled, click here to enable it.
Remote computer is not powered on, click here to issue a power command.
Intel® AMT Redirection port or KVM feature is disabled, click here to enable it.
Remote computer is not powered on, click here to issue a power command.
General -
File Selection
Agent Remote Desktop
Scaling
Frame rate
Intel® AMT Hardware KVM
Image Encoding
\ No newline at end of file
+ {{{title}}} My Devices | My Account | My Events | My Files | My Users | My Server | |
General | Desktop | Terminal | Files | Events | Intel® AMT | Console | |
Server disconnected, click to reconnect.
My Devices
| No device groups. |
My Account
Device Groups ( New ) My Files
These files are shared publicly, click "link" to get public url.
✓
✗
My Server
Server Statistics
Intel® AMT Redirection port or KVM feature is disabled, click here to enable it.
Remote computer is not powered on, click here to issue a power command.
Intel® AMT Redirection port or KVM feature is disabled, click here to enable it.
Remote computer is not powered on, click here to issue a power command.
General -
File Selection
Agent Remote Desktop
Scaling
Frame rate
Intel® AMT Hardware KVM
Image Encoding
\ No newline at end of file
diff --git a/webserver.js b/webserver.js
index 23521404..fb9489c7 100644
--- a/webserver.js
+++ b/webserver.js
@@ -241,6 +241,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Agent counters
obj.agentStats = {
createMeshAgentCount: 0,
+ agentClose: 0,
+ agentBinaryUpdate: 0,
coreIsStableCount: 0,
verifiedAgentConnectionCount: 0,
clearingCoreCount: 0,
@@ -2197,9 +2199,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
function handleBackupRequest(req, res) {
const domain = checkUserIpAddress(req, res);
if (domain == null) return;
- if ((domain.id !== '') || (!req.session) || (req.session == null) || (!req.session.userid) || (obj.parent.args.noserverbackup == 1)) { res.sendStatus(401); return; }
+ if ((!req.session) || (req.session == null) || (!req.session.userid) || (obj.parent.args.noserverbackup == 1)) { res.sendStatus(401); return; }
var user = obj.users[req.session.userid];
- if ((user.siteadmin & 1) == 0) { res.sendStatus(401); return; } // Check if we have server backup rights
+ if ((user == null) || ((user.siteadmin & 1) == 0)) { res.sendStatus(401); return; } // Check if we have server backup rights
// Require modules
const archive = require('archiver')('zip', { level: 9 }); // Sets the compression method to maximum.
@@ -2229,9 +2231,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
function handleRestoreRequest(req, res) {
const domain = checkUserIpAddress(req, res);
if (domain == null) return;
- if ((domain.id !== '') || (!req.session) || (req.session == null) || (!req.session.userid) || (obj.parent.args.noserverbackup == 1)) { res.sendStatus(401); return; }
+ if ((!req.session) || (req.session == null) || (!req.session.userid) || (obj.parent.args.noserverbackup == 1)) { res.sendStatus(401); return; }
const user = obj.users[req.session.userid];
- if ((user.siteadmin & 4) == 0) { res.sendStatus(401); return; } // Check if we have server restore rights
+ if ((user == null) || ((user.siteadmin & 4) == 0)) { res.sendStatus(401); return; } // Check if we have server restore rights
const multiparty = require('multiparty');
const form = new multiparty.Form();
@@ -2627,13 +2629,13 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
});
// Setup all HTTP handlers
- obj.app.get('/backup.zip', handleBackupRequest);
- obj.app.post('/restoreserver.ashx', handleRestoreRequest);
if (parent.multiServer != null) { obj.app.ws('/meshserver.ashx', function (ws, req) { parent.multiServer.CreatePeerInServer(parent.multiServer, ws, req); }); }
for (var i in parent.config.domains) {
if (parent.config.domains[i].dns != null) { continue; } // This is a subdomain with a DNS name, no added HTTP bindings needed.
var url = parent.config.domains[i].url;
obj.app.get(url, handleRootRequest);
+ obj.app.get(url + 'backup.zip', handleBackupRequest);
+ obj.app.post(url + 'restoreserver.ashx', handleRestoreRequest);
obj.app.get(url + 'terms', handleTermsRequest);
obj.app.post(url + 'login', handleLoginRequest);
obj.app.post(url + 'tokenlogin', handleLoginRequest);