The mod prints its packets to the server's standard output, and Docker's
syslog log driver sends them to Kafkatorio. kafkatorio-forward.py does
the same without Docker: it runs the server (or reads its output from a
pipe), prints the output as usual, and sends the mod's packets to the
syslog port in the same format as Docker, tagged with the token.
- the server keeps running when Kafkatorio is unreachable: packets wait in
a bounded buffer, and are sent after reconnecting
- before each send it checks Kafkatorio hasn't closed the connection, so
lines aren't silently lost in a dead socket
- Ctrl+C and SIGTERM are passed to the server once, so it saves and stops
- the token is read from a file or the environment, not the command line
- only the Python standard library
util-linux's logger can't be used instead: it rejects the token, which is
longer than syslog's 48 character APP-NAME limit.
Tested on Linux with a Factorio 2.0.77 server: packets arrive, the
forwarder reconnects when the syslog server restarts (no packets lost),
and the server saves when stopped.
The guide has a section for it, with a systemd service example, and the
README no longer says the Factorio server must run in Docker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>