Add Docker image, Compose, CI/CD workflows and docs
- Multi-arch (amd64/arm64) panel image: static musl binary on scratch, cross-compiled with cargo-zigbuild (no QEMU), non-root, healthcheck - docker-compose.yml + .env.example for one-command deployment - CI: fmt, clippy, tests, web type-checks, Windows launcher build, real-network installs of vanilla/Fabric/Quilt/Forge/NeoForge, Docker build - Release: Windows NSIS installer with baked-in panel URL, GHCR image push and GitHub release (tag push or manual dispatch) - README, admin guide, Microsoft auth setup, architecture, development - rustfmt config and formatting pass Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ARcGWxLx21FwXJ3yfGriS
This commit is contained in:
54 files changed
+1019
-219
No files matched your search
@@ -20,11 +20,7 @@ pub struct McVersion {
|
||||
|
||||
pub async fn minecraft(_: AdminUser, State(state): State<AppState>) -> AppResult<Json<serde_json::Value>> {
|
||||
let m = meta::mojang_manifest(&state.http).await?;
|
||||
let versions: Vec<McVersion> = m
|
||||
.versions
|
||||
.into_iter()
|
||||
.map(|v| McVersion { id: v.id, kind: v.kind, released: v.release_time })
|
||||
.collect();
|
||||
let versions: Vec<McVersion> = m.versions.into_iter().map(|v| McVersion { id: v.id, kind: v.kind, released: v.release_time }).collect();
|
||||
Ok(Json(serde_json::json!({ "latest": m.latest, "versions": versions })))
|
||||
}
|
||||
|
||||
@@ -33,7 +29,12 @@ pub struct LoaderQuery {
|
||||
mc: String,
|
||||
}
|
||||
|
||||
pub async fn loaders(_: AdminUser, State(state): State<AppState>, Path(loader): Path<String>, Query(q): Query<LoaderQuery>) -> AppResult<Json<Vec<LoaderVersion>>> {
|
||||
pub async fn loaders(
|
||||
_: AdminUser,
|
||||
State(state): State<AppState>,
|
||||
Path(loader): Path<String>,
|
||||
Query(q): Query<LoaderQuery>,
|
||||
) -> AppResult<Json<Vec<LoaderVersion>>> {
|
||||
let loader = Loader::parse(&loader).unwrap_or_default();
|
||||
Ok(Json(meta::loader_versions(&state.http, loader, &q.mc).await?))
|
||||
}
|
||||
@@ -44,7 +45,11 @@ pub struct SearchQuery {
|
||||
q: String,
|
||||
}
|
||||
|
||||
pub async fn modrinth_search(_: AdminUser, State(state): State<AppState>, Query(q): Query<SearchQuery>) -> AppResult<Json<serde_json::Value>> {
|
||||
pub async fn modrinth_search(
|
||||
_: AdminUser,
|
||||
State(state): State<AppState>,
|
||||
Query(q): Query<SearchQuery>,
|
||||
) -> AppResult<Json<serde_json::Value>> {
|
||||
let resp = state
|
||||
.http
|
||||
.get("https://api.modrinth.com/v2/search")
|
||||
@@ -57,16 +62,21 @@ pub async fn modrinth_search(_: AdminUser, State(state): State<AppState>, Query(
|
||||
Ok(Json(resp.json().await.map_err(anyhow::Error::from)?))
|
||||
}
|
||||
|
||||
pub async fn modrinth_versions(_: AdminUser, State(state): State<AppState>, Path(project): Path<String>) -> AppResult<Json<Vec<packs::MrVersion>>> {
|
||||
pub async fn modrinth_versions(
|
||||
_: AdminUser,
|
||||
State(state): State<AppState>,
|
||||
Path(project): Path<String>,
|
||||
) -> AppResult<Json<Vec<packs::MrVersion>>> {
|
||||
let url = format!("https://api.modrinth.com/v2/project/{}/version", urlencode(&project));
|
||||
Ok(Json(scopenet_core::http::get_json(&state.http, &url).await?))
|
||||
}
|
||||
|
||||
pub async fn curseforge_search(_: AdminUser, State(state): State<AppState>, Query(q): Query<SearchQuery>) -> AppResult<Json<serde_json::Value>> {
|
||||
let path = format!(
|
||||
"/mods/search?gameId=432&classId=4471&pageSize=24&sortField=2&sortOrder=desc&searchFilter={}",
|
||||
urlencode(&q.q)
|
||||
);
|
||||
pub async fn curseforge_search(
|
||||
_: AdminUser,
|
||||
State(state): State<AppState>,
|
||||
Query(q): Query<SearchQuery>,
|
||||
) -> AppResult<Json<serde_json::Value>> {
|
||||
let path = format!("/mods/search?gameId=432&classId=4471&pageSize=24&sortField=2&sortOrder=desc&searchFilter={}", urlencode(&q.q));
|
||||
Ok(Json(packs::cf_raw_get(&state, &path).await?))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user