From 914d2414b66ea7af9bc8306e68043a25b7488d2c Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 27 May 2021 17:29:22 -0700 Subject: [PATCH] Added temporary agent update option. --- meshagent.js | 2 ++ meshcentral-config-schema.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/meshagent.js b/meshagent.js index ca5cbd6c..af809803 100644 --- a/meshagent.js +++ b/meshagent.js @@ -1878,6 +1878,8 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { // Check if we need to update this agent, return true if agent binary update required. // Return 0 is no update needed, 1 update using native system, 2 update using meshcore system function compareAgentBinaryHash(agentExeInfo, agentHash) { + // If this is a temporary agent and the server is set to not update temporary agents, don't update the agent. + if ((obj.agentInfo.capabilities & 0x20) && (args.temporaryagentupdate === false)) return 0; // If we are testing the agent update system, always return true if ((args.agentupdatetest === true) || (args.agentupdatetest === 1)) return 1; if (args.agentupdatetest === 2) return 2; diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index a15830a7..dbde110c 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -106,6 +106,8 @@ "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." }, + "temporaryAgentUpdate": { "type": "boolean", "default": true, "description": "Set to false to not allow temporary agents to be updated." }, "meshErrorLogPath": { "type": "string" }, "npmPath": { "type": "string" }, "npmProxy": { "type": "string", "format": "uri" },