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

Improvements to show config option in MyServer tab.

This commit is contained in:
Ylian Saint-Hilaire 2023-10-03 20:35:02 -07:00
parent 0e671bbe81
commit 3a3663bb55
6 changed files with 29 additions and 18 deletions

View file

@ -6513,10 +6513,11 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
}
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())
// Load the server config.json. This is a sensitive file so care must be taken to only send to trusted administrators.
if (userHasSiteUpdate() && (domain.myserver !== false) && ((domain.myserver == null) || (domain.myserver.config === true))) {
const configFilePath = common.joinPath(parent.parent.datapath, (parent.parent.args.configfile ? parent.parent.args.configfile : 'config.json'));
fs.readFile(configFilePath, 'utf8', function (err, data) { obj.send({ action: 'serverconfig', data: data }); });
}
}
function serverCommandServerStats(command) {