Server upgrade improvements.

Ylian Saint-Hilaire committed Apr 17, 2020 at 23:52 UTC 4e0764fe4db584b7cf21c99d32c1db863aa9390a
4 files changed +7 -8
meshcentral.js
+3 -2
@@ -390,6 +390,7 @@ function CreateMeshCentralServer(config, args) {
390 // Server self-update exit
391 var version = '';
392 if (typeof obj.args.selfupdate == 'string') { version = '@' + obj.args.selfupdate; }
393 + else if (typeof obj.args.specificupdate == 'string') { version = '@' + obj.args.specificupdate; delete obj.args.specificupdate; }
394 var child_process = require('child_process');
395 var npmpath = ((typeof obj.args.npmpath == 'string') ? obj.args.npmpath : 'npm');
396 var npmproxy = ((typeof obj.args.npmproxy == 'string') ? (' --proxy ' + obj.args.npmproxy) : '');
@@ -416,7 +417,7 @@ function CreateMeshCentralServer(config, args) {
417 else if (data.indexOf('Server Ctrl-C exit...') >= 0) { childProcess.xrestart = 2; }
418 else if (data.indexOf('Starting self upgrade...') >= 0) { childProcess.xrestart = 3; }
419 else if (data.indexOf('Server restart...') >= 0) { childProcess.xrestart = 1; }
419 - else if (data.indexOf('Starting self upgrade to: ') >= 0) { obj.args.selfupdate = data.substring(26).split('\r')[0].split('\n')[0]; childProcess.xrestart = 3; }
420 + else if (data.indexOf('Starting self upgrade to: ') >= 0) { obj.args.specificupdate = data.substring(26).split('\r')[0].split('\n')[0]; childProcess.xrestart = 3; }
421 var datastr = data;
422 while (datastr.endsWith('\r') || datastr.endsWith('\n')) { datastr = datastr.substring(0, datastr.length - 1); }
423 console.log(datastr);
@@ -462,7 +463,7 @@ function CreateMeshCentralServer(config, args) {
463 obj.getServerTags = function (callback) {
464 if (callback == null) return;
465 try {
465 - if (typeof obj.args.selfupdate == 'string') { callback(getCurrentVerion(), obj.args.selfupdate); return; } // If we are targetting a specific version, return that one as current.
466 + if (typeof obj.args.selfupdate == 'string') { callback({ current: getCurrentVerion(), latest: obj.args.selfupdate }); return; } // If we are targetting a specific version, return that one as current.
467 var child_process = require('child_process');
468 var npmpath = ((typeof obj.args.npmpath == 'string') ? obj.args.npmpath : 'npm');
469 var npmproxy = ((typeof obj.args.npmproxy == 'string') ? (' --proxy ' + obj.args.npmproxy) : '');
package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "meshcentral",
3 - "version": "0.5.5",
3 + "version": "0.5.6",
4 "keywords": [
5 "Remote Management",
6 "Intel AMT",
sample-config.json
+2 -4
@@ -74,10 +74,8 @@
74 "meshcommander": "https://www.meshcommander.com/"
75 },
76 "__MaxInvalidLogin": "Time in minutes, max amount of bad logins from a source IP in the time before logins are rejected.",
77 - "MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 },
78 - "Plugins": {
79 - "enabled": true
80 - }
77 + "_MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 },
78 + "_Plugins": { "enabled": true }
79 },
80 "_domains": {
81 "": {
views/default.handlebars
+1 -1
@@ -8253,7 +8253,7 @@
8253
8254 function server_showVersionDlgEx(b, tags) {
8255 if (Q('d2updateCheck1').checked) { meshserver.send({ action: 'serverupdate', tag: 'stable', version: tags.stable }); }
8256 - if (Q('d2updateCheck2').checked) { meshserver.send({ action: 'serverupdate', tag: 'latest', version: tags.latest }); }
8256 + if (Q('d2updateCheck2').checked) { meshserver.send({ action: 'serverupdate' }); } // , tag: 'latest', version: tags.latest
8257 }
8258
8259 function server_showErrorsDlg() {