New MeshAgents (except macOS and FreeBSD + Many fixes + MessageBox feature.

This commit is contained in:
Ylian Saint-Hilaire 2020-05-18 17:57:11 -07:00
parent cf69bf0169
commit 6a72d81a6d
29 changed files with 1601 additions and 1499 deletions

View File

@ -449,6 +449,7 @@
<Content Include="public\translate.bat" />
<Content Include="public\translator.htm" />
<Content Include="readme.md" />
<Content Include="sample-config-advanced.json" />
<Content Include="sample-config.json" />
<Content Include="SourceFileList.txt" />
<Content Include="translate\readme.txt" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -683,6 +683,15 @@ function createMeshCore(agent) {
}
break;
}
case 'messagebox': {
// Display a message box
if (data.title && data.msg) {
MeshServerLog("Displaying message box, title=" + data.title + ", message=" + data.msg, data);
data.msg = data.msg.split('\r').join('\\r').split('\n').join('\\n');
try { require('message-box').create(data.title, data.msg, 120); } catch (ex) { }
}
break;
}
case 'ps': {
// Return the list of running processes
if (data.sessionid) {

File diff suppressed because one or more lines are too long

View File

@ -107,14 +107,18 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
//if (obj.targetnode != null) obj.Debug("ProcessPictureMsg " + X + "," + Y + " - " + obj.targetnode.substring(0, 8));
var tile = new Image();
tile.xcount = obj.tilesReceived++;
//console.log('Tile #' + tile.xcount);
var r = obj.tilesReceived;
tile.src = "data:image/jpeg;base64," + btoa(String.fromCharCode.apply(null, data.slice(4)));
var r = obj.tilesReceived, tdata = data.slice(4), ptr = 0, strs = [];
// String.fromCharCode.apply() can't handle very large argument count, so we have to split like this.
while ((tdata.byteLength - ptr) > 50000) { strs.push(String.fromCharCode.apply(null, tdata.slice(ptr, ptr + 50000))); ptr += 50000; }
if (ptr > 0) { strs.push(String.fromCharCode.apply(null, tdata.slice(ptr))); } else { strs.push(String.fromCharCode.apply(null, tdata)); }
tile.src = "data:image/jpeg;base64," + btoa(strs.join(''));
tile.onload = function () {
//console.log('DecodeTile #' + this.xcount);
if (obj.Canvas != null && obj.KillDraw < r && obj.State != 0) {
if ((obj.Canvas != null) && (obj.KillDraw < r) && (obj.State != 0)) {
obj.PendingOperations.push([r, 2, tile, X, Y]);
while (obj.DoPendingOperations()) { }
} else {
obj.PendingOperations.push([r, 0]);
}
}
tile.error = function () { console.log('DecodeTileError'); }
@ -130,7 +134,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
obj.PendingOperations.splice(i, 1);
delete Msg;
obj.TilesDrawn++;
if (obj.TilesDrawn == obj.tilesReceived && obj.KillDraw < obj.TilesDrawn) { obj.KillDraw = obj.TilesDrawn = obj.tilesReceived = 0; }
if ((obj.TilesDrawn == obj.tilesReceived) && (obj.KillDraw < obj.TilesDrawn)) { obj.KillDraw = obj.TilesDrawn = obj.tilesReceived = 0; }
return true;
}
}
@ -164,6 +168,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
if (level) { obj.CompressionLevel = level; }
if (scaling) { obj.ScalingLevel = scaling; }
if (frametimer) { obj.FrameRateTimer = frametimer; }
//console.log('SendCompressionLevel', obj.CompressionLevel, obj.ScalingLevel, obj.FrameRateTimer);
obj.send(String.fromCharCode(0x00, 0x05, 0x00, 0x0A, type, obj.CompressionLevel) + obj.shortToStr(obj.ScalingLevel) + obj.shortToStr(obj.FrameRateTimer));
}

File diff suppressed because one or more lines are too long

View File

