[PR #1017] [MERGED] Launcher: servers hosted through horizon-server (backend and CLI) #2990

Closed
opened 2026-11-02 16:00:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/launcher-servers-backend


📝 Commits (1)

  • 627837e Launcher: servers hosted through horizon-server (backend and CLI)

📊 Changes

6 files changed (+1352 additions, -1 deletions)

View changed files

📝 launcher/README.md (+6 -0)
📝 launcher/src/backend.rs (+2 -1)
📝 launcher/src/cli.rs (+164 -0)
📝 launcher/src/lib.rs (+1 -0)
➕ launcher/src/servers.rs (+954 -0)
➕ launcher/src/servers/tests.rs (+225 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

The launcher's side of hosting a server, without a UI yet: everything the Servers page (next PR) calls, as a library (launcher/src/servers.rs) and as horizon-launcher servers .... It drives horizon-server and its control API; it keeps no copy of the server's rules.

  • Servers list: servers.json in the launcher's data folder (name and folder); new servers go to servers/<name>/.
  • Programs and game files (server-runtime/): a prepared Horizon version's programs are copied into releases/<tag>, laid out as install.sh does, with current pointing at them. The prepared game files go to game-files/ and are linked as the release's .local/horizon-client. So horizon-server update, service and the resource lookup work unchanged. The game files are swapped in whole when they change.
  • Create: a new world (optional seed) or a copy of one of the player's single-player worlds; game mode, difficulty, max players; friends only (whitelist, the default) or open; account checks (off by default: Horizon's client can't sign in to Microsoft yet); the EULA. It runs horizon-server init then config set (#1009), picks a free game port and a free panel port per server, registers it, and removes the folder if anything fails.
  • Plain-language problems: Problem { message, fix } reads what horizon-server and the new part of logs/supervisor.log said. It recognises a port in use (fix: the next free port), missing game files (fix: prepare them) and the EULA; otherwise it gives the last horizon-server: line as a sentence.
  • Control API client: status, logs?since=, command, stop, panel/login, with the token from .horizon/api.json. Also lists (whitelist.json, ops.json, banned), backups (backups --json), the LAN address (no packet is sent), and whether the server runs as a service.
  • CLI: horizon-launcher servers [list] | create ... | set-up | run <server> -- <horizon-server command> | forget (README).

Why

Brief launcher-server-1 (Ludovic's request): a Servers page in the launcher that drives horizon-server, so hosting needs no terminal and no docs.

How tested

  • Unit tests: folder names, the exact init / config set arguments, the install.sh layout (including a game-files swap), problems (busy port with a free one offered, missing game files, missing registries, a plain error), lists and status parsing, and the control API against a stand-in HTTP server that checks the token.
  • End to end on the Mac mini through horizon-launcher servers (the same functions the page uses), with #1009's horizon-server. The full flow is in the Servers page PR:
    $ horizon-launcher servers create --name Proof --seed 4242 --player Host --accept-eula
    Created Proof in ~/scratch-ls1/lh/servers/proof          (port 25567: 25565 and 25566 were taken)
    $ horizon-launcher servers run Proof -- start
    The server is running (pid 82043).
    

Self-check (this branch):

  • cargo fmt -- --check (launcher): clean.
  • cargo clippy --features gpui/runtime_shaders --all-targets -- -D warnings: clean.
  • cargo test --features gpui/runtime_shaders: 68 + 6 + 1 passed.
  • tools/parity.py --changed origin/main: 0 harnesses depend on these files.

Merge order: #1009 (horizon-server config), then this, then the Servers page PR.

Nothing needs Ludovic.

🤖 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/1017 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-servers-backend` --- ### 📝 Commits (1) - [`627837e`](https://github.com/horizon-rust/horizon/commit/627837e8c3870506e951bfbb360d6aa20a5bc75f) Launcher: servers hosted through horizon-server (backend and CLI) ### 📊 Changes **6 files changed** (+1352 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `launcher/README.md` (+6 -0) 📝 `launcher/src/backend.rs` (+2 -1) 📝 `launcher/src/cli.rs` (+164 -0) 📝 `launcher/src/lib.rs` (+1 -0) ➕ `launcher/src/servers.rs` (+954 -0) ➕ `launcher/src/servers/tests.rs` (+225 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What The launcher's side of hosting a server, without a UI yet: everything the Servers page (next PR) calls, as a library (`launcher/src/servers.rs`) and as `horizon-launcher servers ...`. It drives `horizon-server` and its control API; it keeps no copy of the server's rules. - **Servers list**: `servers.json` in the launcher's data folder (name and folder); new servers go to `servers/<name>/`. - **Programs and game files** (`server-runtime/`): a prepared Horizon version's programs are copied into `releases/<tag>`, laid out as `install.sh` does, with `current` pointing at them. The prepared game files go to `game-files/` and are linked as the release's `.local/horizon-client`. So `horizon-server update`, `service` and the resource lookup work unchanged. The game files are swapped in whole when they change. - **Create**: a new world (optional seed) or a copy of one of the player's single-player worlds; game mode, difficulty, max players; friends only (whitelist, the default) or open; account checks (off by default: Horizon's client can't sign in to Microsoft yet); the EULA. It runs `horizon-server init` then `config set` (#1009), picks a free game port and a free panel port per server, registers it, and removes the folder if anything fails. - **Plain-language problems**: `Problem { message, fix }` reads what `horizon-server` and the new part of `logs/supervisor.log` said. It recognises a port in use (fix: the next free port), missing game files (fix: prepare them) and the EULA; otherwise it gives the last `horizon-server:` line as a sentence. - **Control API client**: `status`, `logs?since=`, `command`, `stop`, `panel/login`, with the token from `.horizon/api.json`. Also lists (`whitelist.json`, `ops.json`, banned), backups (`backups --json`), the LAN address (no packet is sent), and whether the server runs as a service. - **CLI**: `horizon-launcher servers [list] | create ... | set-up | run <server> -- <horizon-server command> | forget` (README). ## Why Brief launcher-server-1 (Ludovic's request): a Servers page in the launcher that drives `horizon-server`, so hosting needs no terminal and no docs. ## How tested - Unit tests: folder names, the exact `init` / `config set` arguments, the install.sh layout (including a game-files swap), problems (busy port with a free one offered, missing game files, missing registries, a plain error), lists and status parsing, and the control API against a stand-in HTTP server that checks the token. - End to end on the Mac mini through `horizon-launcher servers` (the same functions the page uses), with #1009's `horizon-server`. The full flow is in the Servers page PR: ``` $ horizon-launcher servers create --name Proof --seed 4242 --player Host --accept-eula Created Proof in ~/scratch-ls1/lh/servers/proof (port 25567: 25565 and 25566 were taken) $ horizon-launcher servers run Proof -- start The server is running (pid 82043). ``` Self-check (this branch): - `cargo fmt -- --check` (launcher): clean. - `cargo clippy --features gpui/runtime_shaders --all-targets -- -D warnings`: clean. - `cargo test --features gpui/runtime_shaders`: 68 + 6 + 1 passed. - `tools/parity.py --changed origin/main`: 0 harnesses depend on these files. Merge order: #1009 (horizon-server `config`), then this, then the Servers page PR. Nothing needs Ludovic. 🤖 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 16:00:39 +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#2990
No description provided.