[PR #1659] [MERGED] Mod registry: the submission form's service (crates/horizon-mod-registry) #3668

Closed
opened 2026-11-03 04:11:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/mod-registry-server


📝 Commits (2)

  • 7b56b59 Mod registry: the submission form's service (crates/horizon-mod-registry)
  • 0c5d229 Merge remote-tracking branch 'origin/main' into HEAD

📊 Changes

12 files changed (+2850 additions, -1 deletions)

View changed files

➕ .github/workflows/mod-registry.yml (+34 -0)
📝 Cargo.toml (+1 -1)
➕ crates/horizon-mod-registry/Cargo.lock (+1352 -0)
➕ crates/horizon-mod-registry/Cargo.toml (+33 -0)
➕ crates/horizon-mod-registry/Dockerfile (+14 -0)
➕ crates/horizon-mod-registry/README.md (+44 -0)
➕ crates/horizon-mod-registry/railway.json (+21 -0)
➕ crates/horizon-mod-registry/src/github.rs (+276 -0)
➕ crates/horizon-mod-registry/src/lib.rs (+675 -0)
➕ crates/horizon-mod-registry/src/main.rs (+25 -0)
➕ crates/horizon-mod-registry/tests/submit.rs (+373 -0)
📝 docs/api/mod-index.md (+2 -0)

📄 Description

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

Stacked on #1646 (the registry's entries and review), on #1642 (each kind's checks) and #1634 (the index); review those first.

What

crates/horizon-mod-registry: the service behind playhorizon.dev/mods/submit, its own workspace and Railway service like the telemetry server. Not deployed: Ludovic creates the OAuth app, the bot token and the service (listed in the agent's report and the crate's README).

  • Sign-in with GitHub, no scope: the user's token reads the login once and is dropped. Sessions are HMAC-signed cookies (HttpOnly, Secure, SameSite=Lax, 12 h); the service keeps no data.
  • A submission must come from the site's origin with the session's CSRF token; six per account and sixty in all per hour; the body is capped at 64 MiB plus the form.
  • It runs the file's own checks before anything reaches GitHub (index::inspect, the id and version against the form, then registry::project: signature, version and date formats, the kind open), then uploads the file to the registry's staging prerelease as <sha256>.<extension>, writes mods/<id>.toml on submit/<id>-<version> with the submitter as co-author, and opens the pull request (its body names the submitter for the registry's CI, and lists what the mod may do).
  • Only an entry's owners publish updates; a key change or an icon in the repository is a pull request by hand. Shader packs are refused until their format exists.
  • CI: .github/workflows/mod-registry.yml (fmt, clippy, tests) when it or horizon-mods changes. Dockerfile, railway.json.

Checked

  • cargo clippy --all-targets -- -D warnings clean and cargo test --locked in the crate: 3 pass, against a mock GitHub (an axum server playing OAuth, contents, refs, releases, uploads and pulls): sign-in with a forged state refused; the signed sample mod submitted, its asset, branch, entry (owners, hash, signature), commit trailer and pull request body checked; the same version again is a conflict and uploads nothing; a file that isn't what the form says, a broken signature, a shader pack, an update by a non-owner and a submission from another origin are refused with nothing reaching GitHub.
  • Run locally behind the website's Caddy for the submit page's screenshots (#1635).

pr_ready (tools/pr_ready.py --quick --base feat/mod-registry-tools on ludovics-mac-mini, against feat/mod-registry-tools at 7d76923a0, 23 min 30 s)

Check Result
Scope ⚠️ 12 files, +2850 −1; 2432 lines of code: over 500, split it if it can ship in parts; mixes CI, game
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (24 s)
clippy ✅ (59 s)
tests: workspace ✅ 1961 passed (18 min 3 s)
doc tests ✅ 1 passed (2 min 59 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 245 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, bamboo, basic_feature and 233 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Over 500 lines of code (pr_ready counts the 1352-line lockfile; about 1050 without it, 373 of them tests): a new service that isn't deployed until it is whole; sign-in, the checks and the GitHub calls each need the others to be tested end to end.

🤖 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/1659 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/mod-registry-server` --- ### 📝 Commits (2) - [`7b56b59`](https://github.com/horizon-rust/horizon/commit/7b56b59e7c08af912cba137148c958cb6da8ce2e) Mod registry: the submission form's service (crates/horizon-mod-registry) - [`0c5d229`](https://github.com/horizon-rust/horizon/commit/0c5d229ad0efb15084ffb67352d3021ec07e700c) Merge remote-tracking branch 'origin/main' into HEAD ### 📊 Changes **12 files changed** (+2850 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/mod-registry.yml` (+34 -0) 📝 `Cargo.toml` (+1 -1) ➕ `crates/horizon-mod-registry/Cargo.lock` (+1352 -0) ➕ `crates/horizon-mod-registry/Cargo.toml` (+33 -0) ➕ `crates/horizon-mod-registry/Dockerfile` (+14 -0) ➕ `crates/horizon-mod-registry/README.md` (+44 -0) ➕ `crates/horizon-mod-registry/railway.json` (+21 -0) ➕ `crates/horizon-mod-registry/src/github.rs` (+276 -0) ➕ `crates/horizon-mod-registry/src/lib.rs` (+675 -0) ➕ `crates/horizon-mod-registry/src/main.rs` (+25 -0) ➕ `crates/horizon-mod-registry/tests/submit.rs` (+373 -0) 📝 `docs/api/mod-index.md` (+2 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #1646 (the registry's entries and review), on #1642 (each kind's checks) and #1634 (the index); review those first. ## What `crates/horizon-mod-registry`: the service behind `playhorizon.dev/mods/submit`, its own workspace and Railway service like the telemetry server. Not deployed: Ludovic creates the OAuth app, the bot token and the service (listed in the agent's report and the crate's README). - Sign-in with GitHub, no scope: the user's token reads the login once and is dropped. Sessions are HMAC-signed cookies (HttpOnly, Secure, SameSite=Lax, 12 h); the service keeps no data. - A submission must come from the site's origin with the session's CSRF token; six per account and sixty in all per hour; the body is capped at 64 MiB plus the form. - It runs the file's own checks before anything reaches GitHub (`index::inspect`, the id and version against the form, then `registry::project`: signature, version and date formats, the kind open), then uploads the file to the registry's `staging` prerelease as `<sha256>.<extension>`, writes `mods/<id>.toml` on `submit/<id>-<version>` with the submitter as co-author, and opens the pull request (its body names the submitter for the registry's CI, and lists what the mod may do). - Only an entry's owners publish updates; a key change or an icon in the repository is a pull request by hand. Shader packs are refused until their format exists. - CI: `.github/workflows/mod-registry.yml` (fmt, clippy, tests) when it or `horizon-mods` changes. `Dockerfile`, `railway.json`. ## Checked - `cargo clippy --all-targets -- -D warnings` clean and `cargo test --locked` in the crate: 3 pass, against a mock GitHub (an axum server playing OAuth, contents, refs, releases, uploads and pulls): sign-in with a forged state refused; the signed sample mod submitted, its asset, branch, entry (owners, hash, signature), commit trailer and pull request body checked; the same version again is a conflict and uploads nothing; a file that isn't what the form says, a broken signature, a shader pack, an update by a non-owner and a submission from another origin are refused with nothing reaching GitHub. - Run locally behind the website's Caddy for the submit page's screenshots (#1635). **pr_ready** (`tools/pr_ready.py --quick --base feat/mod-registry-tools` on ludovics-mac-mini, against feat/mod-registry-tools at 7d76923a0, 23 min 30 s) | Check | Result | | --- | --- | | Scope | ⚠️ 12 files, +2850 −1; 2432 lines of code: over 500, split it if it can ship in parts; mixes CI, game | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (24 s) | | clippy | ✅ (59 s) | | tests: workspace | ✅ 1961 passed (18 min 3 s) | | doc tests | ✅ 1 passed (2 min 59 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 245 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, bamboo, basic_feature and 233 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Over 500 lines of code (pr_ready counts the 1352-line lockfile; about 1050 without it, 373 of them tests): a new service that isn't deployed until it is whole; sign-in, the checks and the GitHub calls each need the others to be tested end to end. 🤖 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-03 04:11:17 +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#3668
No description provided.