Commit Graph
3635 Commits
Author SHA1 Message Date
bbassieandClaude Opus 5.5 fb93962972 Document clusterioctl setup and the missing commands
Adds a setup section covering the installer, create-ctl-config, a
hand-made config and self-signed certificates. Documents the commands
that were missing or marked "To be written": controller and host
stop, restart and config, instance start, restart, stop, start-all,
stop-all, load-scenario, delete, send-rcon and export-data, saves,
config set-prop, mods, mod packs, user show and revoke-token, roles,
permissions and logs.

Part of #1254

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:00:06 +00:00
bbassieandClaude Opus 5.5 2a7a333b95 Rename managing-a-cluster.md to clusterioctl.md
The document is a reference for the clusterioctl commands. The name
is freed up for a guide to managing a cluster.

Part of #1254

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:00:06 +00:00
Cooldude2606andClaude Opus 5.5 8865038af5 Add bulk save actions and name search to the saves table (#1256)
* Add save selection, name search and bulk transfer to the saves table

Rows get checkboxes and the header checkbox selects every save matching
the name search, including those on other pages. Selected saves can be
copied or moved to another instance in one go, with copy on by default.

Closes #1253

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add bulk copy, download and delete for selected saves

Copy picks name-2.zip, name-3.zip and so on, skipping names already
taken, because the host refuses to overwrite on copy. Downloads use a
link with the download attribute so several in a row do not cancel
each other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Drop bulk copy from the selected saves actions

Copy on the same instance is rarely needed in bulk, and Transfer with
Copy ticked covers copying to another instance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:50:09 +00:00
bbassieandClaude Opus 5.5 f338c5fd91 Drop bulk copy from the selected saves actions
Copy on the same instance is rarely needed in bulk, and Transfer with
Copy ticked covers copying to another instance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:10:38 +00:00
Bastiaan bee6714ff8 Merge pull request #1258 from bbassie/feature/mod-pack-upload
Add mod upload to the mod pack view
2026-11-21 21:09:38 +00:00
Cooldude2606 ef3b4cb8fc Merge pull request #1257 from bbassie/feature/plugin-dropdown-actions
Let plugins add actions to page dropdowns
2026-11-21 21:05:16 +00:00
bbassieandClaude Opus 5.5 cd2933417a Add bulk copy, download and delete for selected saves
Copy picks name-2.zip, name-3.zip and so on, skipping names already
taken, because the host refuses to overwrite on copy. Downloads use a
link with the download attribute so several in a row do not cancel
each other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:04:04 +00:00
bbassieandClaude Opus 5.5 bd912a8fd4 Respect disabled on the main dropdown button action
A plugin action can be disabled, and it becomes the main button when
the user has no restart permission. Only the main button is disabled so
the menu stays usable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:30:18 +00:00
bbassieandClaude Opus 5.5 86befd1231 Let plugins add actions to page dropdowns
Adds control.hooks.pageActions. A plugin returns a function per page
(ControllerPage, HostViewPage, InstanceViewPage, UserViewPage) that is
called during render and returns menu items. Keys are prefixed with the
plugin name. Plugin items go after the built-in ones and before stop and
delete. The user page and instance templates get a More dropdown only
when a plugin adds actions.

Closes #1243

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:14:41 +00:00
bbassieandClaude Opus 5.5 73d70cbc91 Add save selection, name search and bulk transfer to the saves table
Rows get checkboxes and the header checkbox selects every save matching
the name search, including those on other pages. Selected saves can be
copied or moved to another instance in one go, with copy on by default.

Closes #1253

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:06:38 +00:00
Cooldude2606 516dc1b945 Merge pull request #1252 from bbassie/feature/instance-crash-restart
Restart instances that crash after running for 10 minutes
2026-11-21 17:21:45 +00:00
bbassieandClaude Opus 5.5 079340e5dd Reset crash restart attempts on a manual start
A stop is always followed by a start, so the start is the one place that
needs it. The crash restart calls _startSave directly to keep its count.
Rename _runningSinceMs to _startedAtMs to match InstanceDetails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:29:03 +00:00
bbassieandClaude Opus 5.5 565e931a96 Restart instances that crash after running for 10 minutes
Adds instance.restart_after_crash (default off) and
instance.crash_retry_attempts (default 3, 0 for no limit). The host only
restarts an instance that ran for at least 10 minutes before exiting
unexpectedly, so a boot loop stops after one crash. A user stop, kill or
restart resets the count; it is not persisted across host restarts.

Closes #1251

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 15:55:28 +00:00
Cooldude2606 7a2aade25b Merge pull request #1250 from bbassie/feature/upload-progress
Show upload progress with a cancel button
2026-11-21 15:12:12 +00:00
Cooldude2606andClaude Opus 5.5 2bba4a8ccd Add a prepare release script (#1244)
* Add a prepare release script

scripts/prepare_release.mts takes a version, sets it in the package.json
files under packages/ and plugins/, adds the pr_to_changelog.mts output to
the top of CHANGELOG.md, then commits "Prepare <version>" and tags it
v<version>. It does not push.

pr_to_changelog.mts now exports generateReleaseNotes() so the output can
be reused. The template comment in CHANGELOG.md is removed so the first
"## " heading is always the latest release.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Stop prepare_release on changelog problems unless --force

generateReleaseNotes() returns the errors and warnings from the pull
request changelogs instead of printing them. prepare_release.mts lists
them and aborts before touching any file, --force continues anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 03:05:03 +00:00
BastiaanandClaude Opus 5.5 c03666e749 Add version select to mods in the mod pack view (#1248)
The Version column is now a dropdown of every version of that mod on
the controller, newest first. Versions built for a different Factorio
version than the pack say so, and a pack version missing from the
controller stays listed as "(missing)". Mods with no other version,
built-in mods and removed mods still show plain text.

Closes #1245

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 03:02:15 +00:00
bbassieandClaude Opus 5.5 3ca203c753 Stop prepare_release on changelog problems unless --force
generateReleaseNotes() returns the errors and warnings from the pull
request changelogs instead of printing them. prepare_release.mts lists
them and aborts before touching any file, --force continues anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 02:56:38 +00:00
bbassieandClaude Opus 5.5 fcf858023e Show upload progress with a cancel button for mods and saves
Both pages share a useUploadProgress hook that wraps antd's default
request, lists each upload with bytes sent and a Cancel button, and
notifies with the controller's error message when an upload fails.
Mod uploads showed nothing before, and failures were silent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 02:50:22 +00:00
bbassieandClaude Opus 5.5 faf214e2a1 Remove partial downloads when the stream is cut mid-write
When the connection drops while the body is being written, the pipe
destroys the file stream with an error before it has closed.
events.once then rejects on that error, so the temporary file was
never unlinked. A save upload cancelled from the web UI left a
<name>.tmp.zip in the instance saves folder, listed as a save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 02:50:22 +00:00
bbassieandClaude Opus 5.5 8e01a96df9 Add a prepare release script
scripts/prepare_release.mts takes a version, sets it in the package.json
files under packages/ and plugins/, adds the pr_to_changelog.mts output to
the top of CHANGELOG.md, then commits "Prepare <version>" and tags it
v<version>. It does not push.

pr_to_changelog.mts now exports generateReleaseNotes() so the output can
be reused. The template comment in CHANGELOG.md is removed so the first
"## " heading is always the latest release.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 02:28:33 +00:00
Bastiaan 8692ea3941 Merge pull request #1241 from bbassie/chore/move-root-scripts
Move clean and publish scripts into scripts folder
2026-11-21 02:23:48 +00:00
Cooldude2606 a49841f3fc Merge pull request #1237 from bbassie/fix/stream-slow-receiver-test
Measure transfer_min_speed in KiB/s and raise it to 64
2026-11-20 22:33:08 +00:00
bbassieandClaude Opus 5.5 2e273dc630 Take a burst allowance off what a transfer check requires
controller.transfer_min_speed is now the speed that is never closed.
A check requires that speed over 60 s less 2 MiB, which covers the
bursts the OS sends data in, so at the default of 64 KiB/s the cutoff
is about 30 KiB/s. The requirement is at least 1 byte, so a transfer
that moved nothing is still closed at low settings.

The slow receiver test sends 16 MiB so that it spans real checks, and
two upload tests with set bursts cover the allowance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 22:13:51 +00:00
bbassieandClaude Opus 5.5 42bc31e406 Check transfer speed over 60 seconds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:59:37 +00:00
bbassieandClaude Opus 5.5 19569aefa4 Measure transfer_min_speed in KiB/s and raise it to 64
The guard measures a proxy stream on completed writes to the receiver.
The OS buffers a couple of MiB per connection and only takes more once
a large part has been sent, so a slow receiver can go a long time with
no write completing. At the old default of 30 KiB per 30 s, downloads
well above that could be closed, and the slow receiver test failed
every run on Linux.

controller.transfer_min_progress (KiB per 30 s) is replaced by
controller.transfer_min_speed (KiB/s), defaulting to 64. At that speed
the measured 1.6 MB bursts come within the 30 second check. Configs
on the old default move to the new one, other values are converted.
The slow receiver test checks every 3 s instead of 500 ms, as with a
500 ms check it fails at any minimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:59:37 +00:00
Cooldude2606 e9a11013a4 Merge pull request #1236 from bbassie/chore/web-bundle-zip-zlib
Keep yauzl, browserify-zlib and assert out of the web interface
2026-11-20 20:55:12 +00:00
Cooldude2606andClaude Opus 5.5 59fa8403de Keep yauzl and yazl types out of lib's published declarations (#1235)
* Keep yauzl and yazl types out of lib's published declarations

ZipArchive exposed yauzl.ZipFile and yauzl.Entry in its public members
and zipOutputStream took a yazl.ZipFile, so @types/yauzl and @types/yazl
had to be runtime dependencies of @clusterio/lib. They pull in
@types/node and undici-types, about 2.7 MB in every server install.

Entries are now typed with a local ZipEntry interface, the yauzl
ZipFile is private, and zipOutputStream takes any object with an
outputStream and an error event. ZipWriter.addEntry reads the
compressed bytes through the new ZipArchive.openRawStream. Both type
packages move to devDependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Explain why ZipEntry is a local type

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:54:56 +00:00
Bastiaan 1c18dc3661 Merge pull request #1234 from bbassie/chore/inline-daily-rotate
Replace winston-daily-rotate-file with an in-repo transport
2026-11-20 20:54:42 +00:00
Bastiaan 81c7d24867 Merge pull request #1233 from bbassie/chore/drop-chalk
Replace chalk with util.styleText
2026-11-20 20:54:30 +00:00
Cooldude2606 bd41801c8d Prepare 2.1.1 v2.1.1 2026-11-20 16:36:01 +00:00
bbassieandClaude Opus 5.5 c4a9545d28 Explain why ZipEntry is a local type
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 16:11:36 +00:00
Cooldude2606 34deacb881 Merge pull request #1230 from bbassie/feature/ctl-output-json
Add --output json to clusterioctl
2026-11-20 15:22:38 +00:00
bbassieandClaude Opus 5.5 6dc48b6732 Replace node:assert in link with a local assert
The assert polyfill is 28 KB in the web interface bundle and link only
uses it for plain truthiness checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:19:04 +00:00
bbassieandClaude Opus 5.5 4d7c1020b0 Use fflate for zlib in the web interface
ModPack and map exchange strings need synchronous inflate and deflate.
In the browser these came from the browserify-zlib polyfill, which
brings pako, assert and util along. The browser build now imports
fflate through a #zlib_sync subpath import, Node.js keeps node:zlib.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:18:37 +00:00
bbassieandClaude Opus 5.5 909f6ab08b Move ModInfo.fromModFile to ModStore.readModInfo
Reading a mod zip needs zip_ops, which pulled yauzl into the web
interface bundle through the data classes. ModStore is node only, so
the zip reading now lives there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:17:40 +00:00
Cooldude2606 464baabf96 Merge pull request #1220 from clusterio/player-sync-rejected-upload
Download at the next join when the controller did not store an upload
2026-11-19 20:54:28 +00:00
bbassieandClaude Opus 5.5 aaafce4ace Keep yauzl and yazl types out of lib's published declarations
ZipArchive exposed yauzl.ZipFile and yauzl.Entry in its public members
and zipOutputStream took a yazl.ZipFile, so @types/yauzl and @types/yazl
had to be runtime dependencies of @clusterio/lib. They pull in
@types/node and undici-types, about 2.7 MB in every server install.

Entries are now typed with a local ZipEntry interface, the yauzl
ZipFile is private, and zipOutputStream takes any object with an
outputStream and an error event. ZipWriter.addEntry reads the
compressed bytes through the new ZipArchive.openRawStream. Both type
packages move to devDependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:39:58 +00:00
Cooldude2606andClaude Opus 5.5 dd20054151 Add requiredMods to plugin declarations (#1229)
* Add requiredMods to plugin declarations

Plugins can list the Factorio mods they need under requiredMods. When an
instance starts, the host warns in the instance log about each loaded
plugin whose required mods are missing or disabled in the mod pack.
Subspace Storage declares the subspace_storage mod.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Refuse to start without required mods and download them

requiredMods entries are now Factorio dependency strings, and a mod
listed twice gives a version range. The plugin loader validates them.

The host refuses to start an instance whose mod pack is missing a
required mod of a loaded plugin, has it disabled or has it outside the
version range.

On start the controller resolves the required mods of its plugins and
their dependencies for the default mod pack's Factorio version and
downloads the ones missing from the mod store. The resolver and portal
download move from the ControlConnection handlers into Controller
methods so both paths share them.

Subspace Storage requires subspace_storage >= 1.99.0, and the
integration tests build a stub of that mod for the test mod pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add a Factorio 1.1 variant to the subspace_storage test stub

The 1.1 test jobs failed because the test mod pack asked for
subspace_storage 2.3.11, which the stub did not build. The real mod
publishes 2.3.11 for 1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:07:40 +00:00
bbassieandClaude Opus 5.5 dbedc4bc08 Add a Factorio 1.1 variant to the subspace_storage test stub
The 1.1 test jobs failed because the test mod pack asked for
subspace_storage 2.3.11, which the stub did not build. The real mod
publishes 2.3.11 for 1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:02:31 +00:00
bbassieandClaude Opus 5.5 3aefcb062f Unit test mod-pack show warnings and export assets
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 16:26:37 +00:00
bbassieandClaude Opus 5.5 c5ad1953ad Unit test mod show and user show output
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 16:20:21 +00:00
bbassieandClaude Opus 5.5 f52821d1cd Cover ctl output code that only ran in child processes
CI coverage does not measure the ctl processes the integration tests start, so cover the Ctl log and debug event handlers, start-all, stop-all and pickFields with unit tests, and run mod show, user list flags, parse-exchange-string and log follow in process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 16:14:58 +00:00
bbassieandClaude Opus 5.5 f49c633e77 Cover ctl output paths and stop deleting fields before printing
user show, mod list, mod search and mod-pack list deleted fields off the received objects to trim the table, which made their toJSON throw in wire mode. They now pick the fields for the human table only and print the whole objects in json and wire mode.

Add integration cases for config edit on the controller, a host and an instance, user show with instance stats, log query and host pending in human mode, mod-pack show with mods and settings, and wire output of the trimmed lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 16:05:08 +00:00
bbassieandClaude Opus 5.5 23187859d6 Address second review of ctl --output
CommandOutput.error takes a human reporter like result, so command errors log their message in human mode and print JSON in json and wire mode. table takes a map applied to each row in human mode, which note list, host plugin list, user list and save list now use. Rename streaming to streamingLog, and print startup errors with errorToJson directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:56:48 +00:00
bbassieandClaude Opus 5.5 bf33f4f52e Refuse to start without required mods and download them
requiredMods entries are now Factorio dependency strings, and a mod
listed twice gives a version range. The plugin loader validates them.

The host refuses to start an instance whose mod pack is missing a
required mod of a loaded plugin, has it disabled or has it outside the
version range.

On start the controller resolves the required mods of its plugins and
their dependencies for the default mod pack's Factorio version and
downloads the ones missing from the mod store. The resolver and portal
download move from the ControlConnection handlers into Controller
methods so both paths share them.

Subspace Storage requires subspace_storage >= 1.99.0, and the
integration tests build a stub of that mod for the test mod pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:19:05 +00:00
bbassieandClaude Opus 5.5 a845b7ac52 Add requiredMods to plugin declarations
Plugins can list the Factorio mods they need under requiredMods. When an
instance starts, the host warns in the instance log about each loaded
plugin whose required mods are missing or disabled in the mod pack.
Subspace Storage declares the subspace_storage mod.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:07:06 +00:00
bbassieandClaude Opus 5.5 8550df69eb Address review of ctl --output
Add a wire output format that prints the toJSON format sent over the link. Commands without a result print {"success": true}, or "Command ran successfully" in human mode. The missing URL check throws a StartupError, unexpected command errors are rethrown to the startup handler, and startup errors log as fatal. user list, note list and host plugin list print the objects they received instead of their table rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 16:48:40 +00:00
Bastiaan eefb4be44b Merge pull request #1231 from bbassie/fix/link-test-system-info
Answer system info requests in the link integration test
2026-11-18 14:29:13 +00:00
Cooldude2606 b8e96989af Merge pull request #1228 from bbassie/feature/arm-headless
Support the ARM64 Linux headless build of Factorio
2026-11-18 13:33:28 +00:00
Cooldude2606 e814309750 Merge pull request #1227 from bbassie/fix/machine-details-on-start
Collect system info on start and when a host connects
2026-11-18 13:22:55 +00:00