Remove config management

Remove lib/manager/configManager.js and the config management command
line interface as well as the serverManager's web interface for config
management.  The configuration rewrite will work differently and is not
compatible with configManager.js.
This commit is contained in:
Hornwitser committed 2019-09-16 16:04:08 +02:00
1 parent dd865b42b5
commit 5f33cf4d3b
10 files changed
+4 -201

No files matched your search

@@ -77,48 +77,9 @@ module.exports = that => {
});
}
});
that.app.post("/api/serverManager/editConfig", async (req,res) => {
if((req.body.token || req.cookies.token)
&& req.body.instanceID
&& typeof req.body.instanceID == "string"
&& req.body.entry
&& typeof req.body.entry == "string"
&& req.body.value !== undefined
&& that.playerManager){
let perms = await that.playerManager.main.getPermissions((req.body.token || req.cookies.token));
if(perms.cluster.includes("writeConfig")
|| (perms.instance[req.body.instanceID]
&& perms.instance[req.body.instanceID].includes("writeConfig"))){
that.serverSockets[req.body.instanceID].socket.emit("serverManagerEditConfig", {
entry: req.body.entry,
value: req.body.value,
}, async resp => {
if(resp.ok){
// Retrieve the latest config from the server and store it
await updateData("config", req.body.instanceID);
}
res.send(resp);
});
} else {
res.send({
ok:false,
msg:"Insufficient permissions",
});
}
} else {
res.send({
ok:false,
msg:"Invalid request body",
});
}
});
async function updateData(type, instanceID){
// Retrieve the latest ${type} from the server and store it
if(type == "config"){
that.serverSockets[instanceID].socket.emit("serverManagerGetConfig", {}, data => {
that.serverSockets[instanceID].config = data;
});
} else if(type == "plugins"){
if(type == "plugins"){
that.serverSockets[instanceID].socket.emit("serverManagerGetPlugins", {}, data => {
that.serverSockets[instanceID].plugins = data;
});