@ -74,7 +74,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
obj.xxOnControlCommand = function (msg) {
var controlMsg;
try { controlMsg = JSON.parse(msg); } catch (e) { return; }
if (controlMsg.ctrlChannel != '102938') { obj.xxOnSocketData(msg); return; }
if (controlMsg.ctrlChannel != '102938') { obj.m.ProcessData(msg); return; }
//console.log(controlMsg);
if ((typeof args != 'undefined') && args.redirtrace) { console.log('RedirRecv', controlMsg); }
if (controlMsg.type == 'console') {
@ -168,15 +168,38 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
}
// Control messages, most likely WebRTC setup
//console.log('New data', e.data.byteLength);
if (typeof e.data == 'string') {
obj.xxOnControlCommand(e.data);
} else {
// Send the data to the module
if (obj.m.ProcessBinaryCommand) {
// Send as Binary Command
var view = new Uint8Array(e.data), cmd = (view[0] << 8) + view[1], cmdsize = (view[2] << 8) + view[3];
if ((cmd == 27) && (cmdsize == 8)) { cmd = (view[8] << 8) + view[9]; cmdsize = (view[5] << 16) + (view[6] << 8) + view[7]; view = view.slice(8); }
if (cmdsize != view.byteLength) { console.log('REDIR-ERROR', cmd, cmdsize, view.byteLength); } else { obj.m.ProcessBinaryCommand(cmd, cmdsize, view); }
if (cmdAccLen != 0) {
// Accumulator is active
var view = new Uint8Array(e.data);
cmdAcc.push(view);
cmdAccLen += view.byteLength;
//console.log('Accumulating', cmdAccLen);
if (cmdAccCmdSize <= cmdAccLen) {
var tmp = new Uint8Array(cmdAccLen), tmpPtr = 0;
for (var i in cmdAcc) { tmp.set(cmdAcc[i], tmpPtr); tmpPtr += cmdAcc[i].byteLength; }
//console.log('AccumulatorCompleted');
obj.m.ProcessBinaryCommand(cmdAccCmd, cmdAccCmdSize, tmp);
cmdAccCmd = 0, cmdAccCmdSize = 0, cmdAccLen = 0, cmdAcc = [];
}
} else {
// Accumulator is not active
var view = new Uint8Array(e.data), cmd = (view[0] << 8) + view[1], cmdsize = (view[2] << 8) + view[3];
if ((cmd == 27) && (cmdsize == 8)) { cmd = (view[8] << 8) + view[9]; cmdsize = (view[5] << 16) + (view[6] << 8) + view[7]; view = view.slice(8); }
//console.log(cmdsize, view.byteLength);
if (cmdsize != view.byteLength) {
//console.log('AccumulatorRequired', cmd, cmdsize, view.byteLength);
cmdAccCmd = cmd; cmdAccCmdSize = cmdsize; cmdAccLen = view.byteLength, cmdAcc = [view];
} else {
obj.m.ProcessBinaryCommand(cmd, cmdsize, view);
}
}
} else if (obj.m.ProcessBinaryData) {
// Send as Binary
obj.m.ProcessBinaryData(new Uint8Array(e.data));
@ -187,6 +210,9 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
}
};
// Command accumulator, this is used for WebRTC fragmentation
var cmdAccCmd = 0, cmdAccCmdSize = 0, cmdAccLen = 0, cmdAcc = [];
obj.sendText = function (x) {
if (typeof x != 'string') { x = JSON.stringify(x); } // Turn into a string if needed
obj.send(encode_utf8(x)); // Encode UTF8 correctly

264
sample-config-advanced.json Normal file
View File

@ -0,0 +1,264 @@
{
"__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.",
"settings": {
"_Cert": "myserver.mydomain.com",
"_MongoDb": "mongodb://127.0.0.1:27017",
"_MongoDbName": "meshcentral",
"_MongoDbChangeStream": true,
"_MongoDumpPath": "C:\\Program Files\\MongoDB\\Server\\4.2\\bin\\mongodump.exe",
"_WANonly": true,
"_LANonly": true,
"_SessionTime": 30,
"_SessionKey": "MyReallySecretPassword1",
"_SessionSameSite": "strict",
"_DbEncryptKey": "MyReallySecretPassword2",
"_DbRecordsEncryptKey": "MyReallySecretPassword",
"_DbRecordsDecryptKey": "MyReallySecretPassword",
"__DbExpire": "Amount of time to keep various events in the database, in seconds. Below are the default values.",
"_DbExpire": {
"events": 1728000,
"powerevents": 864000,
"statsevents": 2592000
},
"_Port": 443,
"_AliasPort": 444,
"_RedirPort": 80,
"_RedirAliasPort": 80,
"_AgentPort": 1234,
"_AgentAliasPort": 1234,
"_AgentAliasDNS": "agents.myserver.mydomain.com",
"_ExactPorts": true,
"_AllowLoginToken": true,
"_AllowFraming": true,
"_CookieIpCheck": false,
"_CookieEncoding": "hex",
"_WebRTC": false,
"_Nice404": false,
"_ClickOnce": false,
"_SelfUpdate": true,
"_BrowserPing": 60,
"_BrowserPong": 60,
"_AgentPing": 60,
"_AgentPong": 60,
"_AgentIdleTimeout": 150,
"_MeshErrorLogPath": "c:\\tmp",
"_NpmPath": "c:\\npm.exe",
"_NpmProxy": "http://1.2.3.4:80",
"_AllowHighQualityDesktop": true,
"_DesktopMultiplex": true,
"_UserAllowedIP": "127.0.0.1,192.168.1.0/24",
"_UserBlockedIP": "127.0.0.1,::1,192.168.0.100",
"_AgentAllowedIP": "192.168.0.100/24",
"_AgentBlockedIP": "127.0.0.1,::1",
"_AuthLog": "c:\\temp\\auth.log",
"_LocalDiscovery": {
"name": "Local server name",
"info": "Information about this server"
},
"_TlsOffload": "127.0.0.1,::1",
"_TrustedProxy": "127.0.0.1,::1",
"_MpsPort": 44330,
"_MpsAliasPort": 4433,
"_MpsAliasHost": "mps.mydomain.com",
"_MpsTlsOffload": true,
"_No2FactorAuth": true,
"_Log": "main,web,webrequest,cert",
"_syslog": "meshcentral",
"_syslogauth": "meshcentral-auth",
"_syslogjson": "meshcentral-json",
"_WebRtConfig": {
"iceServers": [
{ "urls": "stun:stun.services.mozilla.com" },
{ "urls": "stun:stun.l.google.com:19302" }
]
},
"_AutoBackup": {
"backupIntervalHours": 24,
"keepLastDaysBackup": 10,
"zipPassword": "MyReallySecretPassword3",
"_backupPath": "C:\\backups"
},
"_Redirects": {
"meshcommander": "https://www.meshcommander.com/"
},
"__MaxInvalidLogin": "Time in minutes, max amount of bad logins from a source IP in the time before logins are rejected.",
"_MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 },
"_Plugins": { "enabled": true }
},
"_domaindefaults": {
"__comment__": "Any settings in this section is used as default setting for all domains",
"Title": "MyDefaultTitle",
"Footer": "Default page footer",
"NewAccounts": false
},
"_domains": {
"": {
"Title": "MyServer",
"Title2": "Servername",
"_TitlePicture": "title-sample.png",
"_UserQuota": 1048576,
"_MeshQuota": 248576,
"Minify": true,
"_NewAccounts": true,
"_UserNameIsEmail": true,
"_NewAccountEmailDomains": [ "sample.com" ],
"_NewAccountsRights": [ "nonewgroups", "notools" ],
"_ManageAllDeviceGroups": [ "admin" ],
"_WelcomeText": "Sample Text on Login Page.",
"_WelcomePicture": "mainwelcome.jpg",
"___Hide__": "Sum of: 1 = Hide header, 2 = Hide tab, 4 = Hide footer, 8 = Hide title, 16 = Hide left bar",
"_Hide": 4,
"_Footer": "<a href='https://twitter.com/mytwitter'>Twitter</a>",
"_CertUrl": "https://192.168.2.106:443/",
"_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" },
"_AgentInviteCodes": true,
"_AgentNoProxy": true,
"_GeoLocation": true,
"_UserAllowedIP": "127.0.0.1,192.168.1.0/24",
"_UserBlockedIP": "127.0.0.1,::1,192.168.0.100",
"_AgentAllowedIP": "192.168.0.100/24",
"_AgentBlockedIP": "127.0.0.1,::1",
"___UserSessionIdleTimeout__" : "Number of user idle minutes before auto-disconnect",
"_UserSessionIdleTimeout" : 30,
"__UserConsentFlags__" : "Set to: 1 for desktop, 2 for terminal, 3 for files, 7 for all",
"_UserConsentFlags" : 7,
"_UrlSwitching": false,
"_DesktopPrivacyBarText": "Your privacy bar message",
"_Limits": {
"_MaxDevices": 100,
"_MaxUserAccounts": 100,
"_MaxUserSessions": 100,
"_MaxAgentSessions": 100,
"MaxSingleUserSessions": 10
},
"_AmtAcmActivation": {
"log": "amtactivation.log",
"certs": {
"mycertname": {
"certfiles": [ "amtacm-leafcert.crt", "amtacm-intermediate1.crt", "amtacm-intermediate2.crt", "amtacm-rootcert.crt" ],
"keyfile": "amtacm-leafcert.key"
}
}
},
"_Redirects": {
"meshcommander": "https://www.meshcommander.com/"
},
"_yubikey": { "id": "0000", "secret": "xxxxxxxxxxxxxxxxxxxxx", "_proxy": "http://myproxy.domain.com:80" },
"_httpheaders": {
"Strict-Transport-Security": "max-age=360000",
"x-frame-options": "SAMEORIGIN",
"Content-Security-Policy": "default-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; frame-src 'self'; media-src 'self'"
},
"_agentConfig": [ "webSocketMaskOverride=1" ],
"_SessionRecording": {
"_filepath": "C:\\temp",
"_index": true,
"_maxRecordings": 10,
"_maxRecordingSizeMegabytes": 3,
"__protocols__": "Is an array: 1 = Terminal, 2 = Desktop, 5 = Files, 100 = Intel AMT WSMAN, 101 = Intel AMT Redirection",
"protocols": [ 1, 2, 101 ]
},
"_authStrategies": {
"__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",
"twitter": {
"__callbackurl": "https://server/auth-twitter-callback",
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"google": {
"__callbackurl": "https://server/auth-google-callback",
"clientid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxx"
},
"github": {
"__callbackurl": "https://server/auth-github-callback",
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"reddit": {
"__callbackurl": "https://server/auth-reddit-callback",
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
},
"_customer1": {
"_DNS": "customer1.myserver.com",
"_Title": "Customer1",
"_Title2": "TestServer",
"_NewAccounts": 1,
"_Auth": "sspi",
"__Auth": "ldap",
"_LDAPUserName": "gecos",
"_LDAPUserKey": "uid",
"_LDAPUserEmail": "otherMail",
"_LDAPPptions": {
"URL": "test",
"anne": {
"gecos": "Anne O'Nyme",
"displayName": "O Nyme anne",
"uid": "anneonyme",
"mail": "anneonyme@example.com",
"email": "anneonyme@example.com",
"otherMail": [ "other.anneonyme@example.com", "anneonyme@example.com" ]
},
"so": {
"displayName": "Sticker Sophie",
"gecos": "Sophie Sticker",
"uid": "ssticker",
"mail": "ssticker@example.com",
"email": "ssticker@example.com",
"otherMail": [ "other.ssticker@example.com", "ssticker@example.com" ]
}
},
"__LDAPOptions": {
"URL": "ldap://1.2.3.4:389",
"BindDN": "CN=svc_meshcentral,CN=Users,DC=meshcentral,DC=local",
"BindCredentials": "Password.1",
"SearchBase": "DC=meshcentral,DC=local",
"SearchFilter": "(sAMAccountName={{username}})"
},
"_Footer": "Test",
"_CertUrl": "https://192.168.2.106:443/"
},
"_info": {
"_share": "C:\\ExtraWebSite"
}
},
"_letsencrypt": {
"__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before trying Let's Encrypt.",
"email": "myemail@myserver.com",
"names": "myserver.com,customer1.myserver.com",
"production": false
},
"_peers": {
"serverId": "server1",
"servers": {
"server1": { "url": "wss://192.168.2.133:443/" },
"server2": { "url": "wss://192.168.1.106:443/" }
}
},
"_smtp": {
"host": "smtp.myserver.com",
"port": 25,
"from": "myemail@myserver.com",
"__tls__": "When 'tls' is set to true, TLS is used immidiatly when connecting. For SMTP servers that use TLSSTART, set this to 'false' and TLS will still be used.",
"tls": false,
"___tlscertcheck__": "When set to false, the TLS certificate of the SMTP server is not checked.",
"_tlscertcheck": false,
"__tlsstrict__": "When set to true, TLS cypher setup is more limited, SSLv2 and SSLv3 are not allowed.",
"_tlsstrict": true
},
"_sms": {
"provider": "twilio",
"sid": "ACxxxxxxxxx",
"auth": "xxxxxxx",
"from": "+1-555-555-5555"
},
"__sms": {
"provider": "plivo",
"id": "xxxxxxx",
"token": "xxxxxxx",
"from": "1-555-555-5555"
}
}

View File

@ -1,265 +1,29 @@
{
"__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.",
"__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.",
"__comment2__" : "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
"settings": {
"_Cert": "myserver.mydomain.com",
"_MongoDb": "mongodb://127.0.0.1:27017",
"_MongoDbName": "meshcentral",
"_MongoDbChangeStream": true,
"_MongoDumpPath": "C:\\Program Files\\MongoDB\\Server\\4.2\\bin\\mongodump.exe",
"_WANonly": true,
"_LANonly": true,
"_SessionTime": 30,
"_SessionKey": "MyReallySecretPassword1",
"_SessionSameSite": "strict",
"_DbEncryptKey": "MyReallySecretPassword2",
"_DbRecordsEncryptKey": "MyReallySecretPassword",
"_DbRecordsDecryptKey": "MyReallySecretPassword",
"__DbExpire": "Amount of time to keep various events in the database, in seconds. Below are the default values.",
"_DbExpire": {
"events": 1728000,
"powerevents": 864000,
"statsevents": 2592000
},
"_Port": 443,
"_AliasPort": 444,
"_AliasPort": 443,
"_RedirPort": 80,
"_RedirAliasPort": 80,
"_AgentPort": 1234,
"_AgentAliasPort": 1234,
"_AgentAliasDNS": "agents.myserver.mydomain.com",
"_ExactPorts": true,
"_AllowLoginToken": true,
"_AllowFraming": true,
"_CookieIpCheck": false,
"_CookieEncoding": "hex",
"_WebRTC": false,
"_Nice404": false,
"_ClickOnce": false,
"_SelfUpdate": true,
"_BrowserPing": 60,
"_BrowserPong": 60,
"_AgentPing": 60,
"_AgentPong": 60,
"_AgentIdleTimeout": 150,
"_MeshErrorLogPath": "c:\\tmp",
"_NpmPath": "c:\\npm.exe",
"_NpmProxy": "http://1.2.3.4:80",
"_AllowHighQualityDesktop": true,
"_DesktopMultiplex": true,
"_UserAllowedIP": "127.0.0.1,192.168.1.0/24",
"_UserBlockedIP": "127.0.0.1,::1,192.168.0.100",
"_AgentAllowedIP": "192.168.0.100/24",
"_AgentBlockedIP": "127.0.0.1,::1",
"_AuthLog": "c:\\temp\\auth.log",
"_LocalDiscovery": {
"name": "Local server name",
"info": "Information about this server"
},
"_TlsOffload": "127.0.0.1,::1",
"_TrustedProxy": "127.0.0.1,::1",
"_MpsPort": 44330,
"_MpsAliasPort": 4433,
"_MpsAliasHost": "mps.mydomain.com",
"_MpsTlsOffload": true,
"_No2FactorAuth": true,
"_Log": "main,web,webrequest,cert",
"_syslog": "meshcentral",
"_syslogauth": "meshcentral-auth",
"_syslogjson": "meshcentral-json",
"_WebRtConfig": {
"iceServers": [
{ "urls": "stun:stun.services.mozilla.com" },
{ "urls": "stun:stun.l.google.com:19302" }
]
},
"_AutoBackup": {
"backupIntervalHours": 24,
"keepLastDaysBackup": 10,
"zipPassword": "MyReallySecretPassword3",
"_backupPath": "C:\\backups"
},
"_Redirects": {
"meshcommander": "https://www.meshcommander.com/"
},
"__MaxInvalidLogin": "Time in minutes, max amount of bad logins from a source IP in the time before logins are rejected.",
"_MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 },
"_Plugins": { "enabled": true }
"_RedirAliasPort": 80
},
"_domaindefaults": {
"__comment__": "Any settings in this section is used as default setting for all domains",
"Title": "MyDefaultTitle",
"Footer": "Default page footer",
"NewAccounts": false
},
"_domains": {
"domains": {
"": {
"Title": "MyServer",
"Title2": "Servername",
"_TitlePicture": "title-sample.png",
"_UserQuota": 1048576,
"_MeshQuota": 248576,
"Minify": true,
"_Title": "MyServer",
"_Title2": "Servername",
"_Minify": true,
"_NewAccounts": true,
"_UserNameIsEmail": true,
"_NewAccountEmailDomains": [ "sample.com" ],
"_NewAccountsRights": [ "nonewgroups", "notools" ],
"_ManageAllDeviceGroups": [ "admin" ],
"_WelcomeText": "Sample Text on Login Page.",
"_WelcomePicture": "mainwelcome.jpg",
"___Hide__": "Sum of: 1 = Hide header, 2 = Hide tab, 4 = Hide footer, 8 = Hide title, 16 = Hide left bar",
"_Hide": 4,
"_Footer": "<a href='https://twitter.com/mytwitter'>Twitter</a>",
"_CertUrl": "https://192.168.2.106:443/",
"_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" },
"_AgentInviteCodes": true,
"_AgentNoProxy": true,
"_GeoLocation": true,
"_UserAllowedIP": "127.0.0.1,192.168.1.0/24",
"_UserBlockedIP": "127.0.0.1,::1,192.168.0.100",
"_AgentAllowedIP": "192.168.0.100/24",
"_AgentBlockedIP": "127.0.0.1,::1",
"___UserSessionIdleTimeout__" : "Number of user idle minutes before auto-disconnect",
"_UserSessionIdleTimeout" : 30,
"__UserConsentFlags__" : "Set to: 1 for desktop, 2 for terminal, 3 for files, 7 for all",
"_UserConsentFlags" : 7,
"_UrlSwitching": false,
"_DesktopPrivacyBarText": "Your privacy bar message",
"_Limits": {
"_MaxDevices": 100,
"_MaxUserAccounts": 100,
"_MaxUserSessions": 100,
"_MaxAgentSessions": 100,
"MaxSingleUserSessions": 10
},
"_AmtAcmActivation": {
"log": "amtactivation.log",
"certs": {
"mycertname": {
"certfiles": [ "amtacm-leafcert.crt", "amtacm-intermediate1.crt", "amtacm-intermediate2.crt", "amtacm-rootcert.crt" ],
"keyfile": "amtacm-leafcert.key"
}
}
},
"_Redirects": {
"meshcommander": "https://www.meshcommander.com/"
},
"_yubikey": { "id": "0000", "secret": "xxxxxxxxxxxxxxxxxxxxx", "_proxy": "http://myproxy.domain.com:80" },
"_httpheaders": {
"Strict-Transport-Security": "max-age=360000",
"x-frame-options": "SAMEORIGIN",
"Content-Security-Policy": "default-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; frame-src 'self'; media-src 'self'"
},
"_agentConfig": [ "webSocketMaskOverride=1" ],
"_SessionRecording": {
"_filepath": "C:\\temp",
"_index": true,
"_maxRecordings": 10,
"_maxRecordingSizeMegabytes": 3,
"__protocols__": "Is an array: 1 = Terminal, 2 = Desktop, 5 = Files, 100 = Intel AMT WSMAN, 101 = Intel AMT Redirection",
"protocols": [ 1, 2, 101 ]
},
"_authStrategies": {
"__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",
"twitter": {
"__callbackurl": "https://server/auth-twitter-callback",
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"google": {
"__callbackurl": "https://server/auth-google-callback",
"clientid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxx"
},
"github": {
"__callbackurl": "https://server/auth-github-callback",
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"reddit": {
"__callbackurl": "https://server/auth-reddit-callback",
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
},
"_customer1": {
"_DNS": "customer1.myserver.com",
"_Title": "Customer1",
"_Title2": "TestServer",
"_NewAccounts": 1,
"_Auth": "sspi",
"__Auth": "ldap",
"_LDAPUserName": "gecos",
"_LDAPUserKey": "uid",
"_LDAPUserEmail": "otherMail",
"_LDAPPptions": {
"URL": "test",
"anne": {
"gecos": "Anne O'Nyme",
"displayName": "O Nyme anne",
"uid": "anneonyme",
"mail": "anneonyme@example.com",
"email": "anneonyme@example.com",
"otherMail": [ "other.anneonyme@example.com", "anneonyme@example.com" ]
},
"so": {
"displayName": "Sticker Sophie",
"gecos": "Sophie Sticker",
"uid": "ssticker",
"mail": "ssticker@example.com",
"email": "ssticker@example.com",
"otherMail": [ "other.ssticker@example.com", "ssticker@example.com" ]
}
},
"__LDAPOptions": {
"URL": "ldap://1.2.3.4:389",
"BindDN": "CN=svc_meshcentral,CN=Users,DC=meshcentral,DC=local",
"BindCredentials": "Password.1",
"SearchBase": "DC=meshcentral,DC=local",
"SearchFilter": "(sAMAccountName={{username}})"
},
"_Footer": "Test",
"_CertUrl": "https://192.168.2.106:443/"
},
"_info": {
"_share": "C:\\ExtraWebSite"
"_UserNameIsEmail": true
}
},
"_letsencrypt": {
"__comment__": "Requires NodeJS 10.12 or better, Go to https://letsdebug.net/ first before trying Let's Encrypt.",
"__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before trying Let's Encrypt.",
"email": "myemail@myserver.com",
"names": "myserver.com,customer1.myserver.com",
"rsaKeySize": 3072,
"production": false
},
"_peers": {
"serverId": "server1",
"servers": {
"server1": { "url": "wss://192.168.2.133:443/" },
"server2": { "url": "wss://192.168.1.106:443/" }
}
},
"_smtp": {
"host": "smtp.myserver.com",
"port": 25,
"from": "myemail@myserver.com",
"__tls__": "When 'tls' is set to true, TLS is used immidiatly when connecting. For SMTP servers that use TLSSTART, set this to 'false' and TLS will still be used.",
"tls": false,
"___tlscertcheck__": "When set to false, the TLS certificate of the SMTP server is not checked.",
"_tlscertcheck": false,
"__tlsstrict__": "When set to true, TLS cypher setup is more limited, SSLv2 and SSLv3 are not allowed.",
"_tlsstrict": true
},
"_sms": {
"provider": "twilio",
"sid": "ACxxxxxxxxx",
"auth": "xxxxxxx",
"from": "+1-555-555-5555"
},
"__sms": {
"provider": "plivo",
"id": "xxxxxxx",
"token": "xxxxxxx",
"from": "1-555-555-5555"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1279,7 +1279,10 @@
args = parseUriArgs();
if (!args.locale) { var x = getstore('loctag', 0); if ((x != null) && (x != '*')) { args.locale = x; } }
debugmode = args.debug;
attemptWebRTC = 0; // For now, default WebRTC off unless we set it in the URL.
if (args.webrtc != null) { attemptWebRTC = (args.webrtc == 1); }
QV('p13AutoConnect', debugmode); // Files
QV('autoconnectbutton2', debugmode); // Terminal
QV('autoconnectbutton1', debugmode); // Desktop
@ -5159,6 +5162,7 @@
if ((meshrights & 76) != 0) { x += '<input type=button value="' + "Actions" + '" title="' + "Perform power actions on the device" + '" onclick=deviceActionFunction() />'; }
x += '<input type=button value="' + "Notes" + '" title="' + "View notes about this device" + '" onclick=showNotes(' + ((meshrights & 128) == 0) + ',"' + encodeURIComponentEx(node._id) + '") />';
x += '<input type=button value="' + "Log Event" + '" title="' + "Write an event for this device" + '" onclick=writeDeviceEvent("' + encodeURIComponentEx(node._id) + '") />';
if ((connectivity & 1) && (meshrights & 8)) { x += '<input type=button value="' + "Message" + '" title="' + "Display a text message on the remote device" + '" onclick=deviceMessageFunction() />'; }
//if ((connectivity & 1) && (meshrights & 8) && (node.agent.id < 5)) { x += '<input type=button value=Toast title="' + "Display a text message of the remote device" + '" onclick=deviceToastFunction() />'; }
QH('p10html', x);
@ -5442,6 +5446,16 @@
meshserver.send({ action: 'msg', type: 'openUrl', nodeid: currentNode._id, url: Q('d2devurl').value });
}
function deviceMessageFunction() {
if (xxdialogMode) return;
setDialogMode(2, "Device Message", 3, deviceMessageFunctionEx, '<div style=margin-bottom:4px>' + "Display a message box on the remote device." + '</div><textarea id=d2devMessage style=width:100%;height:80px;resize:none;overflow-y:scroll></textarea>');
Q('d2devMessage').focus();
}
function deviceMessageFunctionEx() {
meshserver.send({ action: 'msg', type: 'messagebox', nodeid: currentNode._id, title: '{{{title}}}', msg: Q('d2devMessage').value });
}
function deviceToastFunction() {
if (xxdialogMode) return;
setDialogMode(2, "Device Notification", 3, deviceToastFunctionEx, '<textarea id=d2devToast style=width:100%;height:80px;resize:none;overflow-y:scroll></textarea>');
@ -5449,7 +5463,7 @@
}
function deviceToastFunctionEx() {
meshserver.send({ action: 'toast', nodeids: [ currentNode._id ], title: 'MeshCentral', msg: Q('d2devToast').value });
meshserver.send({ action: 'toast', nodeids: [ currentNode._id ], title: '{{{title}}}', msg: Q('d2devToast').value });
}
function deviceActionFunction() {
@ -7140,7 +7154,7 @@
if (files.consoleMessage) {
Q('p13FilesConsoleMsg').innerHTML += formatAgentConsoleMessage(files.consoleMessage, files.consoleMessageId, files.consoleMessageArgs);
QV('p13FilesConsoleMsg', true);
if (p13DeskConsoleMsgTimer != null) { clearTimeout(p13DeskConsoleMsgTimer); }
if (p13FilesConsoleMsgTimer != null) { clearTimeout(p13FilesConsoleMsgTimer); }
if (files.consoleMessageTimeout) { p13FilesConsoleMsgTimer = setTimeout(p13clearConsoleMsg, files.consoleMessageTimeout * 1000); }
} else {
p13clearConsoleMsg();