New agentUpdateSystem setting to force meshcore agent update.

Ylian Saint-Hilaire committed Aug 10, 2021 at 12:23 UTC a5ec5f60c9de5ab2230d514c94f1e6f3eff75fcf
2 files changed +5 -3
meshagent.js
+1
@@ -1915,6 +1915,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1915 if (((agentExeInfo.id == 16) || (agentExeInfo.id == 29)) && (parent.parent.meshAgentBinaries[10005].hash == agentHash)) return 0;
1916
1917 // No match, update the agent.
1918 + if (args.agentupdatesystem === 2) return 2; // If set, force a meshcore update.
1919 // NOTE: Windows agents with no commit dates may have bad native update system, so use meshcore system instead.
1920 // 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.
1921 if (((obj.AgentCommitDate == null) || (obj.AgentCommitDate < 1612740413000)) && ((agentExeInfo.id == 3) || (agentExeInfo.id == 4))) return 2; // For older Windows agents, use the meshcore update technique.
meshcentral-config-schema.json
+4 -3
@@ -105,9 +105,10 @@
105 "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" },
106 "agentIdleTimeout": { "type": "integer", "minimum": 1, "default": 150 ,"description": "How much time in seconds with no traffic from an agent before dropping the agent connection." },
107 "compression": { "type": "boolean", "default": true, "description": "Enables GZIP compression for web requests." },
108 - "wscompression": { "type": "boolean", "default": false, "description": "Enables server-side, websocket per-message deflate compression." },
109 - "agentwscompression": { "type": "boolean", "default": true, "description": "Enables agent-side, websocket per-message deflate compression. wscompression must also be true for this to work." },
110 - "noagentupdate": { "type": "integer", "default": 0, "description": "Set to 1 to present the server from updating any agent." },
108 + "wsCompression": { "type": "boolean", "default": false, "description": "Enables server-side, websocket per-message deflate compression." },
109 + "agentWsCompression": { "type": "boolean", "default": true, "description": "Enables agent-side, websocket per-message deflate compression. wscompression must also be true for this to work." },
110 + "noAgentUpdate": { "type": "integer", "default": 0, "description": "Set to 1 to present the server from updating any agent." },
111 + "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." },
112 "temporaryAgentUpdate": { "type": "boolean", "default": true, "description": "Set to false to not allow temporary agents to be updated." },
113 "meshErrorLogPath": { "type": "string" },
114 "npmPath": { "type": "string" },