[PR #1141] [MERGED] Mod browser (1/3): Modrinth and CurseForge sources, checksum-checked downloads #3087

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

📋 Pull Request Information

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

Base: main ← Head: feat/mod-browser-sources


📝 Commits (1)

  • 784e8f0 Mod browser (1/3): Modrinth and CurseForge sources, checksum-checked downloads

📊 Changes

11 files changed (+1310 additions, -1 deletions)

View changed files

📝 .github/workflows/launcher.yml (+3 -0)
➕ docs/mod-browser.md (+55 -0)
📝 docs/mods.md (+2 -1)
📝 launcher/Cargo.lock (+1 -0)
📝 launcher/Cargo.toml (+2 -0)
➕ launcher/src/browser.rs (+296 -0)
➕ launcher/src/browser/curseforge.rs (+237 -0)
➕ launcher/src/browser/download.rs (+144 -0)
➕ launcher/src/browser/modrinth.rs (+214 -0)
➕ launcher/src/browser/tests.rs (+355 -0)
📝 launcher/src/lib.rs (+1 -0)

📄 Description

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

Part 1 of 3 for #577 (FEATURES item 16, the launcher's mod browser): the sources, the compatibility rules and the checked download. No UI yet; part 2 adds the Mods page, part 3 install, update and remove.

Online5277 asked for the browser (#577) to show where every file comes from and its checksum. This PR builds that in: a file reaches the game folder only after its checksum matches.

What

  • launcher/src/browser.rs: Kind (resource packs, shader packs, modpacks), Support (Works / Partly / Doesn't run, with the reason), Project, Version, FileRef, the Source trait, sources(), support(), pick() (the newest version that runs) and safe_name().
  • Only what Horizon loads is offered. Java mod jars never appear: they don't run in Horizon (docs/mods.md). Resource packs are Works when made for 26.3 and Partly when made for older versions (they load with vanilla's warning). Iris/OptiFine shader packs are Partly (only their full-screen passes draw so far). Other shader loaders are Doesn't run and can't be installed. Modpacks are Partly: they go through the Modpacks page's port.
  • browser/modrinth.rs: Modrinth's public API (no key). Searches filter server-side on what runs (versions:26.3, categories:iris|optifine). "Show everything" drops those filters.
  • browser/curseforge.rs: a pluggable CurseForge source that stays off until a key exists. It reads HORIZON_CURSEFORGE_API_KEY at run time, else the same variable at build time (option_env!). launcher.yml passes the repository secret of that name. It skips files whose author forbids third-party downloads.
  • browser/download.rs: files may come only from cdn.modrinth.com, edge.forgecdn.net or mediafilez.forgecdn.net over https, under one plain file name. A file whose source lists no checksum is refused. Each file is hashed while it downloads into .<name>.part, and that file is renamed into place only if the size and the SHA-512 (SHA-1 on CurseForge, the strongest hash it publishes) match. Otherwise it is deleted.
  • docs/mod-browser.md: what is offered and why, the checks, and how to turn CurseForge on.

Needs Ludovic

The CurseForge key. Get one at https://console.curseforge.com/ and store it in the Agents vault as CurseForge API / credential. Then set the repository secret: ~/fleet/op read "op://Agents/CurseForge API/credential" | gh secret set HORIZON_CURSEFORGE_API_KEY. Without the key the browser searches Modrinth only.

Self-check (Mac mini)

cd launcher
cargo fmt --check                                                     ok
set -o pipefail; cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings   ok (no warnings)
cargo test --lib --features gpui/runtime_shaders                      91 passed, 2 ignored
cargo test --lib --features gpui/runtime_shaders browser::tests::live -- --ignored
  live_modrinth_search_pick_and_download ... ok   (real search of all 3 kinds, Fresh Animations 26.3 version picked, downloaded, SHA-512 checked)
python3 tools/parity.py --list --changed origin/main                  0 of 326 harnesses (launcher only)

Tests cover: support per kind, version picking (snapshots, blocked or empty versions, everything on/off), file-name rules, Modrinth and CurseForge URLs and answer parsing, the CurseForge key staying off when it's empty, a matching download kept, and a wrong, short or long download refused with nothing left behind.

No third-party files are committed.

Part of #577.

🤖 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/1141 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/mod-browser-sources` --- ### 📝 Commits (1) - [`784e8f0`](https://github.com/horizon-rust/horizon/commit/784e8f0648968de2221517da2c7b20f3c41554a0) Mod browser (1/3): Modrinth and CurseForge sources, checksum-checked downloads ### 📊 Changes **11 files changed** (+1310 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/launcher.yml` (+3 -0) ➕ `docs/mod-browser.md` (+55 -0) 📝 `docs/mods.md` (+2 -1) 📝 `launcher/Cargo.lock` (+1 -0) 📝 `launcher/Cargo.toml` (+2 -0) ➕ `launcher/src/browser.rs` (+296 -0) ➕ `launcher/src/browser/curseforge.rs` (+237 -0) ➕ `launcher/src/browser/download.rs` (+144 -0) ➕ `launcher/src/browser/modrinth.rs` (+214 -0) ➕ `launcher/src/browser/tests.rs` (+355 -0) 📝 `launcher/src/lib.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part 1 of 3 for #577 (FEATURES item 16, the launcher's mod browser): the sources, the compatibility rules and the checked download. No UI yet; part 2 adds the Mods page, part 3 install, update and remove. Online5277 asked for the browser (#577) to show where every file comes from and its checksum. This PR builds that in: a file reaches the game folder only after its checksum matches. ## What - `launcher/src/browser.rs`: `Kind` (resource packs, shader packs, modpacks), `Support` (Works / Partly / Doesn't run, with the reason), `Project`, `Version`, `FileRef`, the `Source` trait, `sources()`, `support()`, `pick()` (the newest version that runs) and `safe_name()`. - **Only what Horizon loads is offered.** Java mod jars never appear: they don't run in Horizon (docs/mods.md). Resource packs are **Works** when made for 26.3 and **Partly** when made for older versions (they load with vanilla's warning). Iris/OptiFine shader packs are **Partly** (only their full-screen passes draw so far). Other shader loaders are **Doesn't run** and can't be installed. Modpacks are **Partly**: they go through the Modpacks page's port. - `browser/modrinth.rs`: Modrinth's public API (no key). Searches filter server-side on what runs (`versions:26.3`, `categories:iris|optifine`). "Show everything" drops those filters. - `browser/curseforge.rs`: **a pluggable CurseForge source that stays off until a key exists**. It reads `HORIZON_CURSEFORGE_API_KEY` at run time, else the same variable at build time (`option_env!`). `launcher.yml` passes the repository secret of that name. It skips files whose author forbids third-party downloads. - `browser/download.rs`: files may come only from `cdn.modrinth.com`, `edge.forgecdn.net` or `mediafilez.forgecdn.net` over https, under one plain file name. A file whose source lists no checksum is refused. Each file is hashed while it downloads into `.<name>.part`, and that file is renamed into place only if the size and the SHA-512 (SHA-1 on CurseForge, the strongest hash it publishes) match. Otherwise it is deleted. - `docs/mod-browser.md`: what is offered and why, the checks, and how to turn CurseForge on. ## Needs Ludovic The CurseForge key. Get one at https://console.curseforge.com/ and store it in the Agents vault as `CurseForge API` / `credential`. Then set the repository secret: `~/fleet/op read "op://Agents/CurseForge API/credential" | gh secret set HORIZON_CURSEFORGE_API_KEY`. Without the key the browser searches Modrinth only. ## Self-check (Mac mini) ``` cd launcher cargo fmt --check ok set -o pipefail; cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings ok (no warnings) cargo test --lib --features gpui/runtime_shaders 91 passed, 2 ignored cargo test --lib --features gpui/runtime_shaders browser::tests::live -- --ignored live_modrinth_search_pick_and_download ... ok (real search of all 3 kinds, Fresh Animations 26.3 version picked, downloaded, SHA-512 checked) python3 tools/parity.py --list --changed origin/main 0 of 326 harnesses (launcher only) ``` Tests cover: support per kind, version picking (snapshots, blocked or empty versions, everything on/off), file-name rules, Modrinth and CurseForge URLs and answer parsing, the CurseForge key staying off when it's empty, a matching download kept, and a wrong, short or long download refused with nothing left behind. No third-party files are committed. Part of #577. 🤖 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:01:25 +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#3087
No description provided.