Merge masterIP and masterPort into masterURL

Merge the masterIP and masterPort configuration entries into a single
masterURL entry.  Fixes the problem with connecting to an HTTPS version
of the master server and also makes it easier to host the master server
behind a reverse proxy.

This breaks all known code interfacing Clusterio.
This commit is contained in:
Hornwitser committed 2019-09-09 12:44:09 +02:00
1 parent da99b39402
commit 98900e72dc
15 files changed
+68 -43

No files matched your search

+2 -3
View File
@@ -9,7 +9,6 @@ if(process.argv.length < 3){
process.exit(1)
}
const masterIP = `${config.masterIP}:${config.masterPort}`;
const token = config.masterAuthToken
let commandArray = process.argv;
commandArray.shift();
@@ -24,14 +23,14 @@ let command = commandArray.join(" ");
let killBiters = `/silent-command local surface=game.surfaces[1] for key, entity in pairs(surface.find_entities_filtered({force="enemy"})) do entity.destroy() end`;
(async ()=>{
needle.post(masterIP+"/api/runCommand", {
needle.post(config.masterURL+"/api/runCommand", {
broadcast:true,
command,
}, needleOptionsWithTokenAuthHeader, (err, resp) => {
console.log(resp.body)
});
// setInterval(()=>{
// needle.post(masterIP+"/api/runCommand", {
// needle.post(config.masterURL+"/api/runCommand", {
// broadcast:true,
// command: killBiters,
// }, needleOptionsWithTokenAuthHeader, (err, resp) => {
+1 -1
View File
@@ -11,7 +11,7 @@ if(!options.name){
process.exit(1)
}
needle.post(config.masterIP+":"+config.masterPort+"/api/playerManager/deletePlayer", {
needle.post(config.masterURL+"/api/playerManager/deletePlayer", {
name: options.name,
token: options.token
}, (err, resp) => {