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

show server config for admins

Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2023-10-03 17:20:22 +00:00
parent 2d8c3cfc64
commit eb8df307ec
2 changed files with 30 additions and 0 deletions

View file

@ -5292,6 +5292,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
'serverclearerrorlog': serverCommandServerClearErrorLog,
'serverconsole': serverCommandServerConsole,
'servererrors': serverCommandServerErrors,
'serverconfig': serverCommandServerConfig,
'serverstats': serverCommandServerStats,
'servertimelinestats': serverCommandServerTimelineStats,
'serverupdate': serverCommandServerUpdate,
@ -6504,6 +6505,13 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
fs.readFile(parent.parent.getConfigFilePath('mesherrors.txt'), 'utf8', function (err, data) { obj.send({ action: 'servererrors', data: data }); });
}
function serverCommandServerConfig(command) {
// Load the server config
var configFilePath = common.joinPath(parent.parent.datapath, (parent.parent.args.configfile ? parent.parent.args.configfile : 'config.json'));
if (userHasSiteUpdate())
fs.readFile(configFilePath, 'utf8', function (err, data) { obj.send({ action: 'serverconfig', data: data }); });
}
function serverCommandServerStats(command) {
// Only accept if the "My Server" tab is allowed for this domain
if (domain.myserver === false) return;