mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
Rethrow errors other than ENOENT and ENOTDIR when reading the package spec as a directory, mark the tests that run npm as slow so FAST_TEST skips them, and use ./external_plugins/my_plugin in the README examples. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
105 lines
3.8 KiB
Markdown
105 lines
3.8 KiB
Markdown
# Clusterio Host
|
|
|
|
Node hosting Factorio servers in a Clusterio cluster.
|
|
Clusterio hosts connect to the controller and waits for commands from the controller to start up and stop instances.
|
|
A cluster can have any number of hosts in it located on different computers, and each host can host any number of instances each of which is a Factorio server that talks with the rest of the cluster.
|
|
|
|
|
|
## Usage
|
|
|
|
npx clusteriohost <command>
|
|
|
|
Common options:
|
|
|
|
* `--plugin-list <file>` JSON file to use for storing the list of plugins that are available to the host.
|
|
Defaults to `plugin-list.json` and will be created if it does not exist.
|
|
See the `plugin` command for managing this list.
|
|
|
|
* `--config <file>` JSON file to use for storing configuration for the host.
|
|
Defaults to `config-host.json` and will be created if it does not exist.
|
|
See the `config` command for inspecting and modifying the configuration.
|
|
|
|
|
|
### `plugin <command>`
|
|
|
|
Configure plugins available to be loaded by the host.
|
|
The available plugins will be loaded unless they have been disabled in the configuration, see the config command for disabling plugins.
|
|
|
|
|
|
#### `plugin install <package>`
|
|
|
|
Install a plugin from npm and add it to the plugin list.
|
|
The package is passed to `npm install --save` so anything npm accepts works, including a version like `@clusterio/plugin-subspace_storage@2.0.0`.
|
|
This command refuses to run outside the directory Clusterio was installed in, as the plugin has to end up in that directory's node_modules to be found.
|
|
|
|
For example, installing the Subspace Storage plugin:
|
|
|
|
npx clusteriohost plugin install @clusterio/plugin-subspace_storage
|
|
|
|
Since the `plugin-list.json` is shared between controller, host and ctl you usually only need to do this once per machine.
|
|
|
|
|
|
#### `plugin add <path>`
|
|
|
|
Add plugin either by require path or relative/absolute path to the plugin directory.
|
|
A relative path must start with ./ or ../ (or .\ and ..\ on Windows) otherwise it will be assumed to be a require path for an installed package in node_modules.
|
|
This is mainly useful for plugins under development, packages published on npm are better installed with `plugin install`.
|
|
|
|
For example, adding a plugin checked out in the external_plugins directory:
|
|
|
|
npx clusteriohost plugin add ./external_plugins/my_plugin
|
|
|
|
|
|
#### `plugin remove <name>`
|
|
|
|
Remove a plugin by its name.
|
|
This should be done before uninstalling the plugin, otherwise there will be an error when Clusterio tries to load the info from the plugin.
|
|
Removing and unistalling a plugin is usually not neccessary as the functions provided by the plugin can be disabled in the config.
|
|
|
|
For example, uninstalling the Subspace Storage plugin:
|
|
|
|
npx clusteriohost plugin remove subspace_storage
|
|
npm uninstall @clusterio/plugin-subspace_storage
|
|
|
|
Since the `plugin-list.json` is shared between controller, host and ctl you usually only need to do this once per machine.
|
|
|
|
|
|
#### `plugin list`
|
|
|
|
Lists the plugins set up to be available by name followed by path.
|
|
|
|
|
|
### `config`
|
|
|
|
Manage the host configuration offline.
|
|
This should only be used when the host is stopped, otherwise the config read might be out of date and config changes will be overwritten when the host shuts down.
|
|
|
|
|
|
#### `config set <config-entry> [value]`
|
|
|
|
Set a config entry to the given value.
|
|
If value is not provided the entry is set to null.
|
|
If the config entry is of type object the value must be a valid JSON serialization of an object.
|
|
|
|
See docs/configuration.md in the main repositiory for the available configuration.
|
|
|
|
|
|
#### `config show <config-entry>`
|
|
|
|
Shows the value for a single config entry.
|
|
|
|
|
|
#### `config list`
|
|
|
|
Lists up all configuration entries with their currently configured values.
|
|
|
|
|
|
### `run`
|
|
|
|
Runs the host.
|
|
|
|
|
|
## See Also
|
|
|
|
[The Clusterio repository](https://github.com/clusterio/clusterio) for instructions on how to set up a cluster.
|