Added temporary agent update option.

This commit is contained in:
Ylian Saint-Hilaire 2021-05-27 17:29:22 -07:00
parent 9838b52f8a
commit 914d2414b6
2 changed files with 4 additions and 0 deletions

View File

@ -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;

View File

@ -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" },