Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2dc42c52c | ||
|
|
ab14f0c072 | ||
|
|
bf70ca7953 | ||
|
|
135c0bf68e | ||
|
|
4174cb57eb | ||
|
|
23b5eb27dc | ||
|
|
e4b36d2a59 | ||
|
|
40f592df5b | ||
|
|
b9a90b4e6c | ||
|
|
30be064d39 |
@@ -1,6 +1,6 @@
|
|||||||
## 2026-07-29T01:49:10Z
|
## 2026-07-29T23:07:39Z
|
||||||
|
|
||||||
- update dockerfile (fithwum)
|
- update auto update (fithwum)
|
||||||
- Merge build-info updates (fithwum)
|
|
||||||
- Update build-info on 2026-07-29T01:47:03Z [skip ci] (fithwum)
|
|
||||||
- Merge build-info updates (fithwum)
|
- Merge build-info updates (fithwum)
|
||||||
|
- Update build-info on 2026-07-29T22:44:55Z [skip ci] (fithwum)
|
||||||
|
- Merge changelog updates (fithwum)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"version": "minecraft",
|
"version": "minecraft",
|
||||||
"commit": "fd735bc759c4d93349057c023f8093f627fbca42",
|
"commit": "135c0bf68e89d5cae7a4b973ff331006e1ae6aed",
|
||||||
"build_time": "2026-07-29T01:49:32Z",
|
"build_time": "2026-07-29T23:07:50Z",
|
||||||
"image_tag": "gitea.fithwum.tech/fithwum/minecraft:minecraft",
|
"image_tag": "gitea.fithwum.tech/fithwum/minecraft:minecraft",
|
||||||
"digest": "gitea.fithwum.tech/fithwum/minecraft@sha256:2d4529b629f59b04533aed265bb49dba2f9d16ae02a121d7db511076c8f1a865",
|
"digest": "gitea.fithwum.tech/fithwum/minecraft@sha256:14c47c62895da48690d379b4fa5eff12cd286a0326442cc882fad24cd4cc6edd",
|
||||||
"image_size": "302MB",
|
"image_size": "302MB",
|
||||||
"image_size_bytes": 317419226
|
"image_size_bytes": 317406816
|
||||||
}
|
}
|
||||||
|
|||||||
+95
-45
@@ -1,20 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Copyright (c) 2022 fithwum
|
# Copyright (c) 2026 fithwum
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
|
|
||||||
DEBIAN_VERSION=13
|
|
||||||
MC_DIR=/mcserver
|
MC_DIR=/mcserver
|
||||||
EULA_FILE=$MC_DIR/eula.txt
|
EULA_FILE=$MC_DIR/eula.txt
|
||||||
EULA_MARKER=$MC_DIR/.eula_accepted
|
EULA_MARKER=$MC_DIR/.eula_accepted
|
||||||
|
|
||||||
|
MS_REPO=https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb
|
||||||
SERVER_PROPERTIES=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/minecraft/server.properties
|
SERVER_PROPERTIES=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/minecraft/server.properties
|
||||||
|
|
||||||
RUN_VANILLA=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/run-vanilla.sh
|
RUN_VANILLA=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/run-vanilla.sh
|
||||||
RUN_BUKKIT=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/run-bukkit.sh
|
RUN_BUKKIT=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/run-bukkit.sh
|
||||||
RUN_FABRIC=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/run-fabric.sh
|
RUN_FABRIC=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/run-fabric.sh
|
||||||
RUN_QUILT=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/run-quilt.sh
|
RUN_QUILT=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/run-quilt.sh
|
||||||
|
|
||||||
VERSION_CHECK=$(curl -s "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" | grep -Pom 1 '"url": "\K[^"]*'$MC_VERSION'.json')
|
|
||||||
MC_SERVER_FILE=$(curl -s $VERSION_CHECK | jq --raw-output '.downloads.server.url')
|
|
||||||
BUKKIT_INSTALLER_FILE=https://cdn.getbukkit.org/craftbukkit/craftbukkit-$MC_VERSION.jar
|
BUKKIT_INSTALLER_FILE=https://cdn.getbukkit.org/craftbukkit/craftbukkit-$MC_VERSION.jar
|
||||||
FABRIC_SERVER_FILE=https://meta.fabricmc.net/v2/versions/loader/$MC_VERSION/$FABRIC_VERSION/$FABRIC_INSTALLER_VERSION/server/jar
|
FABRIC_SERVER_FILE=https://meta.fabricmc.net/v2/versions/loader/$MC_VERSION/$FABRIC_VERSION/$FABRIC_INSTALLER_VERSION/server/jar
|
||||||
QUILT_INSTALLER_FILE=https://quiltmc.org/api/v1/download-latest-installer/java-universal
|
QUILT_INSTALLER_FILE=https://quiltmc.org/api/v1/download-latest-installer/java-universal
|
||||||
@@ -44,32 +43,32 @@ elif [ $JAVA_VERSION = "openjdk-25-jre" ]; then
|
|||||||
apt-get update
|
apt-get update
|
||||||
apt-get --no-install-recommends -y install openjdk-25-jre-headless
|
apt-get --no-install-recommends -y install openjdk-25-jre-headless
|
||||||
fi
|
fi
|
||||||
# elif [ $JAVA_VERSION = "msopenjdk-21" ]; then
|
elif [ $JAVA_VERSION = "msopenjdk-21" ]; then
|
||||||
# echo "INFO ! $JAVA_VERSION Selected"
|
echo "INFO ! $JAVA_VERSION Selected"
|
||||||
# if [ dpkg -s msopenjdk-21 &> /dev/null ]
|
if [ dpkg -s msopenjdk-21 &> /dev/null ]
|
||||||
# then
|
then
|
||||||
# echo "INFO ! $JAVA_VERSION installed ... moving on."
|
echo "INFO ! $JAVA_VERSION installed ... moving on."
|
||||||
# else
|
else
|
||||||
# echo " "
|
echo " "
|
||||||
# echo "WARNING ! $JAVA_VERSION not installed ... will install now."
|
echo "WARNING ! $JAVA_VERSION not installed ... will install now."
|
||||||
# wget https://packages.microsoft.com/config/debian/$DEBIAN_VERSION/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
wget --no-cache --show-progress --progress=bar:force:noscroll $MS_REPO -O packages-microsoft-prod.deb
|
||||||
# dpkg -i packages-microsoft-prod.deb
|
dpkg -i packages-microsoft-prod.deb
|
||||||
# apt-get update && apt-get install -y msopenjdk-21
|
apt-get update && apt-get install -y msopenjdk-21
|
||||||
# apt-get -y update && apt-get -y --fix-broken install
|
apt-get -y update && apt-get -y --fix-broken install
|
||||||
# fi
|
fi
|
||||||
# elif [ $JAVA_VERSION = "msopenjdk-25" ]; then
|
elif [ $JAVA_VERSION = "msopenjdk-25" ]; then
|
||||||
# echo "INFO ! $JAVA_VERSION Selected"
|
echo "INFO ! $JAVA_VERSION Selected"
|
||||||
# if [ dpkg -s msopenjdk-25 &> /dev/null ]
|
if [ dpkg -s msopenjdk-25 &> /dev/null ]
|
||||||
# then
|
then
|
||||||
# echo "INFO ! $JAVA_VERSION installed ... moving on."
|
echo "INFO ! $JAVA_VERSION installed ... moving on."
|
||||||
# else
|
else
|
||||||
# echo " "
|
echo " "
|
||||||
# echo "WARNING ! $JAVA_VERSION not installed ... will install now."
|
echo "WARNING ! $JAVA_VERSION not installed ... will install now."
|
||||||
# wget https://packages.microsoft.com/config/debian/$DEBIAN_VERSION/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
wget --no-cache --show-progress --progress=bar:force:noscroll $MS_REPO -O packages-microsoft-prod.deb
|
||||||
# dpkg -i packages-microsoft-prod.deb
|
dpkg -i packages-microsoft-prod.deb
|
||||||
# apt-get update && apt-get install -y msopenjdk-25
|
apt-get update && apt-get install -y msopenjdk-25
|
||||||
# apt-get -y update && apt-get -y --fix-broken install
|
apt-get -y update && apt-get -y --fix-broken install
|
||||||
# fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR ! Java version must be set first run"
|
echo "ERROR ! Java version must be set first run"
|
||||||
sleep infinity
|
sleep infinity
|
||||||
@@ -79,27 +78,78 @@ fi
|
|||||||
# Check for server files and download if needed.
|
# Check for server files and download if needed.
|
||||||
if [ $MC_TYPE = "vanilla" ]; then
|
if [ $MC_TYPE = "vanilla" ]; then
|
||||||
echo "INFO ! Vanilla Selected"
|
echo "INFO ! Vanilla Selected"
|
||||||
if [ -e $MC_DIR/mcserver-$MC_VERSION.jar ]
|
# Fallback to default channel type if MC_TYPE or MC_VERSION is empty
|
||||||
then
|
: "${MC_VERSION:=latest}"
|
||||||
echo " "
|
echo "Using server type: $MC_TYPE"
|
||||||
echo "INFO ! mcserver-$MC_VERSION.jar found starting now."
|
|
||||||
|
# Get the currently installed Minecraft version from the filesystem
|
||||||
|
CUR_VERSION=$(find "$MC_DIR" -name "installed-*" | cut -d - -f2-)
|
||||||
|
echo "Current local version: '${CUR_VERSION:-None}'"
|
||||||
|
|
||||||
|
# Fetch the global Minecraft version manifest cleanly
|
||||||
|
JSON=$(curl -s "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json")
|
||||||
|
# Validate that we actually received valid JSON
|
||||||
|
if [ -z "$JSON" ] || ! echo "$JSON" | jq . >/dev/null 2>&1; then
|
||||||
|
echo "Error: Failed to fetch valid JSON from Mojang API"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Resolve the target version dynamically
|
||||||
|
if [ ! -z "$MC_VERSION" ] && [ "$MC_VERSION" != "latest" ]; then
|
||||||
|
# User specified an exact version string (e.g., 1.20.1)
|
||||||
|
TARGET_VERSION=$(echo "$JSON" | jq -r --arg version "$MC_VERSION" '.versions[] | select(.id == $version) | .id')
|
||||||
|
if [ -z "$TARGET_VERSION" ]; then
|
||||||
|
echo "Error: Specified version '$MC_VERSION' not found in Mojang API."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
|
# No version specified or "latest" chosen. Pull from the latest release
|
||||||
|
TARGET_VERSION=$(echo "$JSON" | jq -r '.latest.release')
|
||||||
|
fi
|
||||||
|
echo "Target version determined: '$TARGET_VERSION'"
|
||||||
|
# Update variable to match resolved target
|
||||||
|
MC_VERSION=$TARGET_VERSION
|
||||||
|
|
||||||
|
# Compare versions and only update if they do NOT match
|
||||||
|
if [ "$CUR_VERSION" != "$TARGET_VERSION" ]; then
|
||||||
|
echo "Versions differ ($CUR_VERSION vs $TARGET_VERSION). Fetching Minecraft server download URL..."
|
||||||
|
# Extract the target sub-manifest URL for this specific Minecraft version
|
||||||
|
VERSION_CHECK=$(echo "$JSON" | jq -r --arg version "$TARGET_VERSION" '.versions[] | select(.id == $version) | .url')
|
||||||
|
if [ "$VERSION_CHECK" == "null" ] || [ -z "$VERSION_CHECK" ]; then
|
||||||
|
echo "Error: Metadata URL link not found for version $TARGET_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Fetch the specific version's metadata JSON and extract the server jar link
|
||||||
|
MC_SERVER_FILE=$(curl -s "$VERSION_CHECK" | jq -r '.downloads.server.url')
|
||||||
|
if [ "$MC_SERVER_FILE" == "null" ] || [ -z "$MC_SERVER_FILE" ]; then
|
||||||
|
echo "Error: Server jar download URL not found for version $TARGET_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Ready to download: $MC_SERVER_FILE"
|
||||||
|
# Process Vanilla Minecraft downloads
|
||||||
echo " "
|
echo " "
|
||||||
echo "WARNING ! mcserver-$MC_VERSION.jar is out of date/missing ... will download now."
|
echo "WARNING ! Minecraft server is out of date/missing ... will download now."
|
||||||
echo " "
|
|
||||||
echo "INFO ! Cleaning old files."
|
echo "INFO ! Cleaning old files."
|
||||||
cd $MC_DIR
|
cd "$MC_DIR" || exit 1
|
||||||
mkdir -pv old-server-versions/
|
mkdir -pv old-server-versions/
|
||||||
rm -fr *.jar libraries defaultconfigs config mods user_jvm_args.txt run.bat
|
# Wipe old dependencies cleanly
|
||||||
mv -v *.log old-server-versions/
|
rm -fr *.jar libraries defaultconfigs user_jvm_args.txt run.bat
|
||||||
wget --no-cache --show-progress --progress=bar:force:noscroll $MC_SERVER_FILE -O mcserver-$MC_VERSION.jar
|
# Safely preserve old logs
|
||||||
chmod +x mcserver-$MC_VERSION.jar
|
[ -f *.log ] && mv *.log old-server-versions/
|
||||||
|
# Download and fix execution modes
|
||||||
|
wget --no-cache --show-progress --progress=bar:force:noscroll "$MC_SERVER_FILE" -O "mcserver-$MC_VERSION.jar"
|
||||||
|
chmod +x "mcserver-$MC_VERSION.jar"
|
||||||
echo " "
|
echo " "
|
||||||
echo "WARNING ! run-$MC_TYPE-$MC_VERSION.sh is out of date/missing ... will generate now."
|
echo "WARNING ! run-$MC_TYPE-$MC_VERSION.sh is out of date/missing ... will download now."
|
||||||
mv -v run-*.sh old-server-versions/
|
[ -f run-*.sh ] && mv -v run-*.sh old-server-versions/
|
||||||
wget --no-cache --show-progress --progress=bar:force:noscroll $RUN_VANILLA -O run-$MC_TYPE-$MC_VERSION.sh
|
wget --no-cache --show-progress --progress=bar:force:noscroll "$RUN_VANILLA" -O "run-$MC_TYPE-$MC_VERSION.sh"
|
||||||
chmod +x run-$MC_TYPE-$MC_VERSION.sh
|
chmod +x "run-$MC_TYPE-$MC_VERSION.sh"
|
||||||
|
# Drop updated marker file
|
||||||
|
rm -f installed-*
|
||||||
|
touch installed-$MC_VERSION
|
||||||
cd ..
|
cd ..
|
||||||
|
else
|
||||||
|
echo "No update required. Local version matches target version."
|
||||||
fi
|
fi
|
||||||
elif [ $MC_TYPE = "bukkit" ]; then
|
elif [ $MC_TYPE = "bukkit" ]; then
|
||||||
echo "INFO ! Bukkit Selected"
|
echo "INFO ! Bukkit Selected"
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
## 2026-07-29T22:44:31Z
|
## 2026-07-29T23:07:40Z
|
||||||
|
|
||||||
- add auto update for vanilla (fithwum)
|
- update auto update (fithwum)
|
||||||
- Merge build-info updates (fithwum)
|
- Merge build-info updates (fithwum)
|
||||||
- Update build-info on 2026-07-29T01:49:44Z [skip ci] (fithwum)
|
- Update build-info on 2026-07-29T22:44:55Z [skip ci] (fithwum)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"version": "testing",
|
"version": "testing",
|
||||||
"commit": "16b57f5296b06052a7aa5b2800211198e7bbd97e",
|
"commit": "ab14f0c07272f16452281a259bc00c31f8677af9",
|
||||||
"build_time": "2026-07-29T01:49:43Z",
|
"build_time": "2026-07-29T23:07:56Z",
|
||||||
"image_tag": "gitea.fithwum.tech/fithwum/minecraft:testing",
|
"image_tag": "gitea.fithwum.tech/fithwum/minecraft:testing",
|
||||||
"digest": "gitea.fithwum.tech/fithwum/minecraft@sha256:9b50b5733d7162cd2920ad27dd0fad5b2516d19074aa418097d8dd20328cd68f",
|
"digest": "gitea.fithwum.tech/fithwum/minecraft@sha256:03cdb557f0263e155efdc9943e3feeecbe3684e25fdf93cb152af2affaa5dc4a",
|
||||||
"image_size": "304MB",
|
"image_size": "304MB",
|
||||||
"image_size_bytes": 318984743
|
"image_size_bytes": 318986776
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,11 @@
|
|||||||
# Copyright (c) 2026 fithwum
|
# Copyright (c) 2026 fithwum
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
|
|
||||||
DEBIAN_VERSION=13
|
|
||||||
|
|
||||||
MC_DIR=/mcserver
|
MC_DIR=/mcserver
|
||||||
|
|
||||||
EULA_FILE=$MC_DIR/eula.txt
|
EULA_FILE=$MC_DIR/eula.txt
|
||||||
EULA_MARKER=$MC_DIR/.eula_accepted
|
EULA_MARKER=$MC_DIR/.eula_accepted
|
||||||
INSTALLED_VERSION=$MC_DIR/installed-$TARGET_VERSION
|
|
||||||
|
|
||||||
|
MS_REPO=https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb
|
||||||
SERVER_PROPERTIES=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/server.properties
|
SERVER_PROPERTIES=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/server.properties
|
||||||
START_FILE=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/start.sh
|
START_FILE=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/testing/start.sh
|
||||||
|
|
||||||
@@ -47,6 +44,32 @@ elif [ $JAVA_VERSION = "openjdk-25-jre" ]; then
|
|||||||
apt-get update
|
apt-get update
|
||||||
apt-get --no-install-recommends -y install openjdk-25-jre-headless
|
apt-get --no-install-recommends -y install openjdk-25-jre-headless
|
||||||
fi
|
fi
|
||||||
|
elif [ $JAVA_VERSION = "msopenjdk-21" ]; then
|
||||||
|
echo "INFO ! $JAVA_VERSION Selected"
|
||||||
|
if [ dpkg -s msopenjdk-21 &> /dev/null ]
|
||||||
|
then
|
||||||
|
echo "INFO ! $JAVA_VERSION installed ... moving on."
|
||||||
|
else
|
||||||
|
echo " "
|
||||||
|
echo "WARNING ! $JAVA_VERSION not installed ... will install now."
|
||||||
|
wget --no-cache --show-progress --progress=bar:force:noscroll $MS_REPO -O packages-microsoft-prod.deb
|
||||||
|
dpkg -i packages-microsoft-prod.deb
|
||||||
|
apt-get update && apt-get install -y msopenjdk-21
|
||||||
|
apt-get -y update && apt-get -y --fix-broken install
|
||||||
|
fi
|
||||||
|
elif [ $JAVA_VERSION = "msopenjdk-25" ]; then
|
||||||
|
echo "INFO ! $JAVA_VERSION Selected"
|
||||||
|
if [ dpkg -s msopenjdk-25 &> /dev/null ]
|
||||||
|
then
|
||||||
|
echo "INFO ! $JAVA_VERSION installed ... moving on."
|
||||||
|
else
|
||||||
|
echo " "
|
||||||
|
echo "WARNING ! $JAVA_VERSION not installed ... will install now."
|
||||||
|
wget --no-cache --show-progress --progress=bar:force:noscroll $MS_REPO -O packages-microsoft-prod.deb
|
||||||
|
dpkg -i packages-microsoft-prod.deb
|
||||||
|
apt-get update && apt-get install -y msopenjdk-25
|
||||||
|
apt-get -y update && apt-get -y --fix-broken install
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR ! Java version must be set first run"
|
echo "ERROR ! Java version must be set first run"
|
||||||
sleep infinity
|
sleep infinity
|
||||||
|
|||||||
Reference in New Issue
Block a user