allow setting meshcentral assistant type for agentinvites (#5672)

* allow setting meshcentral assistant type for agentinvites

Signed-off-by: si458 <simonsmith5521@gmail.com>

* forgot webserver for assistantTypeAgentInvite

Signed-off-by: si458 <simonsmith5521@gmail.com>

* dont use capital letters with domain args

Signed-off-by: si458 <simonsmith5521@gmail.com>

---------

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2024-01-08 06:21:54 +00:00 committed by GitHub
parent bb616903ee
commit e967f00977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View File

@ -1389,6 +1389,11 @@
}
}
},
"assistantTypeAgentInvite": {
"type": "integer",
"default": 0,
"description": "0 = System Tray, Connect on user request, 1 = System Tray, Always Connected, 2 = Application, Connect on user request, 3 = Application, Always connected, 4 = System Tray, Monitor Only"
},
"certUrl": {
"type": "string",
"format": "uri",

View File

@ -248,6 +248,7 @@
}
]
},
"_assistantTypeAgentInvite": 2,
"PreconfiguredScripts": [
{
"name": "Run NotePad as user",

View File

@ -389,7 +389,7 @@
QH('unlinuxinstall', linuxUnInstall);
// MeshCentral Assistant
url = 'meshagents?id=10006&meshid=' + meshid;
url = 'meshagents?id=10006&meshid=' + meshid + '&ac={{{assistanttype}}}';
Q('assisturl').href = url;
// Android Setup

View File

@ -2255,7 +2255,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
var magenturl = 'mc://' + agentServerName + ((agentHttpsPort != 443) ? (':' + agentHttpsPort) : '') + ((xdomain != '') ? ('/' + xdomain) : '') + ',' + obj.agentCertificateHashBase64 + ',' + mesh._id.split('/')[2];
var meshcookie = parent.encodeCookie({ m: mesh._id.split('/')[2] }, parent.invitationLinkEncryptionKey);
render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: meshcookie, serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: 1, servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name).replace(/'/g, '%27'), installflags: installflags, showagents: showagents, magenturl: magenturl }, req, domain));
render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: meshcookie, serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: 1, servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name).replace(/'/g, '%27'), installflags: installflags, showagents: showagents, magenturl: magenturl, assistanttype: (domain.assistanttypeagentinvite ? domain.assistanttypeagentinvite : 0) }, req, domain));
} else if (req.query.m != null) {
// The MeshId is specified in the query string, use that
var mesh = obj.meshes['mesh/' + domain.id + '/' + req.query.m.toLowerCase()];
@ -2278,7 +2278,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
var magenturl = 'mc://' + agentServerName + ((agentHttpsPort != 443) ? (':' + agentHttpsPort) : '') + ((xdomain != '') ? ('/' + xdomain) : '') + ',' + obj.agentCertificateHashBase64 + ',' + mesh._id.split('/')[2];
var meshcookie = parent.encodeCookie({ m: mesh._id.split('/')[2] }, parent.invitationLinkEncryptionKey);
render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: meshcookie, serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: 1, servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name).replace(/'/g, '%27'), installflags: installflags, showagents: showagents, magenturl: magenturl }, req, domain));
render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: meshcookie, serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: 1, servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name).replace(/'/g, '%27'), installflags: installflags, showagents: showagents, magenturl: magenturl, assistanttype: (domain.assistanttypeagentinvite ? domain.assistanttypeagentinvite : 0) }, req, domain));
}
}