From 8ecc6d1c8330160fb8dff4ed135bfe3337ee58af Mon Sep 17 00:00:00 2001 From: jake-87 Date: Fri, 10 Dec 2021 13:01:03 +1100 Subject: [PATCH 1/5] Added instance and user documentation --- docs/managing-a-cluster.md | 71 +++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/docs/managing-a-cluster.md b/docs/managing-a-cluster.md index 48015bf2..71696aac 100644 --- a/docs/managing-a-cluster.md +++ b/docs/managing-a-cluster.md @@ -10,13 +10,67 @@ The easiest way to do this is to run `npx clusteriomaster bootstrap create-ctl-c ## Slaves -To be written. +### List slaves + ctl> slave list + +Lists all slaves. + +### Generate token + + ctl> slave generate-token [--id ] + +Generate a token for a slave. `--id` is the slave id, a number. + +### Create config + + ctl> slave create-config [--id ] [--name ] [--generate-token ] [--output ] + +Create a slave config. `--id` id the slave id, a number. `--name` is the slave name, a string. `--generate-token` decides whether to also generate a token, a bool, with a default of 0. `--output` is the filename for the output of the config. Default is "config-slave.json", "-" for stdout. ## Instances +### List Instances + + ctl> instance list + +List instances. + +### Create instance + + ctl> instance create [--id ] + +Create a new instance. `name` is the instance name. `--id` is the optional id. + +### Config management + +#### List Configuration + + ctl> instance config list + +List config values for an instance. `instance` is the instance to list config values. + +#### Set config value + + ctl> instance config set [value] [--stdin] + +Set field in instance config. `instance` is instance to set. `field` is field to set. `value` is value to set in field. `--stdin` signals to read value from stdin. + +#### Set config property of field + To be written. +#### Edit instance config + + ctl> instance config edit [editor] + +Edit instance config in a text editor. Once file is saved and editor has been exited, config values will be read back in. `instance` is the instance to edit, `editor` is the editor to use. If `editor` is not given, clusterioctl will read from the `EDITOR` and `VISUAL` enviroment variables. + +### Assign instance to slave + + ctl> instace assign [slave] + +Assigns instance to slave. `instance` is instance to assign, `slave` is slave to assign to. If `slave` is not provided, instance will be unassigned. ## Users @@ -74,6 +128,21 @@ Since ban status is a part of the account data the account must exist for this t Note: This bans the user from logging in to Factorio servers in the cluster, it does not revoke access to any cluster management they might have, see next section on setting roles for revoking tha. +### Bulk importing admin, whitelist and ban lists + +Whitelists, banlists and admin lists can be bulk imported with the following commands: + + ctl> user banned-bulk-import [--create] + ctl> user whitelist-bulk-import [--create] + ctl> user admin-bulk-import [--create] + +The file should simply be newline seperated names: + + joe + bob + allan + +The `--create` option will create the user if they do not exist, and then set the relevent value. ### Set Cluster Roles From 488d81f424ee6ad083c88a21ebdd3829b1fa43f1 Mon Sep 17 00:00:00 2001 From: jake-87 Date: Sun, 2 Jan 2022 19:16:23 +1100 Subject: [PATCH 2/5] Updated wording in docs Also added more information on the banned-bulk-import option. --- docs/managing-a-cluster.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/managing-a-cluster.md b/docs/managing-a-cluster.md index 71696aac..84372850 100644 --- a/docs/managing-a-cluster.md +++ b/docs/managing-a-cluster.md @@ -24,9 +24,9 @@ Generate a token for a slave. `--id` is the slave id, a number. ### Create config - ctl> slave create-config [--id ] [--name ] [--generate-token ] [--output ] + ctl> slave create-config [--id ] [--name ] [--generate-token ] [--output ] -Create a slave config. `--id` id the slave id, a number. `--name` is the slave name, a string. `--generate-token` decides whether to also generate a token, a bool, with a default of 0. `--output` is the filename for the output of the config. Default is "config-slave.json", "-" for stdout. +Create a slave config. `--id` id the slave id, a number. `--name` is the slave name, a string. `--generate-token` decides whether to also generate a token, a bool, with a default of 0. `--output` is the filename for the output of the config; Default is "config-slave.json", "-" for stdout. ## Instances @@ -64,7 +64,7 @@ To be written. ctl> instance config edit [editor] -Edit instance config in a text editor. Once file is saved and editor has been exited, config values will be read back in. `instance` is the instance to edit, `editor` is the editor to use. If `editor` is not given, clusterioctl will read from the `EDITOR` and `VISUAL` enviroment variables. +Edit instance config in a text editor. Once file is saved and editor has been exited, config values will be read back in. `instance` is the instance to edit, `editor` is the editor to use. If `editor` is not given, clusterioctl will read from the `EDITOR` or `VISUAL` enviroment variables. ### Assign instance to slave @@ -130,9 +130,8 @@ Note: This bans the user from logging in to Factorio servers in the cluster, it ### Bulk importing admin, whitelist and ban lists -Whitelists, banlists and admin lists can be bulk imported with the following commands: +Whitelists and admin lists can be bulk imported with the following commands: - ctl> user banned-bulk-import [--create] ctl> user whitelist-bulk-import [--create] ctl> user admin-bulk-import [--create] @@ -144,6 +143,19 @@ The file should simply be newline seperated names: The `--create` option will create the user if they do not exist, and then set the relevent value. +Banlists can be bulk imported with the following command: + + ctl> user banned-bulk-import [--create] + +The file should be names, followed by a ban reason: + + joe greifed copper mines + bob stole materials + allan rude language + +The first string on the line is used as the username, the others are used as the ban reason. +The `--create` option will create the user if they do not exist, then ban them. + ### Set Cluster Roles ctl> user set-roles [roles...] From 1b1524e787152deeaf0fe7141c73573c5b2398c9 Mon Sep 17 00:00:00 2001 From: jake-87 Date: Sun, 2 Jan 2022 19:23:54 +1100 Subject: [PATCH 3/5] Fix poor wording --- docs/managing-a-cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/managing-a-cluster.md b/docs/managing-a-cluster.md index 84372850..dff48491 100644 --- a/docs/managing-a-cluster.md +++ b/docs/managing-a-cluster.md @@ -26,7 +26,7 @@ Generate a token for a slave. `--id` is the slave id, a number. ctl> slave create-config [--id ] [--name ] [--generate-token ] [--output ] -Create a slave config. `--id` id the slave id, a number. `--name` is the slave name, a string. `--generate-token` decides whether to also generate a token, a bool, with a default of 0. `--output` is the filename for the output of the config; Default is "config-slave.json", "-" for stdout. +Create a slave config. `--id` id the slave id, a number. `--name` is the slave name, a string. `--generate-token` decides whether to also generate a token, a bool, defaulting to `0`. `--output` is the filename for the output of the config; Default is "config-slave.json", "-" for stdout. ## Instances From f8c72a1e0afeb0c6910f7dbf51aac1d21a32cfe7 Mon Sep 17 00:00:00 2001 From: J87 <68929154+jake-87@users.noreply.github.com> Date: Mon, 10 Jan 2022 12:37:02 +1100 Subject: [PATCH 4/5] Fixed wording issue --- docs/managing-a-cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/managing-a-cluster.md b/docs/managing-a-cluster.md index dff48491..743c179e 100644 --- a/docs/managing-a-cluster.md +++ b/docs/managing-a-cluster.md @@ -48,7 +48,7 @@ Create a new instance. `name` is the instance name. `--id` is the optional id. ctl> instance config list -List config values for an instance. `instance` is the instance to list config values. +List config values for an instance. `instance` is the instance whose config values to list. #### Set config value From 3da8c30a644d3c358e4d0337bad0e0bee2c80627 Mon Sep 17 00:00:00 2001 From: J87 <68929154+jake-87@users.noreply.github.com> Date: Tue, 11 Jan 2022 19:55:18 +1100 Subject: [PATCH 5/5] Remove unnecessary information --- docs/managing-a-cluster.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/managing-a-cluster.md b/docs/managing-a-cluster.md index 743c179e..205a548d 100644 --- a/docs/managing-a-cluster.md +++ b/docs/managing-a-cluster.md @@ -20,13 +20,13 @@ Lists all slaves. ctl> slave generate-token [--id ] -Generate a token for a slave. `--id` is the slave id, a number. +Generate a token for a slave. `--id` is the slave id. ### Create config ctl> slave create-config [--id ] [--name ] [--generate-token ] [--output ] -Create a slave config. `--id` id the slave id, a number. `--name` is the slave name, a string. `--generate-token` decides whether to also generate a token, a bool, defaulting to `0`. `--output` is the filename for the output of the config; Default is "config-slave.json", "-" for stdout. +Create a slave config. `--id` id the slave id. `--name` is the slave name. `--generate-token` decides whether to also generate a token, defaulting to `0`. `--output` is the filename for the output of the config; Default is "config-slave.json", "-" for stdout. ## Instances