From 4808507da8da1970b8ebe24b57cb94c44d72d60e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 10 Jul 2021 14:56:10 -0500 Subject: [PATCH 1/7] Simplified and improved multi-version handling for Fabric #964 --- examples/docker-compose-fabric.yml | 15 ++++++ start-deployFabric | 75 ++++++++++++------------------ 2 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 examples/docker-compose-fabric.yml diff --git a/examples/docker-compose-fabric.yml b/examples/docker-compose-fabric.yml new file mode 100644 index 00000000..a321dacb --- /dev/null +++ b/examples/docker-compose-fabric.yml @@ -0,0 +1,15 @@ +version: "3" + +services: + mc: + image: ${IMAGE:-itzg/minecraft-server} + environment: + EULA: "true" + TYPE: FABRIC + ports: + - 25565:25565 + volumes: + - fabric:/data + +volumes: + fabric: {} \ No newline at end of file diff --git a/start-deployFabric b/start-deployFabric index 4734e0ea..d8d9d6be 100644 --- a/start-deployFabric +++ b/start-deployFabric @@ -3,54 +3,43 @@ set -eu . ${SCRIPTS:-/}start-utils +requireVar VANILLA_VERSION export TYPE=FABRIC +export SERVER=fabric-server-${VANILLA_VERSION}.jar -FABRIC_INSTALLER=${FABRIC_INSTALLER:-} -FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-} -FABRIC_INSTALLER_VERSION=${FABRIC_INSTALLER_VERSION:-${FABRICVERSION:-LATEST}} -if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then - log "Checking Fabric version information." - case $FABRIC_INSTALLER_VERSION in - LATEST) +isDebugging && set -x + +if [[ ! -e ${SERVER} ]]; then + + : ${FABRIC_INSTALLER:=} + : ${FABRIC_INSTALLER_URL:=} + : ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}} + + if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then + log "Checking Fabric version information." + if [[ ${FABRIC_INSTALLER_VERSION^^} = LATEST ]]; then FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml) - ;; - esac + fi - FABRIC_INSTALLER="/tmp/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar" - markerVersion=$FABRIC_INSTALLER_VERSION + FABRIC_INSTALLER="fabric-installer-${FABRIC_INSTALLER_VERSION}.jar" + FABRIC_INSTALLER_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar" + elif [[ -z $FABRIC_INSTALLER ]]; then + FABRIC_INSTALLER="fabric-installer.jar" + elif [[ ! -e $FABRIC_INSTALLER ]]; then + log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER" + exit 2 + fi -elif [[ -z $FABRIC_INSTALLER ]]; then - FABRIC_INSTALLER="/tmp/fabric-installer.jar" - markerVersion=custom -elif [[ ! -e $FABRIC_INSTALLER ]]; then - log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER" - exit 2 -fi - -installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${markerVersion}" - -debug Checking for installMarker ${installMarker} -if [[ ! -e $installMarker ]]; then if [[ ! -e $FABRIC_INSTALLER ]]; then - if [[ -z $FABRIC_INSTALLER_URL ]]; then - log "Downloading installer version $FABRIC_INSTALLER_VERSION" - downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar" - log "...trying $downloadUrl" - curl -o $FABRIC_INSTALLER -fsSL $downloadUrl - else - log "Downloading $FABRIC_INSTALLER_URL ..." - if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then - log "Failed to download from given location $FABRIC_INSTALLER_URL" - exit 2 - fi + log "Downloading $FABRIC_INSTALLER_URL ..." + if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then + log "Failed to download from given location $FABRIC_INSTALLER_URL" + exit 2 fi fi - if isDebugging; then - debug "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER" - else - log "Installing Fabric using $FABRIC_INSTALLER" - fi + log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER" + tries=3 set +e while ((--tries >= 0)); do @@ -67,13 +56,9 @@ if [[ ! -e $installMarker ]]; then log "Fabric failed to install after several tries." >&2 exit 10 fi - export SERVER=fabric-server-launch.jar - log "Using server $SERVER" - echo $SERVER > $installMarker -else - export SERVER=$(< $installMarker) + mv fabric-server-launch.jar ${SERVER} fi -# Contineut to Final Setup +# Continue to Final Setup exec ${SCRIPTS:-/}start-finalSetupWorld $@ From c5119ad27b84b9329b788bf0978ca33024c7a1fd Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 11 Jul 2021 13:28:17 -0500 Subject: [PATCH 2/7] docs: Clarified docker attach usage with interactive, color console --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 36da942a..eee3ca92 100644 --- a/README.md +++ b/README.md @@ -1214,13 +1214,19 @@ For some cases, if e.g. after removing mods, it could be necessary to startup mi ### Interactive and Color Console -If you would like to attach to the Minecraft server console with color and interactive capabilities, then add +If you would like to `docker attach` to the Minecraft server console with color and interactive capabilities, then add ``` -e EXEC_DIRECTLY=true ``` -> **NOTE** this will bypass graceful server shutdown handling when using `docker stop`, so be sure to use `rcon-cli` or console commands to `stop` the server. +> **NOTES** +> +> This feature doesn't work via rcon, so you will need to `docker attach` to the container. Use the sequence Ctrl-P, Ctrl-Q to detach. +> +> This will bypass graceful server shutdown handling when using `docker stop`, so be sure the server console's `stop` command. +> +> Make to enable stdin and tty with `-it` when using `docker run` or `stdin_open: true` and `tty: true` when using docker compose. ### OpenJ9 Specific Options From 2da5e2b2ecd37ac9949435b36f153cb52a0a756b Mon Sep 17 00:00:00 2001 From: itzg Date: Sun, 11 Jul 2021 18:28:34 +0000 Subject: [PATCH 3/7] docs: Auto update markdown TOC --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eee3ca92..ac3ed178 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Enabling Autopause](#enabling-autopause) * [Running on RaspberryPi](#running-on-raspberrypi) - + From daa329200018a711d556223d26a3282fbb9e16dc Mon Sep 17 00:00:00 2001 From: silence_eternal Date: Mon, 12 Jul 2021 09:24:20 -0500 Subject: [PATCH 4/7] docs: Update README with watchdog disable for autopause (#967) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac3ed178..5b8894c9 100644 --- a/README.md +++ b/README.md @@ -1318,7 +1318,7 @@ Of course, even loaded chunks are not ticked when the process is stopped. **You must greatly increase or disable max-tick-time watchdog functionality.** From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the `max-tick-time` in the `server.properties` file is set to a very large value or -1 to disable it entirely, which is highly recommended. That can be set with `MAX_TICK_TIME` as described in [the section below](#max-tick-time). -> **NOTE:** Non-vanilla versions might have their own configuration file, you might have to disable their watchdogs separately (e.g. PAPER Servers). +> **NOTE:** Non-vanilla versions might have their own configuration file, you might have to disable their watchdogs separately. For PaperMC servers, you need to send the JVM flag `-Ddisable.watchdog=true`, this can be done with the docker env variable `-e JVM_DD_OPTS=disable.watchdog:true` On startup the `server.properties` file is checked and, if applicable, a warning is printed to the terminal. When the server is created (no data available in the persistent directory), the properties file is created with the Watchdog disabled. From 9c9c295a7948f25edb462a543ac6fa348afcd4ec Mon Sep 17 00:00:00 2001 From: itzg Date: Mon, 12 Jul 2021 14:24:37 +0000 Subject: [PATCH 5/7] docs: Auto update markdown TOC --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b8894c9..aba7be89 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Enabling Autopause](#enabling-autopause) * [Running on RaspberryPi](#running-on-raspberrypi) - + From 67ca9a7fc41776fe950bbd5ff03646e40057df33 Mon Sep 17 00:00:00 2001 From: Jawa_Juice <67296752+Jawa-Juice@users.noreply.github.com> Date: Mon, 12 Jul 2021 20:03:17 -0400 Subject: [PATCH 6/7] Update Airplane branches for 1.17 release (#968) * Update branches for official 1.17/1.17.1 releases * Reflect Airplane 1.17 release --- README.md | 4 +--- start-deployAirplane | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index aba7be89..39f282b5 100644 --- a/README.md +++ b/README.md @@ -450,9 +450,7 @@ An [Airplane](https://github.com/TECHNOVE/Airplane) server, which is a fork of T -e TYPE=AIRPLANE -> NOTE: The `VERSION` variable is used to select an Airplane branch to download from. The available options are "LATEST" "1.16" "1.17" and "PURPUR" - -> NOTE: The 1.17 branch is currently in beta, and is not yet sufficiently stable for production use. Use at your own risk! +> NOTE: The `VERSION` variable is used to select an Airplane branch to download from. The available options are "LATEST" "1.17" "1.16" "PURPUR" and "PURPUR-1.16" Extra variables: - `AIRPLANE_BUILD=lastSuccessfulBuild` : set a specific Airplane build to use diff --git a/start-deployAirplane b/start-deployAirplane index 3aebd038..89deac44 100644 --- a/start-deployAirplane +++ b/start-deployAirplane @@ -5,28 +5,26 @@ IFS=$'\n\t' . ${SCRIPTS:-/}start-utils isDebugging && set -x -if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ]; then - log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.16, VERSION=1.17 or VERSION=PURPUR. Note that these are branches, not #.#.# versions." +if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] && [ "${VERSION}" != "PURPUR-1.16" ] ; then + log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=1.16, VERSION=PURPUR or VERSION=PURPUR-1.16. Note that these are branches, not #.#.# versions." exit 1 fi : ${AIRPLANE_BUILD:=lastSuccessfulBuild} -if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.16" ]; then +if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then + AIRPLANE_BRANCH="1.17" +fi + +if [ "${VERSION}" = "1.16" ]; then AIRPLANE_BRANCH="1.16" fi -if [ "${VERSION}" = "1.17" ]; then - AIRPLANE_BRANCH="1.17" - log "AIRPLANE 1.17 IS IN BETA, AND IS NOT YET PRODUCTION-READY. USE AT YOUR OWN RISK!!!" -fi - -if [ "${VERSION}" = "1.17.1" ]; then - AIRPLANE_BRANCH="1.17.1" - log "AIRPLANE 1.17.1 IS IN BETA, AND IS NOT YET PRODUCTION-READY. USE AT YOUR OWN RISK!!!" -fi - if [ "${VERSION}" = "PURPUR" ]; then + AIRPLANE_BRANCH="Purpur-1.17" +fi + +if [ "${VERSION}" = "PURPUR-1.16" ]; then AIRPLANE_BRANCH="Purpur-1.16" fi From 4357066cdf66bc82f2fb32393bbafc9122dba3cb Mon Sep 17 00:00:00 2001 From: itzg Date: Tue, 13 Jul 2021 00:03:34 +0000 Subject: [PATCH 7/7] docs: Auto update markdown TOC --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39f282b5..2ff4c36c 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Enabling Autopause](#enabling-autopause) * [Running on RaspberryPi](#running-on-raspberrypi) - +