diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ee98779..f3c0cd60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,87 @@ # Changelog +## Version 2.0.0-alpha.14 + +This release does not retain backwards compatibility with 2.0.0-alpha.13 meaning all parts of the cluster needs to updated at the same time. +See the [migration guide](/docs/migrating-from-2.0.0-alpha.13.md) for how to update. + +### Major Features + +- Added mod management. Mods can be uploaded to the controller and included in mod packs that can be assigned to instances and run. +- Added host port ranges which the instance ports will be automatically assigned a port from if factorio.game_port is not set. +- Added system info such as CPU model, hostname and kernel along with basic metrics for CPU usage, memory usage and disk usage for the controller and hosts. +- Added ability to remotely view and modify the configuration of hosts. + +### Features + +- Added logging of Clusterio version on startup +- Added `clusterio_controller_log_bytes` metric counting the size of the log files on the controller. +- Added warning logged when plugins on a connecting host does not match the ones installed on the controller. +- Added ability to revoke user tokens. +- Added restart required indicator to config fields in the Web UI. +- Added ability to revoke host tokens. +- Added support for plugins to run in the context of a host. +- Added more feedback when the web UI and or its plugins fails to load. +- Added autosaving of data held in memory on the controller such as configs, instances, users, mods to prevent large data loss on crashing. +- Added `system_info` metric with kernel, instruction set, CPU Model, hostname and Node.js version of the controller. +- Added `clusterio_host_system_info` metric with kernel, instruction set, CPU Model, hostname and Node.js version of hosts. +- Added `system_cpu_seconds_total`, `system_cpu_idle_seconds_total`, `system_memory_capasity_bytes`, `system_memory_available_bytes`, `system_disk_capasity_bytes`, `system_disk_available_bytes` metrics for CPU, memory and disk usage on the controller. +- Added `clusterio_host_system_cpu_seconds_total`, `clusterio_host_system_cpu_idle_seconds_total`, `clusterio_host_system_memory_capasity_bytes`, `clusterio_host_system_memory_available_bytes`, `clusterio_host_system_disk_capasity_bytes`, `clusterio_host_system_disk_available_bytes` metrics for CPU, memory and disk usage on hosts. +- Added support for reading the client's IP address from the `X-Forwarded-For` header when the source address is in the `controller.trusted_proxies` config option. +- Added field showing the IP address a host is connecting from. +- Added per player statistic tracking when they were first seen joining a particular server. +- Added ability to remotely restart and/or stop the controller and hosts. + +### Changes + +- Fixed filenames with extensions that are invalid on Windows such as "con.zip" not being treated as invalid. +- Fixed generate host token modal not using a random id when the optional id field is unset. +- Exported Factorio data is now tied to mod packs instead of being per cluster. +- Fixed export failing if a mod uses a different root folder mod_version in its zip file. +- Fixed sorting of user last seen column in the Web UI. +- The list users permission is now granted by default to players. +- Fixed incorrect handling of hosts and instance with an id of 0 causing them to not update properly. +- Fixed unable to unassign instances in the Web UI. +- Fixed host crashing if the Factorio server is not marked executable. +- Fixed errors logged from instance not being attributed to the instance in certain situations. +- Hosts no longer print messages from instances into their console. +- Clusterio now treat unhandled Node.js errors and promise rejections as fatal and exit immediately. +- Fixed a potential for data loss after a hard system crash due to fsync not being called on files written. +- Fixed Factorio server crashing in the research_sync plugin when a mod enables a previously disabled technology and a player attempts to research it. +- Fixed Factorio server crashing when the game starts with tick_paused = true +- Removed migration of alpha 10's single file log format. +- Log errors linking mods on Windows instead of preventing startup. +- Added locale support for modules patched into to the game save. +- Added support for defining a module_exports.lua file for modules patched into the game save. +- Fixed controller logs being split on server's local time day boundary instead of UTC day boundary. +- Fixed Unicode BOM in mod locale files breaking instance data export. +- Added a warning to the server-setting.json that is automatically written to instance folders stating changes will be overwritten. +- Changed save patching to use a `.tmp.zip` extension for the temporary file created instead of `zip.tmp`. +- Fixed Inventory Sync wiping the player's inventory when logging out while in the Space Exploration remote view mode. +- Fixed the public /api/plugins endponit leaking filesystem paths on the controller. +- Refactored list subscriptions in the Web UI to cache and only fetch updated entries when navigating to previously seen list. +- Added caching of save lists on the controller, enabling the saves of instances on offline hosts to still be seen. +- Hosts in the assign instance dropdown is now sorted by name. +- Added `non_blocking_saving` as one of the default settings added to `factorio.settings` on new instances. + +### Breaking Changes + +- Renamed usage of the terms master and slave to controller and host in all places they occur. +- Mods located in `sharedMods` are no longer copied to instances' mods folder. +- The instances' mods folder is now managed through mod packs, mods not part of the mod pack will be automatically deleted. +- Removed ability to import sub packages like `@clusterio/lib/link` from. +- Replaced `clusterio_controller_http_hits_total` metric with `clusterio_controller_http_endpoint_duration_seconds`. +- Replaced `clusterio_controller_last_query_log_duration_seconds` metric with `clusterio_controller_query_log_duration_seconds` summary. +- Reworked the network protocol to be simpler to work and reason with. +- Bumped minimum supported Node.js version to v18. +- Ported the codebase to TypeScript +- Changed the config format stored on disk to be much simpler. + +### Contributors + +Many thanks to the following for contributing code in this release: +[@Hornwitser](https://github.com/Hornwitser) [@Luciole0x](https://github.com/Luciole0x) [@Cooldude2606](https://github.com/Cooldude2606) [@Danielv123](https://github.com/Danielv123) [@Reavershark](https://github.com/Reavershark) [@Laar](https://github.com/Laar) [@rstrom1763](https://github.com/rstrom1763) + ## Version 2.0.0 ### Major Features @@ -77,8 +159,7 @@ - Removed UPSdisplay plugin. UPS statistics is exported by the statistics exporter plugin. - Controller now defaults to hosting on https on port 8443. -- Renamed master to controller. -- Renamed slave/client to host. +- Renamed client to slave. - Removed rotation of factorio-current.log files. ### Breaking Changes @@ -145,7 +226,6 @@ - Removed automatic creation of self-signed TLS certificate. - Node.js versions below 12 are no longer supported. - ## Version 1.2.4 - Removed broken remote combinator signaling. diff --git a/docs/migrating-from-2.0.0-alpha.13.md b/docs/migrating-from-2.0.0-alpha.13.md new file mode 100644 index 00000000..5472ab19 --- /dev/null +++ b/docs/migrating-from-2.0.0-alpha.13.md @@ -0,0 +1,40 @@ +# Migrating from 2.0.0-alpha.13 to 2.0.0-alpha.14 + +Alpha 14 comes with significant breaking changes for existing clusters, most notably the rename of master and slave to controller and host. +Please study the entire migration guide carefully before attempting to update an existing cluster. + +## Before updating + +If you're using mods you need to create mod pack string for the mod configurations you're currently running. +You can do this by running the follow RCON command on an instance that is currently running the mod configuration you want to use (you can also run this command in single player and find the string printed in Factorio's [Log file](https://wiki.factorio.com/Log_file)): + + /sc local m={name="pack",description="",factorio_version=game.active_mods.base,mods={},settings={startup={},["runtime-global"]={},["runtime-per-user"]={}}} for n,v in pairs(game.active_mods) do table.insert(m.mods,{name=n,enabled=true,version=v}) end local function set(s,c) for n,v in pairs(s) do m.settings[c][n]=v end end set(settings.startup,"startup") set(settings.global,"runtime-global") if game.player then set(game.player.mod_settings,"runtime-per-user") else set(settings.player,"runtime-per-user") end local e=game.encode_string(game.table_to_json(m)) log(e) rcon.print(e) + +This should produce a [Mod Pack String](https://forums.factorio.com/viewtopic.php?f=96&t=103578) which you need to copy and paste somewhere to keep it for later. +Mod Pack strings looks something like this: + + eNqFketuwyAMhd/Fv0OUVpW25lWmqSLESdAIRNh0l4h3n9mlitZt5QdCx/7so8MKXs8ILSzaPEEFPZKJdmEbvIgiDNpwiDaczhjpU93Vu/r+Tmpz6Anah/V7RqcJRUavO4c9tBwTVnAF5upCGJeIsYx3tvsPbQTdb0lKHYlnPJHY0+ONvcdjvW8gP1ZAyGz9KL5XINaR0yLPXEFMnu2ManSh0+6j/GOFitqXG4mjNSUidVm5wlm7JMYG7Qhl3BX8FjyqZ9vztOk+NM2fvRPaceLbzbN+UejQFFOWXzfArvk6v2HWD9ZLv5JfxA1UwsubPBaMKhHGklLO76vAwfQ= + +If you have multiple mod configuration create a mod pack string for each and note them down. + + +## Migrate installations + +**Note:** Check that plugins you are using have updates avaialble for alpha 14 before attempting to update, if they do not either wait for the plugin to be updated or uninstall the plugin from all places it is installed on first. + +Shutdown all slaves and the master server and then migrate each installations by running the following command: + + npm exec @clusterio/create --migrate-rename --log-level=verbose + +This will convert the existing installation's usage of the master and slave names in packages, configs, database and logs to the new controller and host terms and update the installed packages. + +If you're using systemd then copy the generated clusteriocontroller.service and/or clusteriohost.service files from the systemd folder to /etc/systemd/system/ and remove the old clusteriomaster.service and clusterioslave.service files. + +Once the installations have been migrated start up the controller and hosts again. + + +## Post installation + +Import the Mod Pack strings that was created beforehand on the controller and upload the mods needed by those mod packs to the controller. +You can assign a default mod pack in the controller config which instances use by default or set the mod pack on the per instance basis in the instance config. +Once you have assigned a mod pack to an instance run a data export on the instance in order to properly populate the mod settings in the mod and get item icons and item names resolved in the web interface.