mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
Fixed meshcore update faliure case.
This commit is contained in:
parent
16c2bce40d
commit
29c6b7877e
5 changed files with 7 additions and 5 deletions
|
@ -4022,7 +4022,7 @@ function agentUpdate_Start(updateurl, updateoptions) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sessionid != null) { sendConsoleText('Downloading update...', sessionid); }
|
if (sessionid != null) { sendConsoleText('Downloading update from: ' + updateurl, sessionid); }
|
||||||
var options = require('http').parseUri(updateurl != null ? updateurl : require('MeshAgent').ServerUrl);
|
var options = require('http').parseUri(updateurl != null ? updateurl : require('MeshAgent').ServerUrl);
|
||||||
options.protocol = 'https:';
|
options.protocol = 'https:';
|
||||||
if (updateurl == null) { options.path = ('/meshagents?id=' + require('MeshAgent').ARCHID); }
|
if (updateurl == null) { options.path = ('/meshagents?id=' + require('MeshAgent').ARCHID); }
|
||||||
|
@ -4052,6 +4052,7 @@ function agentUpdate_Start(updateurl, updateoptions) {
|
||||||
agentUpdate_Start._selfupdate.on('error', function (e) {
|
agentUpdate_Start._selfupdate.on('error', function (e) {
|
||||||
sendConsoleText('Self Update failed, because there was a problem trying to download the update', sessionid);
|
sendConsoleText('Self Update failed, because there was a problem trying to download the update', sessionid);
|
||||||
sendAgentMessage('Self Update failed, because there was a problem trying to download the update', 3);
|
sendAgentMessage('Self Update failed, because there was a problem trying to download the update', 3);
|
||||||
|
agentUpdate_Start._selfupdate = null;
|
||||||
});
|
});
|
||||||
agentUpdate_Start._selfupdate.on('response', function (img) {
|
agentUpdate_Start._selfupdate.on('response', function (img) {
|
||||||
this._file = require('fs').createWriteStream(agentfilename + '.update', { flags: 'wb' });
|
this._file = require('fs').createWriteStream(agentfilename + '.update', { flags: 'wb' });
|
||||||
|
|
|
@ -399,6 +399,7 @@ function agentUpdate_Start(updateurl, updateoptions)
|
||||||
{
|
{
|
||||||
sendConsoleText('Self Update failed, because there was a problem trying to download the update', sessionid);
|
sendConsoleText('Self Update failed, because there was a problem trying to download the update', sessionid);
|
||||||
sendAgentMessage('Self Update failed, because there was a problem trying to download the update', 3);
|
sendAgentMessage('Self Update failed, because there was a problem trying to download the update', 3);
|
||||||
|
agentUpdate_Start._selfupdate = null;
|
||||||
});
|
});
|
||||||
agentUpdate_Start._selfupdate.on('response', function (img)
|
agentUpdate_Start._selfupdate.on('response', function (img)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1179,7 +1179,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
||||||
if (obj.agentExeInfo.fileHash != null) { cmd.hash = obj.agentExeInfo.fileHashHex; } else { cmd.hash = obj.agentExeInfo.hashhex; }
|
if (obj.agentExeInfo.fileHash != null) { cmd.hash = obj.agentExeInfo.fileHashHex; } else { cmd.hash = obj.agentExeInfo.hashhex; }
|
||||||
|
|
||||||
// Add server TLS cert hash
|
// Add server TLS cert hash
|
||||||
if (parent.parent.args.ignoreagenthashcheck !== true) {
|
if (isIgnoreHashCheck() == false) {
|
||||||
const tlsCertHash = parent.webCertificateFullHashs[domain.id];
|
const tlsCertHash = parent.webCertificateFullHashs[domain.id];
|
||||||
if (tlsCertHash != null) { cmd.servertlshash = Buffer.from(tlsCertHash, 'binary').toString('hex'); }
|
if (tlsCertHash != null) { cmd.servertlshash = Buffer.from(tlsCertHash, 'binary').toString('hex'); }
|
||||||
}
|
}
|
||||||
|
@ -1491,7 +1491,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
||||||
if (obj.agentExeInfo.fileHash != null) { cmd.hash = obj.agentExeInfo.fileHashHex; } else { cmd.hash = obj.agentExeInfo.hashhex; }
|
if (obj.agentExeInfo.fileHash != null) { cmd.hash = obj.agentExeInfo.fileHashHex; } else { cmd.hash = obj.agentExeInfo.hashhex; }
|
||||||
|
|
||||||
// Add server TLS cert hash
|
// Add server TLS cert hash
|
||||||
if (parent.parent.args.ignoreagenthashcheck !== true) {
|
if (isIgnoreHashCheck() == false) {
|
||||||
const tlsCertHash = parent.webCertificateFullHashs[domain.id];
|
const tlsCertHash = parent.webCertificateFullHashs[domain.id];
|
||||||
if (tlsCertHash != null) { cmd.servertlshash = Buffer.from(tlsCertHash, 'binary').toString('hex'); }
|
if (tlsCertHash != null) { cmd.servertlshash = Buffer.from(tlsCertHash, 'binary').toString('hex'); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1344,7 +1344,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||||
|
|
||||||
// Add server TLS cert hash
|
// Add server TLS cert hash
|
||||||
var tlsCertHash = null;
|
var tlsCertHash = null;
|
||||||
if (parent.parent.args.ignoreagenthashcheck !== true) {
|
if ((parent.parent.args.ignoreagenthashcheck == null) || (parent.parent.args.ignoreagenthashcheck === false)) { // TODO: If ignoreagenthashcheck is an array of IP addresses, not sure how to handle this.
|
||||||
tlsCertHash = parent.webCertificateFullHashs[domain.id];
|
tlsCertHash = parent.webCertificateFullHashs[domain.id];
|
||||||
if (tlsCertHash != null) { command.servertlshash = Buffer.from(tlsCertHash, 'binary').toString('hex'); }
|
if (tlsCertHash != null) { command.servertlshash = Buffer.from(tlsCertHash, 'binary').toString('hex'); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -3432,7 +3432,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||||
|
|
||||||
// Instruct one of more agents to download a URL to a given local drive location.
|
// Instruct one of more agents to download a URL to a given local drive location.
|
||||||
var tlsCertHash = null;
|
var tlsCertHash = null;
|
||||||
if (parent.args.ignoreagenthashcheck !== true) {
|
if ((parent.args.ignoreagenthashcheck == null) || (parent.args.ignoreagenthashcheck === false)) { // TODO: If ignoreagenthashcheck is an array of IP addresses, not sure how to handle this.
|
||||||
tlsCertHash = obj.webCertificateFullHashs[cmd.domain.id];
|
tlsCertHash = obj.webCertificateFullHashs[cmd.domain.id];
|
||||||
if (tlsCertHash != null) { tlsCertHash = Buffer.from(tlsCertHash, 'binary').toString('hex'); }
|
if (tlsCertHash != null) { tlsCertHash = Buffer.from(tlsCertHash, 'binary').toString('hex'); }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue