Files
jeremy 6e13a0aa15
Build dev image / build (push) Failing after 18m12s
refactor: modular init, add bedrock loader, dynamic java/healthcheck
- Split monolithic init into modular lib files under scripts/lib/
  (common.sh, java.sh, server.sh, loaders/{vanilla,paper,fabric,forge,neoforge}.sh)
- Add bedrock loader: downloads from Minecraft Services API,
  runs native binary with LD_LIBRARY_PATH, skips Java setup
- Add auto-detection for JAVA_VERSION from Mojang version manifest
  (MC 1.20.5+ -> temurin@21, 1.17-1.20.4 -> temurin@17,
   1.17 -> temurin@16, pre-1.17 -> temurin@8)
- Fix NEW_FORGE unbound variable when non-Forge loaders run
- Fix Fabric loader jq filter (-s slurp removed, null string check fixed)
- Fix Forge test detection (recursive find for forge-*-server.jar)
- Dynamic healthcheck: nc -z TCP 25565 for Java, nc -zu UDP 19132 for bedrock
- Add .gitea/workflows/build-dev.yml for dev branch CI builds
- Base image: debian:bookworm-slim (from ubuntu:noble)
- Add unzip, netcat-openbsd to Docker image
- Switch to shebangs, set -euo pipefail throughout
2026-06-17 18:41:26 -04:00

58 lines
1.3 KiB
Bash

crash() {
sleep 5
echo "Exit Complete"
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
}
setEula() {
if [[ "${EULA:-false}" != "true" ]]; then
echo "EULA not accepted. Set EULA=true to accept the Minecraft EULA (https://aka.ms/MinecraftEULA)"
crash
fi
cat <<EOF > eula.txt
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms/MinecraftEULA).
eula=true
EOF
}
newForge() {
if [[ "$(printf '%s\n' "1.17.1" "$MC_VERSION" | sort -V | head -n1)" = "1.17.1" ]]; then
NEW_FORGE=true
else
NEW_FORGE=false
fi
}
serverInfoWrite() {
cat <<EOF > server.info
MC_VERSION=$MC_VERSION
MC_LOADER=$MC_LOADER
MC_LOADER_VERSION=$MC_LOADER_VERSION
JAVA_VERSION=${JAVA_VERSION:-"N/A"}
JAR=${JAR:-"N/A"}
XMS=${XMS:-"N/A"}
XMX=${XMX:-"N/A"}
ADD_ARGS=${ADD_ARGS:-"NONE"}
PUID=$PUID
PGID=$PGID
EOF
}