feat(minecraft): wake worlds on demand through mc-router, at most two at once #44
No reviewers
Labels
No labels
area/backups
area/ci
area/containers
area/mail
area/minecraft
area/network
area/observability
area/tls
area/tofu
kind
bug
kind
chore
kind
feature
kind
investigation
kind
security
priority
high
priority
low
priority
medium
status/blocked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
hutao/vps!44
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mc-router"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
mc-router now owns the public 25565 and sends each player to a world by the
hostname they typed (
minecraft./mc./bare IP → world 1,mc2.→ world 2).Worlds publish no game port, start when someone logs in, and stop ten
minutes after the last player leaves. At most two run at once.
modules/containers/mc-router.nix: mc-router 1.48.0 (the release whereonly logins, not server-list pings, wake a world or reset its idle timer).
modules/containers/minecraft-cap.nix: the cap, anExecConditionon eachworld's unit, so it holds for the webhook, a hand-typed
systemctl startand the backup alike. Plus
minecraft-scaler, mc-router's webhookreceiver: root because polkit is off, no capabilities,
IPAddressAllowset to mc-router's address.
mcnetwork (172.31.0.0/24). Worlds get addresses from172.31.0.128/25so they can never take mc-router's.2.mcnetworkis subtracted from the broad bridge rule (the worlds run third-party mods).
every start while it runs.
mc2SRV record and the edge 25566 rule removed.Deployed
Already live on the VPS from this branch (2026-10-22):
172.31.0.2before mc-router started, somc-router failed with
Address already in use. Fixed in56133ba(
--ip-range), redeployed, and themcnetwork recreated by hand (onlymc-router was on it, nobody online).
mc.,mc2.andminecraft.all answer throughmc-router with the asleep MOTD.
mc2.woke world 2; it answered after 24s on172.31.0.128.change (drop 25566, rename the 25565 rule) is still pending, so a full
tofu planshows it. nftables already drops 25566 on the box.Checks
nix build .#checks.x86_64-linux.minecraft-cap -L(hand-run, needs KVM):7/7 subtests pass. They cover the cap's 409, a refused start not looping,
the hold file, a three-way start race landing on two, bad input, and the
source-address restriction.
nix flake check --no-build, all pre-commit hooks, and the mdbook build pass.Known limits
later, gets in.
UUID).
booted, has no connection through mc-router and never gets the idle stop.
AUTO_SCALE_ALLOW_DENYwould limit waking to known players.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.