diff --git a/README.md b/README.md index 4427194f..f6af8992 100644 --- a/README.md +++ b/README.md @@ -306,7 +306,7 @@ If you want to use a different user for the command line interface, you can gene - `@hornwitser/server_select@2.0.1` fails to load with Clusterio 2.0 because its entrypoints omit the required `.js` extension. `@hornwitser/discord_bridge@0.2.5` is not automatically discovered because it lacks the `clusterio-plugin` keyword. - The Clusterio 2.0.2 installer still offers these versions; leave them unchecked until compatible plugin releases are available. + The installer no longer offers them, but installs made with the 2.0.2 installer or earlier may still have them. If already installed, stop the controller and host, run `npm uninstall @hornwitser/server_select @hornwitser/discord_bridge` in each affected installation directory, and restart them to continue with the core plugins. See [#1102](https://github.com/clusterio/clusterio/issues/1102). - After updating Factorio you may get the error `Error: Expected empty response but got "Cannot execute command. Error: [string "clusterio_private.update_instance(..."]:1: attempt to index global 'clusterio_private' (a nil value)?` on instance start. diff --git a/docs/managing-a-cluster.md b/docs/managing-a-cluster.md index 5a048c27..c973228c 100644 --- a/docs/managing-a-cluster.md +++ b/docs/managing-a-cluster.md @@ -209,31 +209,39 @@ Note: This bans the user from logging in to Factorio servers in the cluster, it ### Bulk importing admin, whitelist and ban lists -Whitelists and admin lists can be bulk imported with the following commands: +Admin lists, whitelists and banlists can be bulk imported with the following command: - ctl> user whitelist-bulk-import [--create] - ctl> user admin-bulk-import [--create] + ctl> user import [--admins|--whitelist|--bans|--users] -The file should simply be newline seperated names: +The admin list and whitelist files should be a JSON array of names, the same format as Factorio's server-adminlist.json and server-whitelist.json: - joe - bob - allan + ["joe", "bob", "allan"] -The `--create` option will create the user if they do not exist, and then set the relevent value. +The banlist file uses the format of Factorio's server-banlist.json, where each entry is either a name or an object with a username and reason: -Banlists can be bulk imported with the following command: - - ctl> user banned-bulk-import [--create] + [ + "joe", + {"username": "bob", "reason": "stole materials"}, + {"username": "allan", "reason": "rude language"} + ] -The file should be names, followed by a ban reason: +The `--users` option imports a file written by `user export`, which holds the admin, whitelist and ban status of every user. +If no option is given the type is guessed from the file, files with an `export_version` field are treated as user exports, otherwise the file name must contain ban, admin or whitelist. +Users that do not exist are created. +Importing only adds to the existing lists, it never removes anyone from them. - joe greifed copper mines - bob stole materials - allan rude language +To replace a list instead, use restore: -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. + ctl> user restore [--admins|--whitelist|--bans|--users] [--no-backup] + +This takes the same files as import, but removes everyone not in the file from the list. +The previous list is written to `-backup.json` in the current directory unless `--no-backup` is passed. + +The current lists can be exported with the following command: + + ctl> user export [--admins|--whitelist|--bans|--users] + +Defaults to exporting users. ### Set Cluster Roles