Added temporary agent update option.

Ylian Saint-Hilaire committed May 27, 2021 at 17:29 UTC 914d2414b66ea7af9bc8306e68043a25b7488d2c
2 files changed +4
meshagent.js
+2
@@ -1878,6 +1878,8 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1878 // Check if we need to update this agent, return true if agent binary update required.
1879 // Return 0 is no update needed, 1 update using native system, 2 update using meshcore system
1880 function compareAgentBinaryHash(agentExeInfo, agentHash) {
1881 + // If this is a temporary agent and the server is set to not update temporary agents, don't update the agent.
1882 + if ((obj.agentInfo.capabilities & 0x20) && (args.temporaryagentupdate === false)) return 0;
1883 // If we are testing the agent update system, always return true
1884 if ((args.agentupdatetest === true) || (args.agentupdatetest === 1)) return 1;
1885 if (args.agentupdatetest === 2) return 2;
meshcentral-config-schema.json
+2
@@ -106,6 +106,8 @@
106 "compression": { "type": "boolean", "default": true, "description": "Enables GZIP compression for web requests." },
107 "wscompression": { "type": "boolean", "default": false, "description": "Enables server-side, websocket per-message deflate compression." },
108 "agentwscompression": { "type": "boolean", "default": true, "description": "Enables agent-side, websocket per-message deflate compression. wscompression must also be true for this to work." },
109 + "noagentupdate": { "type": "integer", "default": 0, "description": "Set to 1 to present the server from updating any agent." },
110 + "temporaryAgentUpdate": { "type": "boolean", "default": true, "description": "Set to false to not allow temporary agents to be updated." },
111 "meshErrorLogPath": { "type": "string" },
112 "npmPath": { "type": "string" },
113 "npmProxy": { "type": "string", "format": "uri" },