Update Clusterio to new version

Includes rename to Controller/Host nomenclature and update to node 20.

Basic testing completed, needs further testing before merging.
This commit is contained in:
PsychoAlex 2024-01-21 22:12:34 +00:00
parent c071eb222b
commit f9e76287a9
2 changed files with 32 additions and 35 deletions

View File

@ -1,7 +1,5 @@
# Clusterio # Clusterio
*A Note on terminology. The developers of Clustorio are using the rather outdated Master/Slave terms for Primary/Secondary or Management/Processing nodes. We will use them in this guide and egg to avoid confusion, but would prefer a more modern set of terminology.*
## Introduction ## Introduction
Clusterio (https://github.com/clusterio/clusterio) is a clustered Factorio server manager that provides the tooling for implementing cross server interactions in Factorio. Clusterio (https://github.com/clusterio/clusterio) is a clustered Factorio server manager that provides the tooling for implementing cross server interactions in Factorio.
@ -23,19 +21,19 @@ Plugins do the work of modding in the visible changes into the game, see the [Pl
## Setup ## Setup
Clusterio uses a Master/Slave system setup, with the Master server running the Web UI and controlling which Slaves run which Instances. Clusterio uses a Controller/Host system setup, with the Controller server running the Web UI and controlling which Hosts run which Instances.
The Master server runs a web server that needs to be reachable for cluster management by the user, and by the other nodes to manage them. The Controller server runs a web server that needs to be reachable for cluster management by the user, and by the other nodes to manage them.
The Slave server runs the factorio server, and will need any mods manually importing at this time, including the Factorio mods for the Clustorio Library(https://mods.factorio.com/mod/clusterio_lib) and Subspace Storage(https://mods.factorio.com/mod/subspace_storage). The Host server runs the factorio server, and will need any mods manually importing at this time, including the Factorio mods for the Clustorio Library(https://mods.factorio.com/mod/clusterio_lib) and Subspace Storage(https://mods.factorio.com/mod/subspace_storage).
Both only require a single port each. Both only require a single port each.
Server Mode controls if the server is a master or slave, and each varaible is labeled as required for Master, Slave or All. Please ensure you fill in all required variables. Server Mode controls if the server is a Controller or Host, and each varaible is labeled as required for Controller, Host or All. Please ensure you fill in all required variables.
Set up the master server first, and from there you can generate the Master URL and Master Token required for the slave servers to connect. Set up the Controller server first, and from there you can generate the Controller URL and Controller Token required for the Host servers to connect.
Additional configuration options can be found in config-master.json and config-slave.json as relevant. Additional configuration options can be found in config-Controller.json and config-Host.json as relevant.
Changes to the Cluster will only be written out to the database on a graceful stop. Changes to the Cluster will only be written out to the database on a graceful stop.
@ -45,5 +43,5 @@ Clusterio requires a single port
| Port | default | | Port | default |
|------------|------------| |------------|------------|
| Master HTTP| 8081 | | Controller HTTP| 8081 |
| Slave Game | 34197 | | Host Game | 34197 |

View File

@ -4,42 +4,41 @@
"version": "PTDL_v2", "version": "PTDL_v2",
"update_url": null "update_url": null
}, },
"exported_at": "2022-10-05T19:06:42-04:00", "exported_at": "2024-01-21T21:55:07+00:00",
"name": "Clusterio", "name": "Clusterio",
"author": "psychoalex@thevcbc.com", "author": "psychoalex@thevcbc.com",
"description": "Clusterio is a clustered Factorio server manager that provides the tooling for implementing cross server interactions in Factorio. It was previously best known for implementing cross server transfer and cloud storage of items via teleporter chests. But this functionality has been pulled out of Clusterio into its own plugin for Clusterio named Subspace Storage.\r\n\r\nBy itself Clusterio doesn't change the gameplay in any way, you could even use Clusterio to manage completely vanilla Factorio servers. Plugins do the work of modding in the visible changes into the game, see the Plugins section for ready-made plugins you can install into a Clusterio cluster.\r\n\r\nA Note on terminology. The developers of Clustorio are using the rather outdated Master\/Slave terms for Primary\/Secondary or Management\/Processing nodes. We will use them in this guide and egg to avoid confusion, but would prefer a more modern set of terminology.", "description": "Clusterio is a clustered Factorio server manager that provides the tooling for implementing cross server interactions in Factorio. It was previously best known for implementing cross server transfer and cloud storage of items via teleporter chests. But this functionality has been pulled out of Clusterio into its own plugin for Clusterio named Subspace Storage.\r\n\r\nBy itself Clusterio doesn't change the gameplay in any way, you could even use Clusterio to manage completely vanilla Factorio servers. Plugins do the work of modding in the visible changes into the game, see the Plugins section for ready-made plugins you can install into a Clusterio cluster.",
"features": null, "features": null,
"docker_images": { "docker_images": {
"ghcr.io\/parkervcp\/yolks:nodejs_17": "ghcr.io\/parkervcp\/yolks:nodejs_17", "ghcr.io\/parkervcp\/yolks:nodejs_21": "ghcr.io\/parkervcp\/yolks:nodejs_21",
"ghcr.io\/parkervcp\/yolks:nodejs_16": "ghcr.io\/parkervcp\/yolks:nodejs_16", "ghcr.io\/parkervcp\/yolks:nodejs_20": "ghcr.io\/parkervcp\/yolks:nodejs_20",
"ghcr.io\/parkervcp\/yolks:nodejs_15": "ghcr.io\/parkervcp\/yolks:nodejs_15", "ghcr.io\/parkervcp\/yolks:nodejs_19": "ghcr.io\/parkervcp\/yolks:nodejs_19",
"ghcr.io\/parkervcp\/yolks:nodejs_14": "ghcr.io\/parkervcp\/yolks:nodejs_14", "ghcr.io\/parkervcp\/yolks:nodejs_18": "ghcr.io\/parkervcp\/yolks:nodejs_18"
"ghcr.io\/parkervcp\/yolks:nodejs_12": "ghcr.io\/parkervcp\/yolks:nodejs_12"
}, },
"file_denylist": [], "file_denylist": [],
"startup": "exec .\/node_modules\/.bin\/clusterio{{SERVER_MODE}} run", "startup": "exec .\/node_modules\/.bin\/clusterio{{SERVER_MODE}} run",
"config": { "config": {
"files": "{\r\n \"config-master.json\": {\r\n \"parser\": \"json\",\r\n \"find\": {\r\n \"groups[0].fields.http_port\": \"{{server.build.default.port}}\",\r\n \"groups[0].fields.name\": \"{{server.build.env.CLUSTER_NAME}}\"\r\n }\r\n },\r\n \"config-slave.json\": {\r\n \"parser\": \"json\",\r\n \"find\": {\r\n \"groups[0].fields.master_url\": \"{{server.build.env.MASTER_URL}}\",\r\n \"groups[0].fields.master_token\": \"{{server.build.env.MASTER_TOKEN}}\",\r\n \"groups[0].fields.public_address\": \"{{server.build.default.ip}}\"\r\n }\r\n }\r\n}", "files": "{\r\n \"config-controller.json\": {\r\n \"parser\": \"json\",\r\n \"find\": {\r\n \"controller~1http_port\": \"{{server.build.default.port}}\",\r\n \"controller~1name\": \"{{server.build.env.CLUSTER_NAME}}\"\r\n }\r\n },\r\n \"config-host.json\": {\r\n \"parser\": \"json\",\r\n \"find\": {\r\n \"host~1controller_url\": \"{{server.build.env.CONTROLLER_URL}}\",\r\n \"host~1controller_token\": \"{{server.build.env.CONTROLLER_TOKEN}}\",\r\n \"host~1public_address\": \"{{server.build.default.ip}}\"\r\n }\r\n }\r\n}",
"startup": "{\r\n \"done\": \"Started\"\r\n}", "startup": "{\r\n \"done\": \"Started\"\r\n}",
"logs": "{}", "logs": "{}",
"stop": "^c" "stop": "^c"
}, },
"scripts": { "scripts": {
"installation": { "installation": {
"script": "#!\/bin\/bash\r\n# Clusterio Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\ncase \"${SERVER_MODE}\" in\r\n\r\n \"master\")\r\n echo -e \"Initialising Clustorio In Master mode\"\r\n npm init \"@clusterio\" --allow-install-as-root --mode \"${SERVER_MODE}\" --download-headless --log-level \"${LOG_LEVEL}\" --admin \"${ADMIN_STRING}\" --public-address \"${SERVER_IP}\":\"${SERVER_PORT}\" --plugins ${PLUGINS}\r\n\t;;\r\n\r\n \"slave\")\r\n echo -e \"Initialising Clustorio In Slave mode\"\r\n\tnpm init \"@clusterio\" --allow-install-as-root --mode \"${SERVER_MODE}\" --download-headless --log-level \"${LOG_LEVEL}\" --slave-name \"${SLAVE_NAME}\" --public-address \"${SERVER_IP}\" --master-url \"${MASTER_URL}\" --master-token \"${MASTER_TOKEN}\" --plugins ${PLUGINS}\r\n ;;\r\n \r\nesac\r\n\r\necho -e \"install complete\"\r\nexit 0", "script": "#!\/bin\/bash\r\n# Clusterio Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\ncase \"${SERVER_MODE}\" in\r\n\r\n \"controller\")\r\n echo -e \"Initialising Clustorio In Controller mode\"\r\n npm init \"@clusterio\" -y -- --allow-install-as-root --mode \"${SERVER_MODE}\" --download-headless --log-level \"${LOG_LEVEL}\" --admin \"${ADMIN_STRING}\" --public-address \"${SERVER_IP}\":\"${SERVER_PORT}\" --plugins ${PLUGINS}\r\n\t;;\r\n\r\n \"host\")\r\n echo -e \"Initialising Clustorio In Host mode\"\r\n\tnpm init \"@clusterio\" -y -- --allow-install-as-root --mode \"${SERVER_MODE}\" --download-headless --log-level \"${LOG_LEVEL}\" --host-name \"${HOST_NAME}\" --public-address \"${SERVER_IP}\" --controller-url \"${CONTROLLER_URL}\" --controller-token \"${CONTROLLER_TOKEN}\" --plugins ${PLUGINS}\r\n ;;\r\n \r\nesac\r\n\r\necho -e \"install complete\"\r\nexit 0",
"container": "node:14-buster-slim", "container": "node:21-bullseye-slim",
"entrypoint": "bash" "entrypoint": "bash"
} }
}, },
"variables": [ "variables": [
{ {
"name": "Server Mode", "name": "Server Mode",
"description": "Set's the cluster operation mode of the server, can be either \"master\" or \"slave\". This is better thought of as Management or Gameserver nodes.\r\n\r\nRequired on:\r\nAll", "description": "Set's the cluster operation mode of the server, can be either \"controller\" or \"host\". This is better thought of as Management or Gameserver nodes.\r\n\r\nRequired on:\r\nAll",
"env_variable": "SERVER_MODE", "env_variable": "SERVER_MODE",
"default_value": "master", "default_value": "controller",
"user_viewable": true, "user_viewable": true,
"user_editable": true, "user_editable": true,
"rules": "required|string|in:master,slave", "rules": "required|string|in:controller,host",
"field_type": "text" "field_type": "text"
}, },
{ {
@ -63,9 +62,9 @@
"field_type": "text" "field_type": "text"
}, },
{ {
"name": "Slave Name", "name": "Host Name",
"description": "Slave name in the Master Web UI\r\n\r\nRequired on:\r\nSlave", "description": "Slave name in the Master Web UI\r\n\r\nRequired on:\r\nHost",
"env_variable": "SLAVE_NAME", "env_variable": "HOST_NAME",
"default_value": "Your Sub-Server", "default_value": "Your Sub-Server",
"user_viewable": true, "user_viewable": true,
"user_editable": true, "user_editable": true,
@ -73,9 +72,9 @@
"field_type": "text" "field_type": "text"
}, },
{ {
"name": "Master URL", "name": "Controller URL",
"description": "Connection URL to the Master server, can be an internal address if you have allocated an additional internal port to the Master Server.\r\n\r\nExample: http:\/\/yourip:yourport\/\r\n\r\nRequired on:\r\nSlave", "description": "Connection URL to the Controller server, can be an internal address if you have allocated an additional internal port to the Master Server.\r\nExample: http:\/\/yourip:yourport\r\nRequired on:\r\nHost",
"env_variable": "MASTER_URL", "env_variable": "CONTROLLER_URL",
"default_value": "", "default_value": "",
"user_viewable": true, "user_viewable": true,
"user_editable": true, "user_editable": true,
@ -83,9 +82,9 @@
"field_type": "text" "field_type": "text"
}, },
{ {
"name": "Master Token", "name": "Controller Token",
"description": "Authentication token used to connect to the Master server, Must be generated through the Master Web UI after setting up and logging into the Master Web UI using the admin auth token generated when setting up the Master.\r\n\r\nRequired on:\r\nSlave", "description": "Authentication token used to connect to the Master server, generated through the Master Web UI.\r\n\r\nRequired on:\r\nHost",
"env_variable": "MASTER_TOKEN", "env_variable": "CONTROLLER_TOKEN",
"default_value": "", "default_value": "",
"user_viewable": true, "user_viewable": true,
"user_editable": true, "user_editable": true,
@ -94,7 +93,7 @@
}, },
{ {
"name": "Plugins", "name": "Plugins",
"description": "Clusterio Plugins to install, space separate list.\r\n\r\nExample:\r\n@clusterio\/plugin-global_chat\r\n@clusterio\/plugin-research_sync\r\n@clusterio\/plugin-statistics_exporter\r\n\r\nCurrent available clusterio plugins include:\r\n@clusterio\/plugin-global_chat\r\n@clusterio\/plugin-research_sync\r\n@clusterio\/plugin-statistics_exporter\r\n@clusterio\/plugin-subspace_storage (requires the mod to be installed on the slave)\r\n@clusterio\/plugin-player_auth\r\n@clusterio\/plugin-inventory_sync\r\n@hornwitser\/server_select\r\n\r\nRequired on:\r\nAll", "description": "Clusterio Plugins to install, space separate list.\r\n\r\nExample:\r\n@clusterio\/plugin-subspace_storage @clusterio\/plugin-global_chat @clusterio\/plugin-research_sync @clusterio\/plugin-inventory_sync\r\n\r\nRequired on:\r\nAll",
"env_variable": "PLUGINS", "env_variable": "PLUGINS",
"default_value": "", "default_value": "",
"user_viewable": true, "user_viewable": true,
@ -104,7 +103,7 @@
}, },
{ {
"name": "Cluster Name", "name": "Cluster Name",
"description": "The Name of your Cluster Master server.\r\n\r\nRequired:\r\nMaster", "description": "The Name of your Master server cluster.\r\n\r\nRequired:\r\nController",
"env_variable": "CLUSTER_NAME", "env_variable": "CLUSTER_NAME",
"default_value": "Your Cluster", "default_value": "Your Cluster",
"user_viewable": true, "user_viewable": true,