[PR #554] [MERGED] horizon-server: install scripts, a Docker image, and boot services #2639

Closed
opened 2026-11-02 15:57:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/554
Author: @ludovic111
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @ludovic111

Base: main ← Head: feat/horizon-server-packaging


📝 Commits (8)

  • 9d21209 horizon-server: server.toml, init, and a supervisor that runs the game
  • e883219 horizon-server: start, stop, status, cmd and logs through a local control API
  • 3510764 horizon-server: backups, restore and automatic backups
  • ed6af00 horizon-server: install scripts, a Docker image, and boot services
  • 07f7e3a Merge remote-tracking branch 'origin/main' into srv-fix
  • 2483f90 Merge feat/horizon-server into feat/horizon-server-control
  • 500241c Merge feat/horizon-server-control into feat/horizon-server-backups
  • 9497516 Merge feat/horizon-server-backups into feat/horizon-server-packaging

📊 Changes

32 files changed (+4082 additions, -17 deletions)

View changed files

📝 .github/workflows/release.yml (+5 -4)
📝 Cargo.lock (+27 -0)
📝 Cargo.toml (+1 -1)
📝 crates/horizon-client/Cargo.toml (+2 -0)
📝 crates/horizon-client/src/game/dedicated.rs (+30 -0)
➕ crates/horizon-client/src/game/dedicated/status.rs (+100 -0)
📝 crates/horizon-client/src/lib.rs (+1 -1)
➕ crates/horizon-server-files/Cargo.toml (+16 -0)
📝 crates/horizon-server-files/src/eula.rs (+6 -1)
📝 crates/horizon-server-files/src/java_properties.rs (+0 -0)
📝 crates/horizon-server-files/src/json.rs (+0 -0)
📝 crates/horizon-server-files/src/lib.rs (+3 -3)
📝 crates/horizon-server-files/src/properties.rs (+0 -0)
📝 crates/horizon-server-files/src/user_lists.rs (+0 -0)
➕ crates/horizon-server/Cargo.toml (+29 -0)
➕ crates/horizon-server/src/api.rs (+453 -0)
➕ crates/horizon-server/src/backup.rs (+332 -0)
➕ crates/horizon-server/src/cli.rs (+415 -0)
➕ crates/horizon-server/src/config.rs (+544 -0)
➕ crates/horizon-server/src/engine.rs (+182 -0)

...and 12 more files

📄 Description

PR 3 of docs/server.md (section 11), stacked on #553: install with one command, run in Docker, start at boot.

What it does

  • packaging/server/install.sh (Linux x86_64, macOS arm64) and install.ps1 (Windows x64) install the latest release (or --version/-Version).
    • Each checks the download against the SHA-256 GitHub publishes for the asset, and never asks for sudo or admin rights.
    • Releases sit side by side in <dir>/releases/<tag>, and <dir>/current points at the one in use, so an update or a rollback is one link.
    • The game files prepared from the owner's Minecraft live in <dir>/game-files and survive updates.
    • horizon-server and horizon-prepare launchers go in ~/.local/bin (Windows: %LOCALAPPDATA%\Horizon\bin, added to the user PATH).
  • packaging/server/Dockerfile builds the server and the engine from source, the same way as the relay's image.
    • It runs as horizon on debian:bookworm-slim, with /data as a volume.
    • The owner's prepared game files are mounted read-only.
    • On the first start, HORIZON_EULA=true and HORIZON_WORLD, HORIZON_SEED, HORIZON_PORT, HORIZON_WHITELIST, HORIZON_PLAYERS and HORIZON_OP answer init's questions (init reads them anywhere; flags win). Without the EULA answer it exits and says why.
    • docker stop saves cleanly. Nothing is published: an image on a registry needs Ludovic's OK.
  • horizon-server service install|uninstall|print [--system]: a systemd unit (user, or system with --system), a launchd agent, or a Windows task at logon. It runs the installer's launcher, so an update applies at the next restart.
  • Releases build horizon-server, check that it starts and links only system libraries, and ship it beside horizon-ctl and horizon-prepare. PLAY.txt gains a "Running a server" section.

Tested

  • install.sh: against the real latest release, it verified the digest, then stopped because that release has no horizon-server yet. Against a local release made by xtask package, with GitHub's JSON shape served from file://, it installed, then updated to a second tag (current moved, the game files stayed), and refused a wrong digest. The installed copy found its engine and game files through current.
  • launchd (Mac mini): service install started the server (running, pid shown by launchctl print), and service uninstall stopped and removed it.
  • systemd (Linux, the ThinkPad): horizon-server built, passed clippy and its tests, and links only libc, libm and libgcc_s. With a stub engine, service install started the unit, systemctl --user stop (SIGTERM) stopped it cleanly, and uninstall left nothing behind.
  • Container start line: tested locally. init --yes without HORIZON_EULA exits 1 with the reason; with the variables it writes the right server.toml, ops and whitelist.
  • Not tested: docker build (no Docker daemon on the Mac mini or the ThinkPad, and the desktop was off) and install.ps1 (no Windows machine). Both follow tested paths line for line, but they need a run before they are advertised.

Checks

  • cargo fmt --all --check: clean.
  • cargo clippy --workspace --all-targets -- -D warnings: clean on every branch of the stack.
  • Tests: cargo test -p horizon-server -p horizon-server-files pass on every branch (16 server tests in 2a, 24 at the tip). horizon-server also passes clippy and its tests on Linux (the ThinkPad).
  • Parity at the stack's tip (2a–3), rebased on b4ad6538:
    • tools/parity.py dedicated_server online_mode server_files server_player_combat server_player_damage: 5 passed, 0 failed. dedicated_server includes vanilla's protocol client joining Horizon's server.
    • The full --changed origin/main set (309 harnesses, because the client crate changes) had 60 passed, 0 failed when it was stopped. The Mac mini was running out of disk, and at about 1 harness a minute the run needed 4 more hours. CI's parity covers the rest.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/554 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/horizon-server-packaging` --- ### 📝 Commits (8) - [`9d21209`](https://github.com/horizon-rust/horizon/commit/9d21209ae8c4e6f788955abab69e7b96d1ef3237) horizon-server: server.toml, init, and a supervisor that runs the game - [`e883219`](https://github.com/horizon-rust/horizon/commit/e8832190d1017de6d23eb66c0b8dc75ca35cc95f) horizon-server: start, stop, status, cmd and logs through a local control API - [`3510764`](https://github.com/horizon-rust/horizon/commit/3510764cc645989ca3cd993310cbcaa1787e7e94) horizon-server: backups, restore and automatic backups - [`ed6af00`](https://github.com/horizon-rust/horizon/commit/ed6af00ff8c5482bbd7fe6f53dfeade354f1b651) horizon-server: install scripts, a Docker image, and boot services - [`07f7e3a`](https://github.com/horizon-rust/horizon/commit/07f7e3aeab80a1d3d3c76ef5b643eaaf1fa48fde) Merge remote-tracking branch 'origin/main' into srv-fix - [`2483f90`](https://github.com/horizon-rust/horizon/commit/2483f90779fa37882f4a3ceb3073fb9947e5e22b) Merge feat/horizon-server into feat/horizon-server-control - [`500241c`](https://github.com/horizon-rust/horizon/commit/500241cbc6563fdf0ff27cf4dbd36e57fccd9f71) Merge feat/horizon-server-control into feat/horizon-server-backups - [`9497516`](https://github.com/horizon-rust/horizon/commit/949751656a3cac04371b56fc3a1cd4b49796e9cf) Merge feat/horizon-server-backups into feat/horizon-server-packaging ### 📊 Changes **32 files changed** (+4082 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yml` (+5 -4) 📝 `Cargo.lock` (+27 -0) 📝 `Cargo.toml` (+1 -1) 📝 `crates/horizon-client/Cargo.toml` (+2 -0) 📝 `crates/horizon-client/src/game/dedicated.rs` (+30 -0) ➕ `crates/horizon-client/src/game/dedicated/status.rs` (+100 -0) 📝 `crates/horizon-client/src/lib.rs` (+1 -1) ➕ `crates/horizon-server-files/Cargo.toml` (+16 -0) 📝 `crates/horizon-server-files/src/eula.rs` (+6 -1) 📝 `crates/horizon-server-files/src/java_properties.rs` (+0 -0) 📝 `crates/horizon-server-files/src/json.rs` (+0 -0) 📝 `crates/horizon-server-files/src/lib.rs` (+3 -3) 📝 `crates/horizon-server-files/src/properties.rs` (+0 -0) 📝 `crates/horizon-server-files/src/user_lists.rs` (+0 -0) ➕ `crates/horizon-server/Cargo.toml` (+29 -0) ➕ `crates/horizon-server/src/api.rs` (+453 -0) ➕ `crates/horizon-server/src/backup.rs` (+332 -0) ➕ `crates/horizon-server/src/cli.rs` (+415 -0) ➕ `crates/horizon-server/src/config.rs` (+544 -0) ➕ `crates/horizon-server/src/engine.rs` (+182 -0) _...and 12 more files_ </details> ### 📄 Description PR 3 of [docs/server.md](https://github.com/ludovic111/horizon/pull/557) (section 11), stacked on #553: install with one command, run in Docker, start at boot. ## What it does - **`packaging/server/install.sh`** (Linux x86_64, macOS arm64) and **`install.ps1`** (Windows x64) install the latest release (or `--version`/`-Version`). - Each checks the download against the SHA-256 GitHub publishes for the asset, and never asks for sudo or admin rights. - Releases sit side by side in `<dir>/releases/<tag>`, and `<dir>/current` points at the one in use, so an update or a rollback is one link. - The game files prepared from the owner's Minecraft live in `<dir>/game-files` and survive updates. - `horizon-server` and `horizon-prepare` launchers go in `~/.local/bin` (Windows: `%LOCALAPPDATA%\Horizon\bin`, added to the user PATH). - **`packaging/server/Dockerfile`** builds the server and the engine from source, the same way as the relay's image. - It runs as `horizon` on `debian:bookworm-slim`, with `/data` as a volume. - The owner's prepared game files are mounted read-only. - On the first start, `HORIZON_EULA=true` and `HORIZON_WORLD`, `HORIZON_SEED`, `HORIZON_PORT`, `HORIZON_WHITELIST`, `HORIZON_PLAYERS` and `HORIZON_OP` answer `init`'s questions (`init` reads them anywhere; flags win). Without the EULA answer it exits and says why. - `docker stop` saves cleanly. Nothing is published: an image on a registry needs Ludovic's OK. - **`horizon-server service install|uninstall|print [--system]`**: a systemd unit (user, or system with `--system`), a launchd agent, or a Windows task at logon. It runs the installer's launcher, so an update applies at the next restart. - **Releases** build `horizon-server`, check that it starts and links only system libraries, and ship it beside `horizon-ctl` and `horizon-prepare`. PLAY.txt gains a "Running a server" section. ## Tested - **install.sh**: against the real latest release, it verified the digest, then stopped because that release has no `horizon-server` yet. Against a local release made by `xtask package`, with GitHub's JSON shape served from `file://`, it installed, then updated to a second tag (`current` moved, the game files stayed), and refused a wrong digest. The installed copy found its engine and game files through `current`. - **launchd** (Mac mini): `service install` started the server (running, pid shown by `launchctl print`), and `service uninstall` stopped and removed it. - **systemd** (Linux, the ThinkPad): horizon-server built, passed clippy and its tests, and links only libc, libm and libgcc_s. With a stub engine, `service install` started the unit, `systemctl --user stop` (SIGTERM) stopped it cleanly, and `uninstall` left nothing behind. - **Container start line**: tested locally. `init --yes` without `HORIZON_EULA` exits 1 with the reason; with the variables it writes the right `server.toml`, ops and whitelist. - **Not tested**: `docker build` (no Docker daemon on the Mac mini or the ThinkPad, and the desktop was off) and `install.ps1` (no Windows machine). Both follow tested paths line for line, but they need a run before they are advertised. ## Checks - `cargo fmt --all --check`: clean. - `cargo clippy --workspace --all-targets -- -D warnings`: clean on every branch of the stack. - Tests: `cargo test -p horizon-server -p horizon-server-files` pass on every branch (16 server tests in 2a, 24 at the tip). horizon-server also passes clippy and its tests on Linux (the ThinkPad). - Parity at the stack's tip (2a–3), rebased on b4ad6538: - `tools/parity.py dedicated_server online_mode server_files server_player_combat server_player_damage`: **5 passed, 0 failed**. `dedicated_server` includes vanilla's protocol client joining Horizon's server. - The full `--changed origin/main` set (309 harnesses, because the client crate changes) had **60 passed, 0 failed** when it was stopped. The Mac mini was running out of disk, and at about 1 harness a minute the run needed 4 more hours. CI's parity covers the rest. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:57:50 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2639
No description provided.