Added first version of JSON schema for config.json.

Ylian Saint-Hilaire committed Jun 15, 2020 at 06:37 UTC 6fb2544ad826a8525d4cc4f86995938b706a3f9b
4 files changed +448 -15
MeshCentralServer.njsproj
+1
@@ -227,6 +227,7 @@
227 <Content Include="agents\MeshService64.pdb" />
228 <Content Include="CreateSourcePackage.bat" />
229 <Content Include="LICENSE" />
230 + <Content Include="meshcentral-config-schema.json" />
231 <Content Include="package.json" />
232 <Content Include="plugin_development.md" />
233 <Content Include="public\clickonce\minirouter\Application Files\MeshMiniRouter_1_0_0_70\MeshMiniRouter.application" />
meshcentral-config-schema.json new
+412
@@ -0,0 +1,412 @@
1 +{
2 + "id": "http://info.meshcentral.com/download/meshcentral-config-schema.json",
3 + "$schema": "http://json-schema.org/draft-04/schema#",
4 + "description": "MeshCentral configuration file schema",
5 + "type": "object",
6 + "properties": {
7 + "settings": {
8 + "type": "object",
9 + "properties": {
10 + "Cert": { "type": "string" },
11 + "MongoDb": { "type": "string" },
12 + "MongoDbName": { "type": "string" },
13 + "MongoDbChangeStream": { "type": "boolean" },
14 + "MongoDumpPath": { "type": "string" },
15 + "WANonly": { "type": "boolean", "default": false },
16 + "LANonly": { "type": "boolean", "default": false },
17 + "SessionTime": { "type": "integer" },
18 + "SessionKey": { "type": "string" },
19 + "SessionSameSite": { "type": "string" },
20 + "DbEncryptKey": { "type": "string" },
21 + "DbRecordsEncryptKey": { "type": "string" },
22 + "DbRecordsDecryptKey": { "type": "string" },
23 + "DbExpire": {
24 + "type": "object",
25 + "properties": {
26 + "events": { "type": "integer" },
27 + "powerevents": { "type": "integer" },
28 + "statsevents": { "type": "integer" }
29 + }
30 + },
31 + "Port": { "type": "integer", "minimum": 1, "maximum": 65535 },
32 + "PortBind": { "type": "string" },
33 + "AliasPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
34 + "RedirPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
35 + "RedirPortBind": { "type": "string" },
36 + "RedirAliasPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
37 + "AgentPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
38 + "AgentPortBind": { "type": "string" },
39 + "AgentAliasPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
40 + "AgentAliasDNS": { "type": "string", "format": "hostname" },
41 + "AgentPortTls": { "type": "boolean", "default": true },
42 + "ExactPorts": { "type": "boolean", "default": false },
43 + "AllowLoginToken": { "type": "boolean", "default": false },
44 + "AllowFraming": { "type": "boolean", "default": false },
45 + "CookieIpCheck": { "type": "boolean" },
46 + "CookieEncoding": { "type": "string", "enum": [ "hex", "base64" ], "default": "base64" },
47 + "WebRTC": { "type": "boolean", "default": false },
48 + "Nice404": { "type": "boolean" },
49 + "ClickOnce": { "type": "boolean" },
50 + "SelfUpdate": { "type": "boolean", "default": false, "description": "When true, this server will attempt to self-update everyday after midnight." },
51 + "BrowserPing": { "type": "integer", "minimum": 1, "description": "When specified, sends data to the browser at x seconds interval and expects a response from the browser." },
52 + "BrowserPong": { "type": "integer", "minimum": 1, "description": "When specified, sends data to the browser at x seconds interval." },
53 + "AgentPing": { "type": "integer", "minimum": 1, "description": "When specified, sends data to the agent at x seconds interval and expects a response from the agent." },
54 + "AgentPong": { "type": "integer", "minimum": 1, "description": "When specified, sends data to the agent at x seconds interval." },
55 + "AgentIdleTimeout": { "type": "integer", "minimum": 1 },
56 + "MeshErrorLogPath": { "type": "string" },
57 + "NpmPath": { "type": "string" },
58 + "NpmProxy": { "type": "string" },
59 + "AllowHighQualityDesktop": { "type": "boolean" },
60 + "DesktopMultiplex": { "type": "boolean" },
61 + "UserAllowedIP": { "type": "string" },
62 + "UserBlockedIP": { "type": "string" },
63 + "AgentAllowedIP": { "type": "string" },
64 + "AgentBlockedIP": { "type": "string" },
65 + "AuthLog": { "type": "string" },
66 + "ManageAllDeviceGroups": { "type": "array", "items": [ { "type": "string" } ] },
67 + "ManageCrossDomain": { "type": "array", "items": [ { "type": "string" } ] },
68 + "LocalDiscovery": {
69 + "type": "object",
70 + "additionalProperties": false,
71 + "properties": {
72 + "name": { "type": "string" },
73 + "info": { "type": "string" }
74 + },
75 + "required": [ "name", "info" ]
76 + },
77 + "TlsOffload": { "type": "string" },
78 + "TrustedProxy": { "type": "string" },
79 + "MpsPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
80 + "MpsPortBind": { "type": "string" },
81 + "MpsAliasPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
82 + "MpsAliasHost": { "type": "string" },
83 + "MpsTlsOffload": { "type": "boolean" },
84 + "No2FactorAuth": { "type": "boolean" },
85 + "Log": { "type": "string" },
86 + "syslog": { "type": "string" },
87 + "syslogauth": { "type": "string" },
88 + "syslogjson": { "type": "string" },
89 + "WebRtConfig": {
90 + "type": "object",
91 + "properties": {
92 + "iceServers": {
93 + "type": "array",
94 + "items": [ { "type": "object", "properties": { "urls": { "type": "string" } }, "required": [ "urls" ] } ]
95 + }
96 + },
97 + "required": [ "iceServers" ]
98 + },
99 + "AutoBackup": {
100 + "type": "object",
101 + "properties": {
102 + "backupIntervalHours": { "type": "integer" },
103 + "keepLastDaysBackup": { "type": "integer" },
104 + "zipPassword": { "type": "string" },
105 + "backupPath": { "type": "string" }
106 + }
107 + },
108 + "Redirects": { "type": "object" },
109 + "MaxInvalidLogin": {
110 + "type": "object",
111 + "additionalProperties": false,
112 + "properties": {
113 + "time": { "type": "integer" },
114 + "count": { "type": "integer" },
115 + "coolofftime": { "type": "integer" }
116 + }
117 + },
118 + "Plugins": {
119 + "type": "object",
120 + "properties": { "enabled": { "type": "boolean" } },
121 + "required": [ "enabled" ]
122 + }
123 + }
124 + },
125 + "domaindefaults": { "type": "object" },
126 + "domains": {
127 + "type": "object",
128 + "properties": {
129 + "": {
130 + "type": "object",
131 + "properties": {
132 + "Title": { "type": "string" },
133 + "Title2": { "type": "string" },
134 + "TitlePicture": { "type": "string" },
135 + "UserQuota": { "type": "integer" },
136 + "MeshQuota": { "type": "integer" },
137 + "Minify": { "type": "boolean" },
138 + "NewAccounts": { "type": "boolean" },
139 + "NewAccountsUserGroups": { "type": "array", "items": [ { "type": "string" } ] },
140 + "UserNameIsEmail": { "type": "boolean" },
141 + "NewAccountEmailDomains": { "type": "array", "items": [ { "type": "string" } ] },
142 + "NewAccountsRights": { "type": "array", "items": [ { "type": "string" } ] },
143 + "WelcomeText": { "type": "string" },
144 + "WelcomePicture": { "type": "string" },
145 + "Hide": { "type": "integer" },
146 + "Footer": { "type": "string" },
147 + "CertUrl": { "type": "string", "format": "uri" },
148 + "PasswordRequirements": {
149 + "type": "object",
150 + "properties": {
151 + "min": { "type": "integer" },
152 + "max": { "type": "integer" },
153 + "upper": { "type": "integer" },
154 + "lower": { "type": "integer" },
155 + "numeric": { "type": "integer" },
156 + "nonalpha": { "type": "integer" },
157 + "reset": { "type": "integer" },
158 + "force2factor": { "type": "boolean" },
159 + "skip2factor": { "type": "string" }
160 + }
161 + },
162 + "AgentInviteCodes": { "type": "boolean", "default": false },
163 + "AgentNoProxy": { "type": "boolean", "default": false },
164 + "GeoLocation": { "type": "boolean", "default": false },
165 + "novnc": { "type": "boolean", "default": true },
166 + "mstsc": {
167 + "type": "boolean",
168 + "default": false
169 + },
170 + "CustomUI": { "type": "object" },
171 + "ConsentMessages": {
172 + "type": "object",
173 + "additionalProperties": false,
174 + "properties": {
175 + "Title": { "type": "string" },
176 + "Desktop": { "type": "string" },
177 + "Terminal": { "type": "string" },
178 + "Files": { "type": "string" }
179 + }
180 + },
181 + "NotificationMessages": {
182 + "type": "object",
183 + "additionalProperties": false,
184 + "properties": {
185 + "Title": { "type": "string" },
186 + "Desktop": { "type": "string" },
187 + "Terminal": { "type": "string" },
188 + "Files": { "type": "string" }
189 + }
190 + },
191 + "UserAllowedIP": { "type": "string" },
192 + "UserBlockedIP": { "type": "string" },
193 + "AgentAllowedIP": { "type": "string" },
194 + "AgentBlockedIP": { "type": "string" },
195 + "UserSessionIdleTimeout": { "type": "integer" },
196 + "UserConsentFlags": { "type": "integer" },
197 + "UrlSwitching": { "type": "boolean" },
198 + "DesktopPrivacyBarText": { "type": "string" },
199 + "Limits": {
200 + "type": "object",
201 + "properties": {
202 + "MaxDevices": { "type": "integer" },
203 + "MaxUserAccounts": { "type": "integer" },
204 + "MaxUserSessions": { "type": "integer" },
205 + "MaxAgentSessions": { "type": "integer" },
206 + "MaxSingleUserSessions": { "type": "integer" }
207 + }
208 + },
209 + "AmtAcmActivation": {
210 + "type": "object",
211 + "properties": {
212 + "log": { "type": "string" },
213 + "certs": {
214 + "type": "object",
215 + "additionalProperties": {
216 + "type": "object",
217 + "properties": {
218 + "certfiles": { "type": "array", "items": [ { "type": "string" } ] },
219 + "keyfile": { "type": "string" }
220 + },
221 + "required": [ "certfiles", "keyfile" ]
222 + }
223 + }
224 + }
225 + },
226 + "Redirects": {
227 + "type": "object",
228 + "additionalProperties": { "type": "string" }
229 + },
230 + "Yubikey": {
231 + "type": "object",
232 + "properties": {
233 + "id": { "type": "string" },
234 + "secret": { "type": "string" },
235 + "proxy": { "type": "string" }
236 + },
237 + "required": [ "id", "secret" ]
238 + },
239 + "AgentConfig": {
240 + "type": "array",
241 + "items": [ { "type": "string" } ]
242 + },
243 + "SessionRecording": {
244 + "type": "object",
245 + "properties": {
246 + "filepath": { "type": "string" },
247 + "index": { "type": "boolean", "default": false },
248 + "maxRecordings": { "type": "integer" },
249 + "maxRecordingSizeMegabytes": { "type": "integer" },
250 + "protocols": {
251 + "type": "array",
252 + "items": [ { "type": "integer" } ]
253 + }
254 + },
255 + "required": [ "protocols" ]
256 + },
257 + "AuthStrategies": {
258 + "type": "object",
259 + "additionalProperties": false,
260 + "properties": {
261 + "twitter": {
262 + "type": "object",
263 + "additionalProperties": false,
264 + "properties": {
265 + "callbackurl": { "type": "string", "format": "uri" },
266 + "newAccounts": { "type": "boolean" },
267 + "newAccountsUserGroups": { "type": "array", "items": [ { "type": "string" } ] },
268 + "clientid": { "type": "string" },
269 + "clientsecret": { "type": "string" }
270 + },
271 + "required": [ "clientid", "clientsecret" ]
272 + },
273 + "google": {
274 + "type": "object",
275 + "properties": {
276 + "callbackurl": { "type": "string", "format": "uri" },
277 + "newAccounts": { "type": "boolean" },
278 + "newAccountsUserGroups": { "type": "array", "items": [ { "type": "string" } ] },
279 + "clientid": { "type": "string" },
280 + "clientsecret": { "type": "string" }
281 + },
282 + "required": [ "clientid", "clientsecret" ]
283 + },
284 + "github": {
285 + "type": "object",
286 + "properties": {
287 + "callbackurl": { "type": "string", "format": "uri" },
288 + "newAccounts": { "type": "boolean" },
289 + "newAccountsUserGroups": { "type": "array", "items": [ { "type": "string" } ] },
290 + "clientid": { "type": "string" },
291 + "clientsecret": { "type": "string" }
292 + },
293 + "required": [ "clientid", "clientsecret" ]
294 + },
295 + "reddit": {
296 + "type": "object",
297 + "properties": {
298 + "callbackurl": { "type": "string", "format": "uri" },
299 + "newAccounts": { "type": "boolean" },
300 + "newAccountsUserGroups": { "type": "array", "items": [ { "type": "string" } ] },
301 + "clientid": { "type": "string" },
302 + "clientsecret": { "type": "string" }
303 + },
304 + "required": [ "clientid", "clientsecret" ]
305 + },
306 + "azure": {
307 + "type": "object",
308 + "properties": {
309 + "callbackurl": { "type": "string", "format": "uri" },
310 + "newAccounts": { "type": "boolean" },
311 + "newAccountsUserGroups": { "type": "array", "items": [ { "type": "string" } ] },
312 + "clientid": { "type": "string" },
313 + "clientsecret": { "type": "string" },
314 + "tenantid": { "type": "string" }
315 + },
316 + "required": [ "clientid", "clientsecret", "tenantid" ]
317 + },
318 + "jumpcloud": {
319 + "type": "object",
320 + "properties": {
321 + "callbackurl": { "type": "string", "format": "uri" },
322 + "newAccounts": { "type": "boolean" },
323 + "newAccountsUserGroups": { "type": "array", "items": [ { "type": "string" } ] },
324 + "entityid": { "type": "string" },
325 + "idpurl": { "type": "string" },
326 + "cert": { "type": "string" }
327 + },
328 + "required": [ "entityid", "idpurl", "cert" ]
329 + },
330 + "saml": {
331 + "type": "object",
332 + "properties": {
333 + "callbackurl": { "type": "string", "format": "uri" },
334 + "disableRequestedAuthnContext": { "type": "boolean" },
335 + "newAccounts": { "type": "boolean" },
336 + "newAccountsUserGroups": { "type": "array", "items": [ { "type": "string" } ] },
337 + "newAccountsRights": { "type": "array", "items": [ { "type": "string" } ] },
338 + "entityid": { "type": "string" },
339 + "idpurl": { "type": "string" },
340 + "cert": { "type": "string" }
341 + },
342 + "required": [ "entityid", "idpurl", "cert" ]
343 + }
344 + }
345 + }
346 + }
347 + }
348 + }
349 + },
350 + "letsencrypt": {
351 + "title" : "Built-in Let's Encrypt support",
352 + "description": "If your server has a proper DNS name and it public facing on the Internet with a public facing HTTP server on port 80, you can get a free TLS certificate.",
353 + "type": "object",
354 + "additionalProperties": false,
355 + "properties": {
356 + "email": { "type": "string", "format": "email" },
357 + "names": { "type": "string" },
358 + "production": { "type": "boolean" }
359 + },
360 + "required": [ "email", "names", "production" ]
361 + },
362 + "peers": {
363 + "title" : "Server peering",
364 + "description": "Setup peer server for load-balancing between many servers.",
365 + "type": "object",
366 + "minProperties": 1,
367 + "propertyNames": { "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
368 + "additionalProperties": false,
369 + "properties": {
370 + "serverId": { "type": "string" },
371 + "servers": {
372 + "type": "object",
373 + "additionalProperties": {
374 + "type": "object",
375 + "properties": { "url": { "type": "string", "format": "uri" } },
376 + "required": [ "url" ]
377 + }
378 + }
379 + },
380 + "required": [ "serverId", "servers" ]
381 + },
382 + "smtp": {
383 + "title" : "Email server",
384 + "description": "Connects MeshCentral to a email server, allows MeshCentral to send email messages for 2FA or user notification",
385 + "type": "object",
386 + "properties": {
387 + "host": { "type": "string", "format": "hostname" },
388 + "port": { "type": "integer", "minimum": 1, "maximum": 65535 },
389 + "from": { "type": "string", "format": "email" },
390 + "tls": { "type": "boolean" },
391 + "tlscertcheck": { "type": "boolean" },
392 + "tlsstrict": { "type": "boolean" }
393 + },
394 + "required": [ "host", "port", "from", "tls" ]
395 + },
396 + "sms": {
397 + "title" : "SMS provider",
398 + "description": "Connects MeshCentral to a SMS text messaging provider, allows MeshCentral to send SMS messages for 2FA or user notification",
399 + "type": "object",
400 + "properties": {
401 + "provider": { "type": "string", "enum": [ "twilio", "plivo" ] },
402 + "id": { "type": "string" },
403 + "sid": { "type": "string" },
404 + "token": { "type": "string" },
405 + "from": { "type": "string" }
406 + },
407 + "required": [ "provider", "token", "from" ]
408 + }
409 + },
410 + "required": [ "settings", "domains" ]
411 +}
412 +
sample-config-advanced.json
+32 -13
@@ -1,5 +1,6 @@
1 {
2 - "__comment__" : "This is a sample configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
2 + "$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json",
3 + "__comment__": "This is a sample configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
4 "settings": {
5 "_Cert": "myserver.mydomain.com",
6 "_MongoDb": "mongodb://127.0.0.1:27017",
@@ -89,7 +90,11 @@
90 "meshcommander": "https://www.meshcommander.com/"
91 },
92 "__MaxInvalidLogin": "Time in minutes, max amount of bad logins from a source IP in the time before logins are rejected.",
92 - "_MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 },
93 + "_MaxInvalidLogin": {
94 + "time": 10,
95 + "count": 10,
96 + "coolofftime": 10
97 + },
98 "_Plugins": { "enabled": true }
99 },
100 "_domaindefaults": {
@@ -117,7 +122,17 @@
122 "_Hide": 4,
123 "_Footer": "<a href='https://twitter.com/mytwitter'>Twitter</a>",
124 "_CertUrl": "https://192.168.2.106:443/",
120 - "_PasswordRequirements": { "min": 8, "max": 128, "upper": 1, "lower": 1, "numeric": 1, "nonalpha": 1, "reset": 90, "force2factor": true, "skip2factor": "127.0.0.1,192.168.2.0/24" },
125 + "_PasswordRequirements": {
126 + "min": 8,
127 + "max": 128,
128 + "upper": 1,
129 + "lower": 1,
130 + "numeric": 1,
131 + "nonalpha": 1,
132 + "reset": 90,
133 + "force2factor": true,
134 + "skip2factor": "127.0.0.1,192.168.2.0/24"
135 + },
136 "_AgentInviteCodes": true,
137 "_AgentNoProxy": true,
138 "_GeoLocation": true,
@@ -139,10 +154,10 @@
154 "_UserBlockedIP": "127.0.0.1,::1,192.168.0.100",
155 "_AgentAllowedIP": "192.168.0.100/24",
156 "_AgentBlockedIP": "127.0.0.1,::1",
142 - "___UserSessionIdleTimeout__" : "Number of user idle minutes before auto-disconnect",
143 - "_UserSessionIdleTimeout" : 30,
144 - "__UserConsentFlags__" : "Set to: 1 for desktop, 2 for terminal, 3 for files, 7 for all",
145 - "_UserConsentFlags" : 7,
157 + "___UserSessionIdleTimeout__": "Number of user idle minutes before auto-disconnect",
158 + "_UserSessionIdleTimeout": 30,
159 + "__UserConsentFlags__": "Set to: 1 for desktop, 2 for terminal, 3 for files, 7 for all",
160 + "_UserConsentFlags": 7,
161 "_UrlSwitching": false,
162 "_DesktopPrivacyBarText": "Your privacy bar message",
163 "_Limits": {
@@ -164,7 +179,11 @@
179 "_Redirects": {
180 "meshcommander": "https://www.meshcommander.com/"
181 },
167 - "_yubikey": { "id": "0000", "secret": "xxxxxxxxxxxxxxxxxxxxx", "_proxy": "http://myproxy.domain.com:80" },
182 + "_yubikey": {
183 + "id": "0000",
184 + "secret": "xxxxxxxxxxxxxxxxxxxxx",
185 + "_proxy": "http://myproxy.domain.com:80"
186 + },
187 "_httpheaders": {
188 "Strict-Transport-Security": "max-age=360000",
189 "x-frame-options": "SAMEORIGIN",
@@ -180,7 +199,7 @@
199 "protocols": [ 1, 2, 101 ]
200 },
201 "_authStrategies": {
183 - "__comment__" : "This section is used to allow users to login using other accounts. You will need to get an API key from the services and register callback URL's",
202 + "__comment__": "This section is used to allow users to login using other accounts. You will need to get an API key from the services and register callback URL's",
203 "twitter": {
204 "_callbackurl": "https://server/auth-twitter-callback",
205 "newAccounts": true,
@@ -311,9 +330,9 @@
330 "from": "+1-555-555-5555"
331 },
332 "__sms": {
314 - "provider": "plivo",
315 - "id": "xxxxxxx",
316 - "token": "xxxxxxx",
317 - "from": "1-555-555-5555"
333 + "provider": "plivo",
334 + "id": "xxxxxxx",
335 + "token": "xxxxxxx",
336 + "from": "1-555-555-5555"
337 }
338 }
sample-config.json
+3 -2
@@ -1,6 +1,7 @@
1 {
2 - "__comment1__" : "This is a simple configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
3 - "__comment2__" : "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
2 + "$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json",
3 + "__comment1__": "This is a simple configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
4 + "__comment2__": "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
5 "settings": {
6 "_Cert": "myserver.mydomain.com",
7 "_WANonly": true,