mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-22 22:17:31 +03:00
Added server side agent msh config option.
This commit is contained in:
parent
eae67b9985
commit
d081396d4b
@ -132,7 +132,9 @@ function windows_terminal() {
|
||||
this._kernel32.SetConsoleWindowInfo(this._stdoutput, 1, rect);
|
||||
}
|
||||
|
||||
this.Start = function Start(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT) {
|
||||
this.Start = function Start(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT)
|
||||
{
|
||||
this.stopping = null;
|
||||
if (this._kernel32.GetConsoleWindow().Val == 0) {
|
||||
if (this._kernel32.AllocConsole().Val == 0) {
|
||||
throw ('AllocConsole failed with: ' + this._kernel32.GetLastError().Val);
|
||||
@ -209,10 +211,12 @@ function windows_terminal() {
|
||||
this._stop = function () {
|
||||
if (this.stopping) { return (this.stopping); }
|
||||
//console.log('Stopping Terminal...');
|
||||
this._ConsoleWinEventProc.removeAllListeners('GlobalCallback');
|
||||
this.stopping = new promise(function (res, rej) { this._res = res; this._rej = rej; });
|
||||
|
||||
var threadID = this._kernel32.GetThreadId(this._user32.SetWinEventHook.async.thread()).Val;
|
||||
this._user32.PostThreadMessageA(threadID, WM_QUIT, 0, 0);
|
||||
this._stream.emit('end');
|
||||
return (this.stopping);
|
||||
}
|
||||
|
||||
@ -272,8 +276,10 @@ function windows_terminal() {
|
||||
//SendConsoleEvent(dwEvent, idObject, idChild);
|
||||
break;
|
||||
case EVENT_CONSOLE_END_APPLICATION:
|
||||
if (idObject.Val == this.terminal._hProcessID) {
|
||||
if (idObject.Val == this.terminal._hProcessID)
|
||||
{
|
||||
//console.log('END APPLICATION: [PID: ' + idObject.Val + ' CID: ' + idChild.Val + ']');
|
||||
this.terminal._hProcess = null;
|
||||
this.terminal._stop().then(function () { console.log('STOPPED'); });
|
||||
}
|
||||
break;
|
||||
@ -306,18 +312,23 @@ function windows_terminal() {
|
||||
}, console.log);
|
||||
}, console.log);
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
this.nativeProxy.UnhookWinEvent.async(this.nativeProxy.terminal._user32.SetWinEventHook.async, this.nativeProxy.terminal.hwinEventHook)
|
||||
.then(function () {
|
||||
this.nativeProxy.terminal.stopping._res();
|
||||
if (this.nativeProxy.terminal._kernel32.TerminateProcess(this.nativeProxy.terminal._hProcess, 1067).Val == 0) {
|
||||
var e = this.nativeProxy.terminal._kernel32.GetLastError().Val;
|
||||
console.log('Unable to kill Terminal Process, error: ' + e);
|
||||
}
|
||||
this.nativeProxy.terminal.stopping = null;
|
||||
}, function (err) {
|
||||
console.log('REJECTED_UnhookWinEvent: ' + err);
|
||||
});
|
||||
.then(function ()
|
||||
{
|
||||
if (this.nativeProxy.terminal._hProcess == null) { return; }
|
||||
|
||||
this.nativeProxy.terminal.stopping._res();
|
||||
if (this.nativeProxy.terminal._kernel32.TerminateProcess(this.nativeProxy.terminal._hProcess, 1067).Val == 0) {
|
||||
var e = this.nativeProxy.terminal._kernel32.GetLastError().Val;
|
||||
console.log('Unable to kill Terminal Process, error: ' + e);
|
||||
}
|
||||
this.nativeProxy.terminal.stopping = null;
|
||||
}, function (err)
|
||||
{
|
||||
console.log('REJECTED_UnhookWinEvent: ' + err);
|
||||
});
|
||||
}
|
||||
}, function (err) {
|
||||
// Get Message Failed
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "meshcentral",
|
||||
"version": "0.2.8-r",
|
||||
"version": "0.2.8-s",
|
||||
"keywords": [
|
||||
"Remote Management",
|
||||
"Intel AMT",
|
||||
|
@ -42,11 +42,14 @@
|
||||
"_AgentAllowedIP": "192.168.0.100/24",
|
||||
"_AgentBlockedIP": "127.0.0.1,::1",
|
||||
"_Limits": {
|
||||
"MaxUserAccounts": 100,
|
||||
"MaxUserSessions": 100,
|
||||
"MaxAgentSessions": 100
|
||||
"_MaxUserAccounts": 100,
|
||||
"_MaxUserSessions": 100,
|
||||
"_MaxAgentSessions": 100,
|
||||
"MaxSingleUserSessions": 10
|
||||
},
|
||||
"_yubikey": { "id": "0000", "secret": "xxxxxxxxxxxxxxxxxxxxx", "_proxy": "http://myproxy.domain.com:80" }
|
||||
"_yubikey": { "id": "0000", "secret": "xxxxxxxxxxxxxxxxxxxxx", "_proxy": "http://myproxy.domain.com:80" },
|
||||
"_httpheaders": { "Strict-Transport-Security": "max-age=360000" },
|
||||
"_agentConfig": [ "webSocketMaskOverride=1" ]
|
||||
},
|
||||
"customer1": {
|
||||
"DNS": "customer1.myserver.com",
|
||||
@ -62,7 +65,7 @@
|
||||
}
|
||||
},
|
||||
"_letsencrypt": {
|
||||
"__comment__": "If your are having problems with Let's Encrypt, use https://letsdebug.net/ first to debug it.",
|
||||
"__comment__": "Go to https://letsdebug.net/ first before trying Let's Encrypt.",
|
||||
"email": "myemail@myserver.com ",
|
||||
"names": "myserver.com,customer1.myserver.com",
|
||||
"rsaKeySize": 3072,
|
||||
|
@ -1927,6 +1927,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||
if (req.query.tag != null) { meshsettings += "Tag=" + req.query.tag + "\r\n"; }
|
||||
if ((req.query.installflags != null) && (req.query.installflags != 0)) { meshsettings += "InstallFlags=" + req.query.installflags + "\r\n"; }
|
||||
if (domain.agentnoproxy === true) { meshsettings += "ignoreProxyFile=1\r\n"; }
|
||||
if (obj.args.agentconfig) { for (var i in obj.args.agentconfig) { meshsettings += obj.args.agentconfig[i] + "\r\n"; } }
|
||||
if (domain.agentconfig) { for (var i in domain.agentconfig) { meshsettings += domain.agentconfig[i] + "\r\n"; } }
|
||||
|
||||
res.set({ 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Content-Type': 'application/octet-stream', 'Content-Disposition': 'attachment; filename=' + argentInfo.rname });
|
||||
obj.parent.exeHandler.streamExeWithMeshPolicy({ platform: 'win32', sourceFileName: obj.parent.meshAgentBinaries[req.query.id].path, destinationStream: res, msh: meshsettings, peinfo: obj.parent.meshAgentBinaries[req.query.id].pe });
|
||||
@ -2147,6 +2149,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||
if (req.query.tag != null) { meshsettings += "Tag=" + req.query.tag + "\r\n"; }
|
||||
if ((req.query.installflags != null) && (req.query.installflags != 0)) { meshsettings += "InstallFlags=" + req.query.installflags + "\r\n"; }
|
||||
if (domain.agentnoproxy === true) { meshsettings += "ignoreProxyFile=1\r\n"; }
|
||||
if (obj.args.agentconfig) { for (var i in obj.args.agentconfig) { meshsettings += obj.args.agentconfig[i] + "\r\n"; } }
|
||||
if (domain.agentconfig) { for (var i in domain.agentconfig) { meshsettings += domain.agentconfig[i] + "\r\n"; } }
|
||||
|
||||
res.set({ 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Content-Type': 'application/octet-stream', 'Content-Disposition': 'attachment; filename=meshagent.msh' });
|
||||
res.send(meshsettings);
|
||||
|
Loading…
Reference in New Issue
Block a user