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
+18
-11
@@ -86,7 +86,11 @@ pub fn sibling_exe(java: &Path, windowed: bool) -> PathBuf {
|
||||
}
|
||||
let name = if windowed { "javaw.exe" } else { "java.exe" };
|
||||
let candidate = java.with_file_name(name);
|
||||
if candidate.exists() { candidate } else { java.to_path_buf() }
|
||||
if candidate.exists() {
|
||||
candidate
|
||||
} else {
|
||||
java.to_path_buf()
|
||||
}
|
||||
}
|
||||
|
||||
/// Make sure the Mojang runtime `component` (e.g. `java-runtime-delta`) is
|
||||
@@ -102,15 +106,14 @@ pub async fn ensure_runtime(
|
||||
let marker = dir.join(".scopenet-runtime");
|
||||
let installed = std::fs::read_to_string(&marker).ok();
|
||||
|
||||
let index: HashMap<String, HashMap<String, Vec<RuntimeEntry>>> =
|
||||
match http::get_json(client, RUNTIME_INDEX).await {
|
||||
Ok(i) => i,
|
||||
Err(e) if installed.is_some() && java_exe(&dir, false).exists() => {
|
||||
tracing::warn!("java index unreachable ({e}); using installed {component}");
|
||||
return Ok(dir);
|
||||
}
|
||||
Err(e) => return Err(e).context("fetching Java runtime index"),
|
||||
};
|
||||
let index: HashMap<String, HashMap<String, Vec<RuntimeEntry>>> = match http::get_json(client, RUNTIME_INDEX).await {
|
||||
Ok(i) => i,
|
||||
Err(e) if installed.is_some() && java_exe(&dir, false).exists() => {
|
||||
tracing::warn!("java index unreachable ({e}); using installed {component}");
|
||||
return Ok(dir);
|
||||
}
|
||||
Err(e) => return Err(e).context("fetching Java runtime index"),
|
||||
};
|
||||
let entry = index
|
||||
.get(platform_key())
|
||||
.and_then(|p| p.get(component))
|
||||
@@ -188,7 +191,11 @@ pub fn parse_java_version(text: &str) -> Option<u32> {
|
||||
let ver = &rest[..rest.find('"')?];
|
||||
let mut parts = ver.split(['.', '_', '-', '+']);
|
||||
let first: u32 = parts.next()?.parse().ok()?;
|
||||
if first == 1 { parts.next()?.parse().ok() } else { Some(first) }
|
||||
if first == 1 {
|
||||
parts.next()?.parse().ok()
|
||||
} else {
|
||||
Some(first)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in new issue
Block a user