1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

More plugin hooks / development of base

This commit is contained in:
Ryan Blenis 2019-10-08 04:18:40 -04:00
parent 36931698ad
commit d143990f31
6 changed files with 200 additions and 17 deletions

View file

@ -865,6 +865,11 @@ function CreateMeshCentralServer(config, args) {
// Dispatch an event that the server is now running
obj.DispatchEvent(['*'], obj, { etype: 'server', action: 'started', msg: 'Server started' });
obj.pluginHandler = require("./pluginHandler.js").pluginHandler(obj);
// Plugin hook. Need to run something at server startup? This is the place.
obj.pluginHandler.callHook("server_startup");
// Load the login cookie encryption key from the database if allowed
if ((obj.config) && (obj.config.settings) && (obj.config.settings.allowlogintoken == true)) {
obj.db.Get('LoginCookieEncryptionKey', function (err, docs) {
@ -1347,7 +1352,8 @@ function CreateMeshCentralServer(config, args) {
}
}
}
obj.pluginHandler = require("./pluginHandler.js").pluginHandler(obj);
obj.pluginHandler.addMeshCoreModules(modulesAdd);
// Merge the cores and compute the hashes
for (var i in modulesAdd) {
if ((i == 'windows-recovery') || (i == 'linux-recovery')) {