mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 15:24:52 +09:00
Remove port and password arguments to client.js
Remove undocumented command line options set the ports and password used in the instance. These are not compatible with remote management.
This commit is contained in:
1 parent
0474355175
commit
1d26212e1d
3 files changed
+14
-17
No files matched your search
@@ -41,6 +41,9 @@ Version 2.0.0
|
||||
/api/inventory, /api/inventoryAsObject and the web interface view for the
|
||||
storage page into the clusterioMod plugin. If you disable this plugin
|
||||
then these things will not be available.
|
||||
- Removed undocumented --port and --rcon-port arguments to client.
|
||||
- Removed undocumented FACTORIOPORT and RCONPORT enviroment variable
|
||||
handling in client.
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
|
||||
+1
-1
@@ -18,4 +18,4 @@ VOLUME /factorioClusterio/instances
|
||||
VOLUME /factorioClusterio/sharedMods
|
||||
VOLUME /factorioClusterio/sharedPlugins
|
||||
|
||||
CMD RCONPORT="$RCONPORT" FACTORIOPORT="$FACTORIOPORT" MODE="$MODE" node $MODE start $INSTANCE
|
||||
CMD MODE="$MODE" node $MODE start $INSTANCE
|
||||
@@ -270,7 +270,7 @@ async function symlinkMods(instance, sharedMods, logger) {
|
||||
}
|
||||
}
|
||||
|
||||
async function createInstance(config, args, instance) {
|
||||
async function createInstance(config, instance) {
|
||||
console.log(`Creating ${instance.path()}`);
|
||||
await fs.ensureDir(instance.path());
|
||||
await fs.ensureDir(instance.path("script-output"));
|
||||
@@ -278,10 +278,10 @@ async function createInstance(config, args, instance) {
|
||||
await symlinkMods(instance, "sharedMods", console);
|
||||
let instconf = {
|
||||
"id": Math.random() * 2 ** 31 | 0,
|
||||
"factorioPort": args.port || process.env.FACTORIOPORT || null,
|
||||
"clientPort": args["rcon-port"] || process.env.RCONPORT || null,
|
||||
"factorioPort": null,
|
||||
"clientPort": null,
|
||||
"__comment_clientPassword": "This is the rcon password. Will be randomly generated if null.",
|
||||
"clientPassword": args["rcon-password"] || null,
|
||||
"clientPassword": null,
|
||||
"info": {}
|
||||
}
|
||||
console.log("Clusterio | Created instance with settings:")
|
||||
@@ -335,7 +335,7 @@ async function createInstance(config, args, instance) {
|
||||
console.log("Clusterio | Successfully created instance");
|
||||
}
|
||||
|
||||
async function startInstance(config, args, instance) {
|
||||
async function startInstance(config, instance) {
|
||||
var instanceconfig = JSON.parse(await fs.readFile(instance.path("config.json")));
|
||||
if (typeof instanceconfig.id !== "number" || isNaN(instanceconfig.id)) {
|
||||
throw new Error(`${instance.path("config.json")} is missing id`);
|
||||
@@ -343,12 +343,6 @@ async function startInstance(config, args, instance) {
|
||||
// Temporary measure for backwards compatibility
|
||||
instanceconfig.unique = instanceconfig.id;
|
||||
|
||||
if (process.env.FACTORIOPORT) {
|
||||
instanceconfig.factorioPort = process.env.FACTORIOPORT;
|
||||
}
|
||||
if (process.env.RCONPORT) {
|
||||
instanceconfig.rconPort = process.env.RCONPORT;
|
||||
}
|
||||
console.log("Deleting .tmp.zip files");
|
||||
let savefiles = fs.readdirSync(instance.path("saves"));
|
||||
for(i = 0; i < savefiles.length; i++){
|
||||
@@ -419,9 +413,9 @@ async function startInstance(config, args, instance) {
|
||||
await factorio.patch(instance.path("saves", latestSave), modules);
|
||||
|
||||
let options = {
|
||||
gamePort: args.port || Number(process.env.FACTORIOPORT) || instanceconfig.factorioPort,
|
||||
rconPort: args["rcon-port"] || Number(process.env.RCONPORT) || instanceconfig.clientPort,
|
||||
rconPassword: args["rcon-password"] || instanceconfig.clientPassword,
|
||||
gamePort: instanceconfig.factorioPort,
|
||||
rconPort: instanceconfig.clientPort,
|
||||
rconPassword: instanceconfig.clientPassword,
|
||||
};
|
||||
|
||||
let server = new factorio.FactorioServer(path.join("factorio", "data"), instance.path(), options);
|
||||
@@ -526,9 +520,9 @@ async function startClient() {
|
||||
console.error("Usage: node client start [instanceName]");
|
||||
process.exit(0);
|
||||
} else if (command == "start" && !fs.existsSync(instance.path())) {
|
||||
await createInstance(config, args, instance);
|
||||
await createInstance(config, instance);
|
||||
} else if (command == "start" && fs.existsSync(instance.path())) {
|
||||
await startInstance(config, args, instance);
|
||||
await startInstance(config, instance);
|
||||
} else {
|
||||
console.error("Invalid arguments, quitting.");
|
||||
process.exit(1);
|
||||
|
||||
Reference in new issue
Block a user