From a5ec5f60c9de5ab2230d514c94f1e6f3eff75fcf Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 10 Aug 2021 12:23:28 -0700 Subject: [PATCH] New agentUpdateSystem setting to force meshcore agent update. --- meshagent.js | 1 + meshcentral-config-schema.json | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/meshagent.js b/meshagent.js index a9362b84..5bf163c1 100644 --- a/meshagent.js +++ b/meshagent.js @@ -1915,6 +1915,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { if (((agentExeInfo.id == 16) || (agentExeInfo.id == 29)) && (parent.parent.meshAgentBinaries[10005].hash == agentHash)) return 0; // No match, update the agent. + if (args.agentupdatesystem === 2) return 2; // If set, force a meshcore update. // NOTE: Windows agents with no commit dates may have bad native update system, so use meshcore system instead. // NOTE: Windows agents with commit date prior to 1612740413000 did not kill all "meshagent.exe" processes and update could fail as a result executable being locked, meshcore system will do this. if (((obj.AgentCommitDate == null) || (obj.AgentCommitDate < 1612740413000)) && ((agentExeInfo.id == 3) || (agentExeInfo.id == 4))) return 2; // For older Windows agents, use the meshcore update technique. diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 63680046..819c5aed 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -105,9 +105,10 @@ "orphanAgentUser": { "type": "string", "default": null, "description": "If an agent attempts to connect to a unknown device group, automatically create a new device group and grant access to the specified user. Example: admin" }, "agentIdleTimeout": { "type": "integer", "minimum": 1, "default": 150 ,"description": "How much time in seconds with no traffic from an agent before dropping the agent connection." }, "compression": { "type": "boolean", "default": true, "description": "Enables GZIP compression for web requests." }, - "wscompression": { "type": "boolean", "default": false, "description": "Enables server-side, websocket per-message deflate compression." }, - "agentwscompression": { "type": "boolean", "default": true, "description": "Enables agent-side, websocket per-message deflate compression. wscompression must also be true for this to work." }, - "noagentupdate": { "type": "integer", "default": 0, "description": "Set to 1 to present the server from updating any agent." }, + "wsCompression": { "type": "boolean", "default": false, "description": "Enables server-side, websocket per-message deflate compression." }, + "agentWsCompression": { "type": "boolean", "default": true, "description": "Enables agent-side, websocket per-message deflate compression. wscompression must also be true for this to work." }, + "noAgentUpdate": { "type": "integer", "default": 0, "description": "Set to 1 to present the server from updating any agent." }, + "agentUpdateSystem": { "type": "integer", "default": 1, "description": "When set to 2, all agents that need to be updated will use the meshcore.js update system. With the default value of 1, the native update system is used." }, "temporaryAgentUpdate": { "type": "boolean", "default": true, "description": "Set to false to not allow temporary agents to be updated." }, "meshErrorLogPath": { "type": "string" }, "npmPath": { "type": "string" },