Improved user consent server configuration.

Ylian Saint-Hilaire committed Nov 27, 2020 at 09:23 UTC 76cd48105f7a6736ee01193033fb8bb73a55fec7
3 files changed +36 -3
meshcentral-config-schema.json
+14 -1
@@ -268,7 +268,20 @@
268 "agentAllowedIP": { "type": "string" },
269 "agentBlockedIP": { "type": "string" },
270 "userSessionIdleTimeout": { "type": "integer" },
271 - "userConsentFlags": { "type": "integer" },
271 + "userConsentFlags": {
272 + "type": "object",
273 + "additionalProperties": false,
274 + "description": "Use this section to require user consent for this domain.",
275 + "properties": {
276 + "desktopnotify": { "type": "boolean", "default": false, "description": "Enable desktop notification for this domain." },
277 + "terminalnotify": { "type": "boolean", "default": false, "description": "Enable terminal notification for this domain." },
278 + "filenotify": { "type": "boolean", "default": false, "description": "Enable files notification for this domain." },
279 + "desktopprompt": { "type": "boolean", "default": false, "description": "Enable desktop prompt for this domain." },
280 + "terminalprompt": { "type": "boolean", "default": false, "description": "Enable terminal user prompt for this domain." },
281 + "fileprompt": { "type": "boolean", "default": false, "description": "Enable files prompt for this domain." },
282 + "desktopprivacybar": { "type": "boolean", "default": false, "description": "Enable remote desktop privacy bar for this domain." }
283 + }
284 + },
285 "urlSwitching": { "type": "boolean" },
286 "desktopPrivacyBarText": { "type": "string" },
287 "limits": {
meshcentral.js
+13
@@ -1110,6 +1110,19 @@ function CreateMeshCentralServer(config, args) {
1110 } else {
1111 delete obj.config.domains[i].agentcustomization;
1112 }
1113 +
1114 + // Convert user consent flags
1115 + if (typeof obj.config.domains[i].userconsentflags == 'object') {
1116 + var flags = 0;
1117 + if (obj.config.domains[i].userconsentflags.desktopnotify == true) { flags |= 1; }
1118 + if (obj.config.domains[i].userconsentflags.terminalnotify == true) { flags |= 2; }
1119 + if (obj.config.domains[i].userconsentflags.filenotify == true) { flags |= 4; }
1120 + if (obj.config.domains[i].userconsentflags.desktopprompt == true) { flags |= 8; }
1121 + if (obj.config.domains[i].userconsentflags.terminalprompt == true) { flags |= 16; }
1122 + if (obj.config.domains[i].userconsentflags.fileprompt == true) { flags |= 32; }
1123 + if (obj.config.domains[i].userconsentflags.desktopprivacybar == true) { flags |= 64; }
1124 + obj.config.domains[i].userconsentflags = flags;
1125 + }
1126 }
1127
1128 // Log passed arguments into Windows Service Log
sample-config-advanced.json
+9 -2
@@ -192,8 +192,15 @@
192 "_orphanAgentUser": "admin",
193 "___userSessionIdleTimeout__": "Number of user idle minutes before auto-disconnect",
194 "_userSessionIdleTimeout": 30,
195 - "__userConsentFlags__": "Set to: 1 for desktop, 2 for terminal, 3 for files, 7 for all",
196 - "_userConsentFlags": 7,
195 + "userConsentFlags": {
196 + "desktopnotify": true,
197 + "terminalnotify": true,
198 + "filenotify": true,
199 + "desktopprompt": true,
200 + "terminalprompt": true,
201 + "fileprompt": true,
202 + "desktopprivacybar": true
203 + },
204 "_urlSwitching": false,
205 "_desktopPrivacyBarText": "Your privacy bar message",
206 "_limits": {