Added IP location server rate limit

Ylian Saint-Hilaire committed Sep 5, 2017 at 17:19 UTC dbaee9b2dccc497d8b5aa0111970ff23d2995957
9 files changed +496 -74
agents/TestSuite.db
Binary files /dev/null and b/agents/TestSuite.db differ
agents/meshcore.js
+53 -65
@@ -26,6 +26,7 @@ function createMeshCore(agent) {
26 var lastNetworkInfo = null;
27 var lastPublicLocationInfo = null;
28 var selfInfoUpdateTimer = null;
29 + obj.useNativePipes = (process.platform == 'win32');
30
31 var http = require('http');
32 var fs = require('fs');
@@ -281,9 +282,9 @@ function createMeshCore(agent) {
282 }
283 break;
284 }
284 - case 'location': {
285 - // Update the location information of this node
286 - getIpLocationData(function (location) { mesh.SendCommand({ "action": "location", "type": "publicip", "value": location }); });
285 + case 'iplocation': {
286 + // Update the IP location information of this node. Only do this when requested by the server since we have a limited amount of time we can call this per day
287 + getIpLocationData(function (location) { mesh.SendCommand({ "action": "iplocation", "type": "publicip", "value": location }); });
288 break;
289 }
290 }
@@ -371,10 +372,11 @@ function createMeshCore(agent) {
372 if (len > 0) { this.write(buf.slice(0, len)); } else { fs.closeSync(this.httprequest.downloadFile); this.httprequest.downloadFile = undefined; this.end(); }
373 return;
374 }
374 - // (****) Remote Desktop without using native pipes (TODO: This is in use now because native pipes don't work correctly on Linux)
375 - if (this.httprequest.desktop) { this.httprequest.desktop.kvm.write(data); return; }
376 - // (****) Remote Terminal without using native pipes (TODO: This is in use now because native pipes don't work correctly on Linux)
377 - if (this.httprequest.terminal) { this.httprequest.terminal.write(data); return; }
375 + // Setup remote desktop & terminal without using native pipes
376 + if (useNativePipes == false) {
377 + if (this.httprequest.desktop) { this.httprequest.desktop.kvm.write(data); return; }
378 + if (this.httprequest.terminal) { this.httprequest.terminal.write(data); return; }
379 + }
380
381 if (this.httprequest.state == 0) {
382 // Check if this is a relay connection
@@ -386,53 +388,53 @@ function createMeshCore(agent) {
388 this.httprequest.protocol = parseInt(data);
389 if (typeof this.httprequest.protocol != 'number') { this.httprequest.protocol = 0; }
390 if (this.httprequest.protocol == 1) {
389 - // (****) Remote Terminal without using native pipes (TODO: This is in use now because native pipes don't work correctly on Linux)
390 - if (process.platform == "win32") {
391 - this.httprequest.terminal = processManager.CreateProcess("%windir%\\system32\\cmd.exe");
392 - } else {
393 - this.httprequest.terminal = processManager.CreateProcess("/bin/sh", "sh", ILibProcessPipe_SpawnTypes.TERM);
394 - }
395 - this.httprequest.terminal.tunnel = this;
396 - this.httprequest.terminal.on('data', function (chunk) { this.tunnel.write(chunk); });
397 - this.httprequest.terminal.error.data = function (chunk) { this.parent.tunnel.write(chunk); }
398 -
399 - /*
400 - // Remote terminal using native pipes
401 - if (process.platform == "win32") {
402 - this.httprequest.process = processManager.CreateProcess("%windir%\\system32\\cmd.exe");
391 + if (useNativePipes == false) {
392 + // Remote Terminal without using native pipes
393 + if (process.platform == "win32") {
394 + this.httprequest.terminal = processManager.CreateProcess("%windir%\\system32\\cmd.exe");
395 + } else {
396 + this.httprequest.terminal = processManager.CreateProcess("/bin/sh", "sh", ILibProcessPipe_SpawnTypes.TERM);
397 + }
398 + this.httprequest.terminal.tunnel = this;
399 + this.httprequest.terminal.on('data', function (chunk) { this.tunnel.write(chunk); });
400 + this.httprequest.terminal.error.data = function (chunk) { this.parent.tunnel.write(chunk); }
401 } else {
404 - this.httprequest.process = processManager.CreateProcess("/bin/sh", "sh", ILibProcessPipe_SpawnTypes.TERM);
402 + // Remote terminal using native pipes
403 + if (process.platform == "win32") {
404 + this.httprequest.process = processManager.CreateProcess("%windir%\\system32\\cmd.exe");
405 + } else {
406 + this.httprequest.process = processManager.CreateProcess("/bin/sh", "sh", ILibProcessPipe_SpawnTypes.TERM);
407 + }
408 + this.httprequest.process.tunnel = this;
409 + this.httprequest.process.error.data = function (chunk) { this.parent.tunnel.write(chunk); }
410 + this.httprequest.process.pipe(this);
411 + this.pipe(this.httprequest.process);
412 }
406 - this.httprequest.process.tunnel = this;
407 - this.httprequest.process.error.data = function (chunk) { this.parent.tunnel.write(chunk); }
408 - this.httprequest.process.pipe(this);
409 - this.pipe(this.httprequest.process);
410 - */
413 }
414 if (this.httprequest.protocol == 2) {
413 - // (****) Remote Desktop without using native pipes (TODO: This is in use now because native pipes don't work correctly on Linux)
414 - this.httprequest.desktop = { state: 0, kvm: mesh.getRemoteDesktopStream(), tunnel: this };
415 - this.httprequest.desktop.kvm.tunnel = this;
416 - this.httprequest.desktop.kvm.on('data', function (data) { this.tunnel.write(data); });
417 - this.desktop = this.httprequest.desktop;
418 - this.end = function () { if (--this.desktop.kvm.connectionCount == 0) { this.httprequest.desktop.kvm.end(); } };
419 - if (this.httprequest.desktop.kvm.hasOwnProperty("connectionCount")) { this.httprequest.desktop.kvm.connectionCount++; } else { this.httprequest.desktop.kvm.connectionCount = 1; }
420 -
421 - /*
422 - // Remote desktop using native pipes
423 - this.httprequest.desktop = { state: 0, kvm: mesh.getRemoteDesktopStream(), tunnel: this };
424 - this.httprequest.desktop.kvm.parent = this.httprequest.desktop;
425 - this.desktop = this.httprequest.desktop;
426 - this.end = function () {
427 - --this.desktop.kvm.connectionCount;
428 - this.unpipe(this.httprequest.desktop.kvm);
429 - this.httprequest.desktop.kvm.unpipe(this);
430 - if (this.desktop.kvm.connectionCount == 0) { this.httprequest.desktop.kvm.end(); }
431 - };
432 - if (this.httprequest.desktop.kvm.hasOwnProperty("connectionCount")) { this.httprequest.desktop.kvm.connectionCount++; } else { this.httprequest.desktop.kvm.connectionCount = 1; }
433 - this.pipe(this.httprequest.desktop.kvm);
434 - this.httprequest.desktop.kvm.pipe(this);
435 - */
415 + if (useNativePipes == false) {
416 + // Remote Desktop without using native pipes
417 + this.httprequest.desktop = { state: 0, kvm: mesh.getRemoteDesktopStream(), tunnel: this };
418 + this.httprequest.desktop.kvm.tunnel = this;
419 + this.httprequest.desktop.kvm.on('data', function (data) { this.tunnel.write(data); });
420 + this.desktop = this.httprequest.desktop;
421 + this.end = function () { if (--this.desktop.kvm.connectionCount == 0) { this.httprequest.desktop.kvm.end(); } };
422 + if (this.httprequest.desktop.kvm.hasOwnProperty("connectionCount")) { this.httprequest.desktop.kvm.connectionCount++; } else { this.httprequest.desktop.kvm.connectionCount = 1; }
423 + } else {
424 + // Remote desktop using native pipes
425 + this.httprequest.desktop = { state: 0, kvm: mesh.getRemoteDesktopStream(), tunnel: this };
426 + this.httprequest.desktop.kvm.parent = this.httprequest.desktop;
427 + this.desktop = this.httprequest.desktop;
428 + this.end = function () {
429 + --this.desktop.kvm.connectionCount;
430 + this.unpipe(this.httprequest.desktop.kvm);
431 + this.httprequest.desktop.kvm.unpipe(this);
432 + if (this.desktop.kvm.connectionCount == 0) { this.httprequest.desktop.kvm.end(); }
433 + };
434 + if (this.httprequest.desktop.kvm.hasOwnProperty("connectionCount")) { this.httprequest.desktop.kvm.connectionCount++; } else { this.httprequest.desktop.kvm.connectionCount = 1; }
435 + this.pipe(this.httprequest.desktop.kvm);
436 + this.httprequest.desktop.kvm.pipe(this);
437 + }
438 }
439 else if (this.httprequest.protocol == 5) {
440 // Setup files
@@ -569,7 +571,7 @@ function createMeshCore(agent) {
571 break;
572 }
573 case 'info': { // Return information about the agent and agent core module
572 - response = 'Current Core: ' + obj.meshCoreInfo + '.\r\nAgent Time: ' + Date() + '.\r\nUser Rights: 0x' + rights.toString(16) + '.\r\nPlatform Info: ' + process.platform + '.\r\Capabilities: ' + obj.meshCoreCapabilities + '.';
574 + response = 'Current Core: ' + obj.meshCoreInfo + '.\r\nAgent Time: ' + Date() + '.\r\nUser Rights: 0x' + rights.toString(16) + '.\r\nPlatform Info: ' + process.platform + '.\r\nCapabilities: ' + obj.meshCoreCapabilities + '.\r\nNative Pipes: ' + obj.useNativePipes + '.';
575 break;
576 }
577 case 'selfinfo': { // Return self information block
@@ -763,14 +765,6 @@ function createMeshCore(agent) {
765 sendConsoleText(args['_'].join(' '));
766 break;
767 }
766 - case 'location': { // Get location information about this computer
767 - if (args['_'][0] == 'force') {
768 - getIpLocationDataEx(function (location) { sendConsoleText('IpLocation: ' + getIpLocationDataExCounts[0] + ' querie(s), ' + getIpLocationDataExCounts[1] + ' response(s), inProgress: ' + getIpLocationDataExInProgress + "\r\nPublic IP location data:\r\n" + objToString(location, 0, '.'), sessionid); }, args['_'][0]);
769 - } else {
770 - getIpLocationData(function (location) { sendConsoleText('IpLocation: ' + getIpLocationDataExCounts[0] + ' querie(s), ' + getIpLocationDataExCounts[1] + ' response(s), inProgress: ' + getIpLocationDataExInProgress + "\r\nPublic IP location data:\r\n" + objToString(location, 0, '.'), sessionid); }, args['_'][0]);
771 - }
772 - break;
773 - }
768 case 'power': { // Execute a power action on this computer
769 if (mesh.ExecPowerState == undefined) {
770 response = 'Power command not supported on this agent.';
@@ -844,12 +838,6 @@ function createMeshCore(agent) {
838 netInfo.action = 'netinfo';
839 var netInfoStr = JSON.stringify(netInfo);
840 if ((force == true) || (clearGatewayMac(netInfoStr) != clearGatewayMac(lastNetworkInfo))) { mesh.SendCommand(netInfo); lastNetworkInfo = netInfoStr; }
847 -
848 - // Update public IP location information, location caching will be used
849 - getIpLocationData(function (location) {
850 - var locationStr = JSON.stringify(location);
851 - if ((force == true) || (locationStr != lastPublicLocationInfo)) { mesh.SendCommand({ "action": "location", "type": "publicip", "value": location }); lastPublicLocationInfo = locationStr; }
852 - });
841 }
842
843 // Called on MicroLMS Intel AMT user notification
agents/testsuite.js new
+157
@@ -0,0 +1,157 @@
1 +/*
2 +Copyright 2017 Intel Corporation
3 +
4 +Licensed under the Apache License, Version 2.0 (the "License");
5 +you may not use this file except in compliance with the License.
6 +You may obtain a copy of the License at
7 +
8 + http://www.apache.org/licenses/LICENSE-2.0
9 +
10 +Unless required by applicable law or agreed to in writing, software
11 +distributed under the License is distributed on an "AS IS" BASIS,
12 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 +See the License for the specific language governing permissions and
14 +limitations under the License.
15 +*/
16 +
17 +
18 +// Polyfill String.endsWith
19 +if (!String.prototype.endsWith) {
20 + String.prototype.endsWith = function (searchString, position) {
21 + var subjectString = this.toString();
22 + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { position = subjectString.length; }
23 + position -= searchString.length;
24 + var lastIndex = subjectString.lastIndexOf(searchString, position);
25 + return lastIndex !== -1 && lastIndex === position;
26 + };
27 +}
28 +
29 +// Replace a string with a number if the string is an exact number
30 +function toNumberIfNumber(x) { if ((typeof x == 'string') && (+parseInt(x) == x)) { x = parseInt(x); } return x; }
31 +
32 +// Convert decimal to hex
33 +function char2hex(i) { return (i + 0x100).toString(16).substr(-2).toUpperCase(); }
34 +
35 +// Convert a raw string to a hex string
36 +function rstr2hex(input) { var r = '', i; for (i = 0; i < input.length; i++) { r += char2hex(input.charCodeAt(i)); } return r; }
37 +
38 +// Convert a buffer into a string
39 +function buf2rstr(buf) { var r = ''; for (var i = 0; i < buf.length; i++) { r += String.fromCharCode(buf[i]); } return r; }
40 +
41 +// Convert a hex string to a raw string // TODO: Do this using Buffer(), will be MUCH faster
42 +function hex2rstr(d) {
43 + if (typeof d != "string" || d.length == 0) return '';
44 + var r = '', m = ('' + d).match(/../g), t;
45 + while (t = m.shift()) r += String.fromCharCode('0x' + t);
46 + return r
47 +}
48 +
49 +// Convert an object to string with all functions
50 +function objToString(x, p, ret) {
51 + if (ret == undefined) ret = '';
52 + if (p == undefined) p = 0;
53 + if (x == null) { return '[null]'; }
54 + if (p > 8) { return '[...]'; }
55 + if (x == undefined) { return '[undefined]'; }
56 + if (typeof x == 'string') { if (p == 0) return x; return '"' + x + '"'; }
57 + if (typeof x == 'buffer') { return '[buffer]'; }
58 + if (typeof x != 'object') { return x; }
59 + var r = '{' + (ret ? '\r\n' : ' ');
60 + for (var i in x) { r += (addPad(p + 2, ret) + i + ': ' + objToString(x[i], p + 2, ret) + (ret ? '\r\n' : ' ')); }
61 + return r + addPad(p, ret) + '}';
62 +}
63 +
64 +// Return p number of spaces
65 +function addPad(p, ret) { var r = ''; for (var i = 0; i < p; i++) { r += ret; } return r; }
66 +
67 +// Split a string taking into account the quoats. Used for command line parsing
68 +function splitArgs(str) {
69 + var myArray = [], myRegexp = /[^\s"]+|"([^"]*)"/gi;
70 + do { var match = myRegexp.exec(str); if (match != null) { myArray.push(match[1] ? match[1] : match[0]); } } while (match != null);
71 + return myArray;
72 +}
73 +
74 +// Parse arguments string array into an object
75 +function parseArgs(argv) {
76 + var results = { '_': [] }, current = null;
77 + for (var i = 1, len = argv.length; i < len; i++) {
78 + var x = argv[i];
79 + if (x.length > 2 && x[0] == '-' && x[1] == '-') {
80 + if (current != null) { results[current] = true; }
81 + current = x.substring(2);
82 + } else {
83 + if (current != null) { results[current] = toNumberIfNumber(x); current = null; } else { results['_'].push(toNumberIfNumber(x)); }
84 + }
85 + }
86 + if (current != null) { results[current] = true; }
87 + return results;
88 +}
89 +
90 +// Parge a URL string into an options object
91 +function parseUrl(url) {
92 + var x = url.split('/');
93 + if (x.length < 4) return null;
94 + var y = x[2].split(':');
95 + var options = {};
96 + var options = { protocol: x[0], hostname: y[0], path: '/' + x.splice(3).join('/') };
97 + if (y.length == 1) { options.port = ((x[0] == 'https:') || (x[0] == 'wss:')) ? 443 : 80; } else { options.port = parseInt(y[1]); }
98 + if (isNaN(options.port) == true) return null;
99 + return options;
100 +}
101 +
102 +//console.log(objToString(db2, 2, ' '));
103 +
104 +{
105 + // TODO: Fix this to use the event emitor
106 + // TODO: Add SHA256 sync
107 + console.log('--- Test 1: SHA256 hashing ---');
108 + var sha256 = require('SHA256Stream');
109 + sha256.hashString = function (x) { if (x == '81B637D8FCD2C6DA6359E6963113A1170DE795E4B725B84D1E0B4CFD9EC58CE9') { console.log('Test 1 - OK: ' + x); } else { console.log('Test 1 - FAIL: ' + x); } };
110 + sha256.write('bob');
111 + sha256.end();
112 +}
113 +{
114 + // FAIL!!!!!!!!!
115 + var sha256x = require('SHA256Stream');
116 + sha256x.hashString = function (x) { if (x == '81B637D8FCD2C6DA6359E6963113A1170DE795E4B725B84D1E0B4CFD9EC58CE9') { console.log('Test 1 - OK: ' + x); } else { console.log('Test 1 - FAIL: ' + x); } };
117 + sha256x.write('bob');
118 + sha256x.end();
119 +}
120 +
121 +/*
122 +{
123 + console.log('--- Test 2: Database ---');
124 + var db = require('SimpleDataStore').Create('TestSuite.db');
125 + var sha256 = require('SHA256Stream');
126 +
127 + // Write a pile of hashes to the DB
128 + sha256.hashString = function (x) { db.Put(x.substring(0, 16), x.substring(16)); console.log('ADD: ' + x.substring(0, 16) + ': ' + x.substring(16)); };
129 + for (var i = 0; i < 10; i++) { console.log(i); sha256.write('A' + i); sha256.end(); }
130 +
131 + // Compact plenty of times
132 + for (var i = 0; i < 10; i++) { console.log(i); db.Compact(); }
133 +
134 + // Check all the hashes
135 + sha256.hashString = function (x) {
136 + var r = db.Get(x.substring(0, 16));
137 + console.log('GET: ' + x.substring(0, 16) + ': ' + r);
138 + if (r != x.substring(16)) { console.log('FAILED ' + x.substring(0, 16) + ': ' + x.substring(16) + ' != ' + r); }
139 + //db.Put(x.substring(0, 16), '');
140 + };
141 + for (var i = 0; i < 10; i++) { console.log(i); sha256.write('A' + i); sha256.end(); }
142 + console.log('Test 2 - Completed.');
143 +}
144 +*/
145 +
146 +{
147 + console.log('--- Test 3: Files ---');
148 + var r, fs = require('fs');
149 + //console.log(objToString(fs, 2, ' '));
150 + r = fs.mkdirSync('TestSuite-123');
151 + r = fs.renameSync('TestSuite-123', 'TestSuite-1234');
152 + console.log(r);
153 + r = fs.unlinkSync('TestSuite-1234');
154 +}
155 +
156 +console.log('--- Tests Completed ---');
157 +process.exit(2);
\ No newline at end of file
db.js
+3
@@ -165,6 +165,9 @@ module.exports.CreateDB = function (args, datapath) {
165 obj.getPowerTimeline = function (nodeid, func) { if (obj.databaseType == 1) { obj.file.find({ type: 'power', node: { $in: ['*', nodeid] } }).sort({ time: 1 }).exec(func); } else { obj.file.find({ type: 'power', node: { $in: ['*', nodeid] } }).sort({ time: 1 }, func); } }
166 obj.getLocalAmtNodes = function (func) { obj.file.find({ type: 'node', host: { $exists: true, $ne: null }, intelamt: { $exists: true } }, func); }
167
168 + // This is used to rate limit a number of operation per day. Returns a startValue each new days, but you can substract it and save the value in the db.
169 + obj.getValueOfTheDay = function (id, startValue, func) { obj.Get(id, function (err, docs) { var date = new Date(), t = date.toLocaleDateString(); if (docs.length == 1) { var r = docs[0]; if (r.day == t) { func({ _id: id, value: r.value, day: t }); return; } } func({ _id: id, value: startValue, day: t }); }); }
170 +
171 function Clone(v) { return JSON.parse(JSON.stringify(v)); }
172
173 return obj;
meshagent.js
+32 -4
@@ -232,12 +232,14 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
232
233 // Check that the node exists
234 obj.db.Get(obj.dbNodeKey, function (err, nodes) {
235 + var device;
236 +
237 // Mark when we connected to this agent
238 obj.connectTime = Date.now();
239
240 if (nodes.length == 0) {
241 // This node does not exist, create it.
240 - var device = { type: 'node', mtype: mesh.mtype, _id: obj.dbNodeKey, icon: obj.agentInfo.platformType, meshid: obj.dbMeshKey, name: obj.agentInfo.computerName, domain: domain.id, agent: { ver: obj.agentInfo.agentVersion, id: obj.agentInfo.agentId, caps: obj.agentInfo.capabilities }, host: null };
242 + device = { type: 'node', mtype: mesh.mtype, _id: obj.dbNodeKey, icon: obj.agentInfo.platformType, meshid: obj.dbMeshKey, name: obj.agentInfo.computerName, domain: domain.id, agent: { ver: obj.agentInfo.agentVersion, id: obj.agentInfo.agentId, caps: obj.agentInfo.capabilities }, host: null };
243 obj.db.Set(device);
244
245 // Event the new node
@@ -245,7 +247,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
247 obj.parent.parent.DispatchEvent(['*', obj.dbMeshKey], obj, { etype: 'node', action: 'addnode', node: device, msg: change, domain: domain.id })
248 } else {
249 // Device already exists, look if changes has occured
248 - var device = nodes[0];
250 + device = nodes[0];
251 if (device.agent == undefined) {
252 device.agent = { ver: obj.agentInfo.agentVersion, id: obj.agentInfo.agentId, caps: obj.agentInfo.capabilities }; change = 1;
253 } else {
@@ -291,6 +293,32 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
293 // Check if we need to make an native update check
294 obj.agentInfo = obj.parent.parent.meshAgentBinaries[obj.agentInfo.agentId];
295 if ((obj.agentInfo != undefined) && (obj.agentInfo.update == true)) { obj.send(obj.common.ShortToStr(12) + obj.common.ShortToStr(0)); } // Ask the agent for it's executable binary hash
296 +
297 + // Check if we need to ask for the IP location
298 + var doIpLocation = 0;
299 + if (device.iploc == null) {
300 + doIpLocation = 1;
301 + } else {
302 + var loc = device.iploc.split(',');
303 + if (loc.length < 3) {
304 + doIpLocation = 2;
305 + } else {
306 + var t = new Date((parseFloat(loc[2]) * 1000)), now = Date.now();
307 + t.setDate(t.getDate() + 20);
308 + if (t < now) { doIpLocation = 3; }
309 + }
310 + }
311 +
312 + // If we need to ask for IP location, see if we have the quota to do it.
313 + if (doIpLocation > 0) {
314 + obj.db.getValueOfTheDay('ipLocationRequestLimitor', 10, function (ipLocationLimitor) {
315 + if (ipLocationLimitor.value > 0) {
316 + ipLocationLimitor.value--;
317 + obj.db.Set(ipLocationLimitor);
318 + obj.send(JSON.stringify({ action: 'iplocation' }));
319 + }
320 + });
321 + }
322 });
323 });
324 }
@@ -394,13 +422,13 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
422
423 break;
424 }
397 - case 'location':
425 + case 'iplocation':
426 {
427 // Sent by the agent to update location information
428 if ((command.type == 'publicip') && (command.value != null) && (typeof command.value == 'object') && (command.value.ip) && (command.value.loc)) {
429 var x = {};
430 x.publicip = command.value.ip;
403 - x.iploc = command.value.loc;
431 + x.iploc = command.value.loc + ',' + (Math.floor(Date.now() / 1000) );
432 ChangeAgentLocationInfo(x);
433 }
434 break;
meshcentral.js
+1 -2
@@ -118,7 +118,6 @@ function CreateMeshCentralServer() {
118 obj.launchChildServer = function (startLine) {
119 var child_process = require('child_process');
120 var xprocess = child_process.exec(startLine + ' --launch', function (error, stdout, stderr) {
121 - console.log(xprocess.xrestart);
121 if (xprocess.xrestart == 1) {
122 setTimeout(function () { obj.launchChildServer(startLine); }, 500); // This is an expected restart.
123 } else if (xprocess.xrestart == 2) {
@@ -127,7 +126,7 @@ function CreateMeshCentralServer() {
126 } else {
127 if (error != null) {
128 // This is an un-expected restart
130 - console.log('ERROR: MeshCentral failed with critical error, restarting...');
129 + console.log('ERROR: MeshCentral failed with critical error, check MeshErrors.txt. Restarting...');
130 setTimeout(function () { obj.launchChildServer(startLine); }, 1000);
131 }
132 }
mesherrors.txt new
+247
@@ -0,0 +1,247 @@
1 +-------- 9/5/2017, 4:28:13 PM --------
2 +
3 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:167
4 + obj.getValueOfTheDay = function (id, startValue) { obj.Get(id, function (err, docs) { var t = Date.now().toLocaleDateString(); if (docs.length == 1) { var r = docs[0]; if (r.t == t) { return { _id: id, value: r.v, day: t } } } return { _id: id, value: startValue, day: t }; }); }
5 + ^
6 +
7 +TypeError: Date.now(...).toLocaleDateString is not a function
8 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:167:110
9 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
10 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
11 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
12 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
13 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
14 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
15 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
16 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
17 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
18 +
19 +
20 +-------- 9/5/2017, 4:29:52 PM --------
21 +
22 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:169
23 + var t = Date.now().toLocaleDateString();
24 + ^
25 +
26 +TypeError: Date.now(...).toLocaleDateString is not a function
27 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:169:32
28 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
29 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
30 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
31 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
32 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
33 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
34 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
35 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
36 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
37 +
38 +
39 +-------- 9/5/2017, 4:29:54 PM --------
40 +
41 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:169
42 + var t = Date.now().toLocaleDateString();
43 + ^
44 +
45 +TypeError: Date.now(...).toLocaleDateString is not a function
46 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:169:32
47 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
48 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
49 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
50 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
51 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
52 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
53 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
54 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
55 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
56 +
57 +
58 +-------- 9/5/2017, 4:30:37 PM --------
59 +
60 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:170
61 + var t = data.toLocaleDateString();
62 + ^
63 +
64 +ReferenceError: data is not defined
65 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:170:21
66 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
67 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
68 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
69 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
70 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
71 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
72 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
73 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
74 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
75 +
76 +
77 +-------- 9/5/2017, 4:30:54 PM --------
78 +
79 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:170
80 + var t = date.toLocaleDateString();
81 + ^
82 +
83 +TypeError: date.toLocaleDateString is not a function
84 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:170:26
85 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
86 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
87 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
88 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
89 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
90 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
91 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
92 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
93 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
94 +
95 +
96 +-------- 9/5/2017, 4:31:59 PM --------
97 +
98 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:170
99 + console.log(date, t);
100 + ^
101 +
102 +ReferenceError: date is not defined
103 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\db.js:170:25
104 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
105 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
106 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
107 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
108 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
109 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
110 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
111 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
112 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
113 +
114 +
115 +-------- 9/5/2017, 4:45:04 PM --------
116 +
117 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:305
118 + var loc = doIpLocation.split(',');
119 + ^
120 +
121 +TypeError: doIpLocation.split is not a function
122 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:305:44
123 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
124 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
125 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
126 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
127 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
128 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
129 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
130 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
131 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
132 +
133 +
134 +-------- 9/5/2017, 4:45:07 PM --------
135 +
136 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:305
137 + var loc = doIpLocation.split(',');
138 + ^
139 +
140 +TypeError: doIpLocation.split is not a function
141 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:305:44
142 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
143 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
144 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
145 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
146 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
147 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
148 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
149 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
150 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
151 +
152 +
153 +-------- 9/5/2017, 4:50:24 PM --------
154 +
155 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:308
156 + if (t < new Date.now()) { doIpLocation = 3; }
157 + ^
158 +
159 +TypeError: Date.now is not a constructor
160 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:308:33
161 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
162 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
163 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
164 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
165 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
166 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
167 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
168 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
169 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
170 +
171 +
172 +-------- 9/5/2017, 4:51:11 PM --------
173 +
174 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:309
175 + if (t < new Date.now()) { doIpLocation = 3; }
176 + ^
177 +
178 +TypeError: Date.now is not a constructor
179 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:309:33
180 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
181 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
182 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
183 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
184 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
185 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
186 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
187 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
188 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
189 +
190 +
191 +-------- 9/5/2017, 4:51:42 PM --------
192 +
193 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:309
194 + if (t < new Date.now()) { doIpLocation = 3; }
195 + ^
196 +
197 +TypeError: Date.now is not a constructor
198 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:309:33
199 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
200 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
201 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
202 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
203 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
204 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
205 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
206 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
207 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
208 +
209 +
210 +-------- 9/5/2017, 4:52:05 PM --------
211 +
212 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:309
213 + if (t < new Date.now()) { doIpLocation = 3; }
214 + ^
215 +
216 +TypeError: Date.now is not a constructor
217 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:309:33
218 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
219 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
220 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
221 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
222 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
223 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
224 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
225 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
226 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
227 +
228 +
229 +-------- 9/5/2017, 4:52:42 PM --------
230 +
231 +C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:307
232 + var now = new Date.now();
233 + ^
234 +
235 +TypeError: Date.now is not a constructor
236 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\meshagent.js:307:35
237 + at newArguments.(anonymous function) (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\executor.js:29:17)
238 + at Cursor.execFn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:484:12)
239 + at callback (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:126:19)
240 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\cursor.js:193:12
241 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:329:14
242 + at Object.async.eachSeries (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:130:20)
243 + at C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\nedb\lib\datastore.js:323:11
244 + at fn (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:582:34)
245 + at Immediate._onImmediate (C:\Users\Default.DESKTOP-M9I88C9\Desktop\AmtWebApp\meshcentral\node_modules\async\lib\async.js:498:34)
246 +
247 +
meshscanner.js
+2 -2
@@ -31,7 +31,7 @@ module.exports.CreateMeshScanner = function (parent) {
31 var interface2 = interface[j];
32 if ((interface2.mac != '00:00:00:00:00:00') && (interface2.internal == false)) {
33 if (interface2.family == 'IPv4') { ipv4.push(interface2.address); }
34 - if (interface2.family == 'IPv6') { ipv6.push(interface2.address); }
34 + if (interface2.family == 'IPv6') { ipv6.push(interface2.address + '%' + i); }
35 }
36 }
37 }
@@ -80,7 +80,7 @@ module.exports.CreateMeshScanner = function (parent) {
80 server6.xxclear = false;
81 server6.xxtype = 6;
82 server6.xxlocal = localAddress;
83 - server6.on('error', function (err) { console.log("ERROR: Server port " + server6.xxlocal + ":16989 not available, check if server is running twice.");server6.close(); obj.server6 = null; });
83 + server6.on('error', function (err) { console.log("ERROR: Server port [" + server6.xxlocal + "]:16989 not available, check if server is running twice.");server6.close(); obj.server6 = null; });
84 server6.bind({ address: server6.xxlocal, port: 16989, exclusive: false }, function () {
85 try {
86 server6.setBroadcast(true);
package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "meshcentral",
3 - "version": "0.0.7-d",
3 + "version": "0.0.7-f",
4 "keywords": [
5 "Remote Management",
6 "Intel AMT",