diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 024828e0..d1de0888 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -99,8 +99,10 @@ "syslogjson": { "type": "string" }, "webrtcConfig": { "type": "object", + "additionalProperties": false, + "description": "The STUN servers used for WebRTC, if not specified the Google and Mozilla servers and used when the server is not in LAN mode.", "properties": { - "iceServers": { "type": "array", "uniqueItems": true, "items": { "type": "object", "properties": { "urls": { "type": "string" } }, "required": [ "urls" ] } } + "iceServers": { "type": "array", "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, "properties": { "urls": { "type": "string" } }, "required": [ "urls" ] } } }, "required": [ "iceServers" ] }, diff --git a/meshcentral.js b/meshcentral.js index 3baad577..df0e90a1 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -1141,6 +1141,7 @@ function CreateMeshCentralServer(config, args) { if (obj.args.redirport == null) obj.args.redirport = 80; if (obj.args.minifycore === 0) obj.args.minifycore = false; if (typeof args.agentidletimeout != 'number') { args.agentidletimeout = 150000; } else { args.agentidletimeout *= 1000 } // Default agent idle timeout is 2m, 30sec. + if ((obj.args.lanonly != true) && (obj.args.webrtconfig == null)) { obj.args.webrtconfig = { iceservers: [{ urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:stun.services.mozilla.com' }] }; } // Setup default WebRTC STUN servers // Setup a site administrator if ((obj.args.admin) && (typeof obj.args.admin == 'string')) {