fix: migrate PaperMC to v3 API, fix NeoForge beta fallback, add test suite

- Migrate Paper loader from sunset v2 API to v3 (fill.papermc.io)
- Fix NeoForge: fall back to beta versions when no stable exists (set -e + grep)
- Fix setEula/setperms ordering (was writing eula.txt before /data was writable)
- Fix setEula/serverInfoWrite to use absolute paths (/data/server/)
- Add VOLUME directive removal (was shadowing bind mounts)
- Add comprehensive API test suite (110 tests across 6 suites)
- Move test.sh to tests/integration.sh, switch to named volumes
- Add Docker build cache to CI workflows
- Add .editorconfig, expand .gitignore, improve README docs
This commit is contained in:
2026-08-21 12:49:27 -04:00
parent a6f610de28
commit 5688b30892
26 changed files with 2530 additions and 263 deletions
+25 -14
View File
@@ -1,22 +1,33 @@
getFabric() {
SERVER_TYPE="Fabric Minecraft"
LATEST_BUILD=$(curl -s https://meta.fabricmc.net/v2/versions/loader/${MC_VERSION} | jq -r '.[0].loader.version')
LATEST_INSTALLER=$(curl -s https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml | xmllint --xpath "/metadata/versioning/latest/text()" -)
if [[ -z "$MC_VERSION" ]]; then
echo "Minecraft version not set"
exit 1
if [[ -z "${MC_VERSION}" ]]; then
die "MC_VERSION is required for Fabric loader"
fi
VER=$MC_VERSION
log "Fetching Fabric loader version for MC ${MC_VERSION}..."
local LATEST_BUILD LATEST_INSTALLER
LATEST_BUILD=$(curl -sf --connect-timeout 10 --max-time 30 \
"https://meta.fabricmc.net/v2/versions/loader/${MC_VERSION}" |
jq -r '.[0].loader.version')
LATEST_INSTALLER=$(curl -sf --connect-timeout 10 --max-time 30 \
"https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml" |
xmllint --xpath "/metadata/versioning/latest/text()" -)
if [[ -z "$LATEST_BUILD" || "$LATEST_BUILD" == "null" ]]; then
die "No Fabric loader found for MC ${MC_VERSION}"
fi
if [[ -z "$LATEST_INSTALLER" ]]; then
die "Could not determine latest Fabric installer version"
fi
local VER_LOADER
VER_LOADER="${FABRIC_LOADER_VERSION:-${LATEST_BUILD}}"
DL_URL=https://meta.fabricmc.net/v2/versions/loader/${MC_VERSION}/${VER_LOADER}/${LATEST_INSTALLER}/server/jar
local DL_URL
DL_URL="https://meta.fabricmc.net/v2/versions/loader/${MC_VERSION}/${VER_LOADER}/${LATEST_INSTALLER}/server/jar"
if [ "$LATEST_BUILD" != "null" ]; then
echo "$DL_URL"
curl -o server.jar "${DL_URL}"
else
echo "No valid Fabric build found for version ${MC_VERSION}"
crash
fi
log "Downloading Fabric (loader ${VER_LOADER}, installer ${LATEST_INSTALLER})..."
curl -fL -o server.jar "${DL_URL}"
log "Fabric ${MC_VERSION} (loader ${VER_LOADER}) downloaded."
}