Server upgrade improvements.

This commit is contained in:
Ylian Saint-Hilaire 2020-04-17 23:52:35 -07:00
parent 9ed9257707
commit 4e0764fe4d
4 changed files with 7 additions and 8 deletions

View File

@ -390,6 +390,7 @@ function CreateMeshCentralServer(config, args) {
// Server self-update exit
var version = '';
if (typeof obj.args.selfupdate == 'string') { version = '@' + obj.args.selfupdate; }
else if (typeof obj.args.specificupdate == 'string') { version = '@' + obj.args.specificupdate; delete obj.args.specificupdate; }
var child_process = require('child_process');
var npmpath = ((typeof obj.args.npmpath == 'string') ? obj.args.npmpath : 'npm');
var npmproxy = ((typeof obj.args.npmproxy == 'string') ? (' --proxy ' + obj.args.npmproxy) : '');
@ -416,7 +417,7 @@ function CreateMeshCentralServer(config, args) {
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; }
else if (data.indexOf('Starting self upgrade to: ') >= 0) { obj.args.selfupdate = data.substring(26).split('\r')[0].split('\n')[0]; childProcess.xrestart = 3; }
else if (data.indexOf('Starting self upgrade to: ') >= 0) { obj.args.specificupdate = data.substring(26).split('\r')[0].split('\n')[0]; childProcess.xrestart = 3; }
var datastr = data;
while (datastr.endsWith('\r') || datastr.endsWith('\n')) { datastr = datastr.substring(0, datastr.length - 1); }
console.log(datastr);
@ -462,7 +463,7 @@ function CreateMeshCentralServer(config, args) {
obj.getServerTags = function (callback) {
if (callback == null) return;
try {
if (typeof obj.args.selfupdate == 'string') { callback(getCurrentVerion(), obj.args.selfupdate); return; } // If we are targetting a specific version, return that one as current.
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.
var child_process = require('child_process');
var npmpath = ((typeof obj.args.npmpath == 'string') ? obj.args.npmpath : 'npm');
var npmproxy = ((typeof obj.args.npmproxy == 'string') ? (' --proxy ' + obj.args.npmproxy) : '');

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.5.5",
"version": "0.5.6",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -74,10 +74,8 @@
"meshcommander": "https://www.meshcommander.com/"
},
"__MaxInvalidLogin": "Time in minutes, max amount of bad logins from a source IP in the time before logins are rejected.",
"MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 },
"Plugins": {
"enabled": true
}
"_MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 },
"_Plugins": { "enabled": true }
},
"_domains": {
"": {

View File

@ -8253,7 +8253,7 @@
function server_showVersionDlgEx(b, tags) {
if (Q('d2updateCheck1').checked) { meshserver.send({ action: 'serverupdate', tag: 'stable', version: tags.stable }); }
if (Q('d2updateCheck2').checked) { meshserver.send({ action: 'serverupdate', tag: 'latest', version: tags.latest }); }
if (Q('d2updateCheck2').checked) { meshserver.send({ action: 'serverupdate' }); } // , tag: 'latest', version: tags.latest
}
function server_showErrorsDlg() {