455817204f
The registry service keeps players' ratings of published projects in one
SQLite file on a volume (REGISTRY_DB, /data on Railway):
- GET /api/mods/ratings: every rated project's average and count, cached a
minute; never who rated.
- GET /api/mods/{id}/rating: the signed-in account's own rating.
- POST /api/mods/{id}/rating: sets or changes it, checked like a submission
(origin, session, CSRF token), 30 per account and 600 in all per hour, only
for projects on the registry's main, never by their owners.
- The sign-in takes ?back=/mods/<id> to come back to a project's page.
The image hands the volume to nobody before running as nobody.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.2 KiB
TOML
36 lines
1.2 KiB
TOML
[package]
|
|
name = "horizon-mod-registry"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
license = "MIT"
|
|
rust-version = "1.90"
|
|
publish = false
|
|
description = "The registry's submission service: GitHub sign-in, the file's checks, staging, and a pull request (docs/api/mod-index.md)"
|
|
|
|
# Its own workspace, as the telemetry server's: the game's workspace never builds a web server.
|
|
[workspace]
|
|
|
|
[dependencies]
|
|
horizon-mods = { path = "../horizon-mods", default-features = false, features = ["index"] }
|
|
axum = { version = "0.8", default-features = false, features = ["http1", "tokio", "json", "query", "multipart"] }
|
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "signal", "fs", "io-util"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
toml = "1"
|
|
# GitHub's API, blocking, on tokio's blocking pool: the launcher's HTTP client.
|
|
ureq = { version = "2", default-features = false, features = ["json", "tls"] }
|
|
hmac = "0.12"
|
|
sha2 = "0.10"
|
|
base64 = "0.22"
|
|
getrandom = "0.3"
|
|
# Ratings: one SQLite file on a small volume, as the telemetry server keeps its data.
|
|
rusqlite = { version = "0.37", features = ["bundled"] }
|
|
|
|
[dev-dependencies]
|
|
tower = { version = "0.5", features = ["util"] }
|
|
http-body-util = "0.1"
|
|
|
|
[profile.release]
|
|
strip = true
|
|
lto = "thin"
|