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
+38 -24
View File
@@ -1,34 +1,48 @@
crash() {
sleep 5
echo "Exit Complete"
# ---------- helpers --------------------------------------------------------
log() {
echo -e "[dockercraft] $*"
}
warn() {
echo -e "[dockercraft] WARNING: $*" >&2
}
die() {
echo -e "[dockercraft] ERROR: $*" >&2
sleep 2
exit 1
}
setperms() {
echo -e "|_______________________________________________________|"
echo -e "|##--------------- Setting Permissions ---------------##|"
echo -e "|#| Setting permissions to UID:${PUID} and GID:${PGID}"
sudo usermod -u ${PUID} minecraft
sudo groupmod -g ${PGID} minecraft
sudo chown -R ${PUID}:${PGID} /data
echo -e "|#|---------------------------------------------------|#|"
sleep 2
echo -e "|#| DONE"
echo -e "|##---------------------------------------------------##|"
sleep 2
crash() {
die "$@"
}
# ---------- permission setup -----------------------------------------------
setperms() {
log "--- Setting permissions to UID:${PUID} GID:${PGID} ---"
sudo usermod -u "${PUID}" minecraft
sudo groupmod -g "${PGID}" minecraft
sudo chown -R "${PUID}:${PGID}" /data
log "Permissions set."
}
# ---------- EULA -----------------------------------------------------------
setEula() {
if [[ "${EULA:-false}" != "true" ]]; then
echo "EULA not accepted. Set EULA=true to accept the Minecraft EULA (https://aka.ms/MinecraftEULA)"
crash
die "EULA not accepted. Set EULA=true to accept the Minecraft EULA (https://aka.ms/MinecraftEULA)"
fi
cat <<EOF > eula.txt
mkdir -p /data/server
cat <<'EOF' > /data/server/eula.txt
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms/MinecraftEULA).
eula=true
EOF
}
# ---------- misc -----------------------------------------------------------
newForge() {
if [[ "$(printf '%s\n' "1.17.1" "$MC_VERSION" | sort -V | head -n1)" = "1.17.1" ]]; then
NEW_FORGE=true
@@ -38,11 +52,11 @@ newForge() {
}
serverInfoWrite() {
cat <<EOF > server.info
MC_VERSION=$MC_VERSION
cat <<EOF > /data/server/server.info
MC_VERSION=${MC_VERSION}
MC_LOADER=$MC_LOADER
MC_LOADER_VERSION=$MC_LOADER_VERSION
MC_LOADER=${MC_LOADER}
MC_LOADER_VERSION=${MC_LOADER_VERSION}
JAVA_VERSION=${JAVA_VERSION:-"N/A"}
JAR=${JAR:-"N/A"}
@@ -51,7 +65,7 @@ XMS=${XMS:-"N/A"}
XMX=${XMX:-"N/A"}
ADD_ARGS=${ADD_ARGS:-"NONE"}
PUID=$PUID
PGID=$PGID
PUID=${PUID}
PGID=${PGID}
EOF
}