From 693da82ebb1fdc0e8df84fc669da95bfac1a8ad4 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 1 Feb 2025 18:34:42 -0600 Subject: [PATCH] Add support for Cleanroom (Forge fork) installer - add back support for FORGE_INSTALLER_URL --- Dockerfile | 2 +- docs/types-and-platforms/server-types/forge.md | 9 +++++++++ examples/cleanroom/compose.yml | 15 +++++++++++++++ scripts/start-deployForge | 14 ++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 examples/cleanroom/compose.yml diff --git a/Dockerfile b/Dockerfile index 651bffb34a6..6729a0e580d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \ --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -ARG MC_HELPER_VERSION=1.40.11 +ARG MC_HELPER_VERSION=1.40.12 ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION} # used for cache busting local copy of mc-image-helper ARG MC_HELPER_REV=1 diff --git a/docs/types-and-platforms/server-types/forge.md b/docs/types-and-platforms/server-types/forge.md index 58ee93ad639..04ebaae5325 100644 --- a/docs/types-and-platforms/server-types/forge.md +++ b/docs/types-and-platforms/server-types/forge.md @@ -1,5 +1,13 @@ A [Forge server](http://www.minecraftforge.net/) can be automatically downloaded, upgraded, and run by setting the environment variable `TYPE` to "FORGE". +!!! note "A note from the installer" + + > Please do not automate the download and installation of Forge. + Our efforts are supported by ads from the download page. + If you MUST automate this, please consider supporting the project through + + Since my project also relies on donations, please pass it along and consider contributing to the Patreon above. + !!! example ``` @@ -14,6 +22,7 @@ A [Forge server](http://www.minecraftforge.net/) can be automatically downloaded The overall version is specified by `VERSION`, [as described in the section above](../../versions/minecraft.md) and provides the same benefits of upgrading as new versions are released. By default, the recommended version of Forge for that Minecraft version will be selected. The latest version can be selected instead by setting the environment variable `FORGE_VERSION` to "latest". You can also choose a specific Forge version by setting `FORGE_VERSION` with that version, such as "14.23.5.2854". + !!! example ``` diff --git a/examples/cleanroom/compose.yml b/examples/cleanroom/compose.yml new file mode 100644 index 00000000000..d224872cb6f --- /dev/null +++ b/examples/cleanroom/compose.yml @@ -0,0 +1,15 @@ +# Provides an example of running CleanroomMC from https://github.com/CleanroomMC/Cleanroom, +# which is a Forge fork +services: + mc: + image: itzg/minecraft-server + environment: + EULA: true + TYPE: forge + FORGE_INSTALLER_URL: https://github.com/CleanroomMC/Cleanroom/releases/download/0.2.4-alpha/cleanroom-0.2.4-alpha-installer.jar + ports: + - "25565:25565" + volumes: + - mc-data:/data +volumes: + mc-data: \ No newline at end of file diff --git a/scripts/start-deployForge b/scripts/start-deployForge index db74fc1089d..9cecf869b76 100755 --- a/scripts/start-deployForge +++ b/scripts/start-deployForge @@ -21,6 +21,20 @@ if [[ ${FORGE_INSTALLER} ]]; then logError "Failed to installForge given installer ${FORGE_INSTALLER}" exit 1 fi +elif [[ ${FORGE_INSTALLER_URL:-} ]]; then + mkdir -p tmp + if ! installer=$(get -o tmp --output-filename "${FORGE_INSTALLER_URL}"); then + logError "Failed to download installer from $FORGE_INSTALLER_URL" + exit 1 + fi + + # shellcheck disable=SC2064 + trap "rm $installer" EXIT + + if ! mc-image-helper-forge --forge-installer="${installer}" ; then + logError "Failed to install forge from ${FORGE_INSTALLER_URL}" + exit 1 + fi else if ! mc-image-helper-forge --forge-version="${FORGE_VERSION}"; then logError "Failed to install Forge"