diff --git a/agents/hashagents.js b/agents/hashagents.js index acac8779..e04359c0 100644 --- a/agents/hashagents.js +++ b/agents/hashagents.js @@ -12,7 +12,7 @@ var agents = { 'meshagent_osx-x86-64': 16, 'meshagent_poky64': 18, 'meshagent_x86_nokvm': 19, - 'meshagent_x86-64_nokvm': 20, + 'meshagent_x86-64_nokvm': 20, 'meshagent_arm-linaro': 24, 'meshagent_armhf': 25, 'meshagent_arm64': 26, diff --git a/agents/meshcore.js b/agents/meshcore.js index 5e841cfd..ae067b0b 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -979,7 +979,7 @@ function createMeshCore(agent) { } case 'setclip': { // Set the load clipboard to a user value - //sendConsoleText('setClip: ' + JSON.stringify(data)); + sendConsoleText('setClip: ' + JSON.stringify(data)); if (typeof data.data == 'string') { MeshServerLogEx(22, [data.data.length], "Setting clipboard content, " + data.data.length + " byte(s)", data); if (require('MeshAgent').isService) { require('clipboard').dispatchWrite(data.data); } else { require("clipboard")(data.data); } // Set the clipboard diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 8bd2138c..2f82ea0c 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -167,7 +167,7 @@ "meshQuota": { "type": "integer" }, "loginKey": { "type": [ "string", "array" ], "items": { "type": "string" }, "default": null, "description": "Requires that users add the value ?key=xxx in the URL in order to see the web site." }, "minify": { "type": "boolean", "default": false, "description": "When enabled, the server will send reduced sided web pages." }, - "newAccounts": { "type": "boolean" }, + "newAccounts": { "type": "boolean", "default": false, "description": "When set to true, allow new user accounts to be created from the login page." }, "newAccountsUserGroups": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }, "userNameIsEmail": { "type": "boolean", "default": false, "description": "When enabled, the username of each account is also the email address of the account." }, "newAccountEmailDomains": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }, @@ -177,6 +177,7 @@ "hide": { "type": "integer", "default": 0 }, "footer": { "type": "string", "default": null, "description": "This is a HTML string displayed at the bottom of the web page when a user is logged in." }, "loginfooter": { "type": "string", "default": null, "description": "This is a HTML string displayed at the bottom of the web page when a user is not logged in." }, + "guestDeviceSharing": { "type": "boolean", "default": true, "description": "When set to false, the desktop/terminal sharing link feature is not available." }, "certUrl": { "type": "string", "format": "uri", diff --git a/meshuser.js b/meshuser.js index 25120c6c..109844c6 100644 --- a/meshuser.js +++ b/meshuser.js @@ -460,6 +460,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use } serverinfo.https = true; serverinfo.redirport = args.redirport; + if (domain.guestdevicesharing === false) { serverinfo.guestdevicesharing = false; } if (typeof domain.userconsentflags == 'number') { serverinfo.consent = domain.userconsentflags; } if ((typeof domain.usersessionidletimeout == 'number') && (domain.usersessionidletimeout > 0)) { serverinfo.timeout = (domain.usersessionidletimeout * 60 * 1000); } if (user.siteadmin === SITERIGHT_ADMIN) { @@ -4682,6 +4683,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use break; } case 'deviceShares': { + if (domain.guestdevicesharing === false) return; // This feature is not allowed. var err = null; // Argument validation @@ -4733,6 +4735,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use break; } case 'removeDeviceShare': { + if (domain.guestdevicesharing === false) return; // This feature is not allowed. var err = null; // Argument validation @@ -4797,6 +4800,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use break; } case 'createDeviceShareLink': { + if (domain.guestdevicesharing === false) return; // This feature is not allowed. var err = null; // Argument validation diff --git a/sample-config-advanced.json b/sample-config-advanced.json index aef2d52e..38d1c409 100644 --- a/sample-config-advanced.json +++ b/sample-config-advanced.json @@ -127,6 +127,7 @@ "_userQuota": 1048576, "_meshQuota": 248576, "minify": true, + "_guestDeviceSharing" : false, "_loginKey": [ "abc", "123" ], "_newAccounts": true, "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ], diff --git a/views/default.handlebars b/views/default.handlebars index 8fb7427a..934f936b 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -5961,7 +5961,7 @@ x += ''; if ((connectivity & 1) && (meshrights & 8) && (node.agent.id != 14)) { x += ''; } //if ((connectivity & 1) && (meshrights & 8) && (node.agent.id < 5)) { x += ''; } - if ((node.agent!=null) && (node.agent.caps & 3) && (connectivity & 1) && (meshrights & 8) && ((meshrights == 0xFFFFFFFF) || ((meshrights & 4352) == 0))) { x += ''; } + if ((serverinfo.guestdevicesharing !== false) && (node.agent != null) && (node.agent.caps & 3) && (connectivity & 1) && (meshrights & 8) && ((meshrights == 0xFFFFFFFF) || ((meshrights & 4352) == 0))) { x += ''; } // Custom UI if ((customui != null) && (customui.devicebuttons != null)) { diff --git a/webserver.js b/webserver.js index fcdd47b4..74cb3a21 100644 --- a/webserver.js +++ b/webserver.js @@ -3033,6 +3033,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { const domain = getDomain(req, res); if (domain == null) { return; } if (req.query.c == null) { res.sendStatus(404); return; } + if (domain.guestdevicesharing === false) { res.sendStatus(404); return; } // This feature is not allowed. // Check the inbound desktop sharing cookie var c = obj.parent.decodeCookie(req.query.c, obj.parent.invitationLinkEncryptionKey, 60); // 60 minute timeout @@ -3071,6 +3072,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { const domain = getDomain(req, res); if (domain == null) { return; } if (req.query.c == null) { res.sendStatus(404); return; } + if (domain.guestdevicesharing === false) { res.sendStatus(404); return; } // This feature is not allowed. // Check the inbound desktop sharing cookie var c = obj.parent.decodeCookie(req.query.c, obj.parent.invitationLinkEncryptionKey, 60); // 60 minute timeout