From ecd253dd3ec3e0b2fb63964045fd1c2b4d2f291a Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 15 Aug 2021 12:44:31 -0500 Subject: [PATCH 01/10] Added support for TYPE=LIMBO (#994) --- README.md | 14 +++++++++++ start-configuration | 6 ++++- start-deployLimbo | 57 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 start-deployLimbo diff --git a/README.md b/README.md index ae812249..6b8abae9 100644 --- a/README.md +++ b/README.md @@ -553,6 +553,20 @@ docker run -d -v /path/on/host:/data ... \ In order to add mods, you have two options: +### Running a Limbo server + +A [Limbo](https://github.com/LOOHP/Limbo) server can be run by setting `TYPE` to `LIMBO`. + +Configuration options with defaults: + +- `LIMBO_BUILD`=LATEST + + The `VERSION` will be ignored so locate the appropriate value from [here](https://ci.loohpjames.com/job/Limbo/) to match the version expected by clients. + +- `FORCE_REDOWNLOAD`=false +- `LIMBO_SCHEMA_FILENAME`=default.schem +- `LEVEL`="Default;${LIMBO_SCHEMA_FILENAME}" + ## Running a server with a Feed the Beast modpack > **NOTE** requires one of the Debian based images listed in [the Java versions section](#running-minecraft-server-on-different-java-version). diff --git a/start-configuration b/start-configuration index 37ed677c..d3bbec3e 100644 --- a/start-configuration +++ b/start-configuration @@ -171,11 +171,15 @@ case "${TYPE^^}" in exec ${SCRIPTS:-/}start-deployCanyon "$@" ;; + LIMBO) + exec ${SCRIPTS:-/}start-deployLimbo "$@" + ;; + *) log "Invalid type: '$TYPE'" log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only)," log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, TUINITY, PURPUR" - log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA, AIRPLANE, CANYON" + log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA, AIRPLANE, CANYON, LIMBO" exit 1 ;; diff --git a/start-deployLimbo b/start-deployLimbo new file mode 100644 index 00000000..d9ad0fd5 --- /dev/null +++ b/start-deployLimbo @@ -0,0 +1,57 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +. ${SCRIPTS:-/}start-utils +isDebugging && set -x + +: ${LIMBO_BUILD:=LATEST} +: ${FORCE_REDOWNLOAD:=false} +: ${LIMBO_SCHEMA_FILENAME:=default.schem} +: ${LEVEL:=Default;${LIMBO_SCHEMA_FILENAME}} + +if [[ ${LIMBO_BUILD^^} == LATEST ]]; then + LIMBO_BUILD=lastStableBuild +fi + +baseUrl="https://ci.loohpjames.com/job/Limbo/${LIMBO_BUILD}" +buildInfoUrl="${baseUrl}/api/json" +buildJson=$(curl -fsSL "${buildInfoUrl}") +if [ $? != 0 ]; then + log "ERROR failed to get build info from ${buildInfoUrl} (status=$?)" + exit 1 +fi + +PURPUR_BUILD=$(jq -r '.number' <<<${buildJson}) +artifactPath=$(jq -r '.artifacts[] | select(.fileName|test("^Limbo-")) | .relativePath' <<<${buildJson}) +defaultSchemaPath=$(jq -r '.artifacts[] | select(.fileName|test(".*\\.schem")) | .relativePath' <<<${buildJson}) + +export SERVER="purpur-${PURPUR_BUILD}.jar" + +if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then + downloadUrl="${baseUrl}/artifact/${artifactPath}" + log "Downloading Limbo from $downloadUrl ..." + if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then + log "ERROR: failed to download from $downloadUrl (status=$?)" + exit 3 + fi + +fi + +if [ ! -f "${LIMBO_SCHEMA_FILENAME}" ]; then + log "Downloading default schem file" + if ! curl -o "${LIMBO_SCHEMA_FILENAME}" -fsSL "${baseUrl}/artifact/${defaultSchemaPath}"; then + log "ERROR: failed to download schema file $baseUrl (status=$?)" + exit 3 + fi +fi + +if [[ ${LEVEL} != "*;*" ]]; then + LEVEL="${LEVEL};${LIMBO_SCHEMA_FILENAME}" +fi +export LEVEL + +export SKIP_LOG4J_CONFIG=true + +# Continue to Final Setup +exec ${SCRIPTS:-/}start-finalSetupWorld $@ From 28b7afda1538b9fc2141560984bde6f0e3eeb83a Mon Sep 17 00:00:00 2001 From: itzg Date: Sun, 15 Aug 2021 17:44:45 +0000 Subject: [PATCH 02/10] docs: Auto update markdown TOC --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b8abae9..7b31bc58 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Running an Canyon server](#running-an-canyon-server) * [Running a SpongeVanilla server](#running-a-spongevanilla-server) * [Running a Fabric Server](#running-a-fabric-server) + * [Running a Limbo server](#running-a-limbo-server) * [Running a server with a Feed the Beast modpack](#running-a-server-with-a-feed-the-beast-modpack) * [Environment Variables:](#environment-variables) * [Upgrading](#upgrading) @@ -127,7 +128,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 ff8b160a2baa5ceff41ffd23b6144190ee729666 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 21 Aug 2021 13:52:25 -0500 Subject: [PATCH 03/10] docs: added troubleshooting section --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 7b31bc58..51ec9bc8 100644 --- a/README.md +++ b/README.md @@ -350,6 +350,14 @@ and in the same directory as that file run Now, go play...or adjust the `environment` section to configure this server instance. +## Troubleshooting + +To troubleshoot the container initialization, such as when server files are pre-downloaded, set the environment variable `DEBUG` to `true`. The container logs will include **much more** output, and it is highly recommended including that output when reporting any [issues](https://github.com/itzg/docker-minecraft-server/issues). + +To troubleshoot just the command-line used to start the Minecraft server, set the environment variable `DEBUG_EXEC` to `true`. + +To troubleshoot any issues with memory allocation reported by the JVM, set the environment variable `DEBUG_MEMORY` to `true`. + ## Server types ### Running a Forge Server From 01747510d58a11803cd26d41a5a0b74c80e1120f Mon Sep 17 00:00:00 2001 From: itzg Date: Sat, 21 Aug 2021 18:52:25 +0000 Subject: [PATCH 04/10] docs: Auto update markdown TOC --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 51ec9bc8..ec984459 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Examples](#examples) * [Amazon Web Services (AWS) Deployment](#amazon-web-services-aws-deployment) * [Using Docker Compose](#using-docker-compose) + * [Troubleshooting](#troubleshooting) * [Server types](#server-types) * [Running a Forge Server](#running-a-forge-server) * [Running a Bukkit/Spigot server](#running-a-bukkitspigot-server) @@ -128,7 +129,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 f5ea43b3d3699783588eecd6545f3b7b75fddb58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 07:27:58 -0500 Subject: [PATCH 05/10] build(deps): bump docker/build-push-action from 2.6.1 to 2.7.0 (#1011) --- .github/workflows/build-multiarch.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index d06004d8..9c6612e3 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -63,7 +63,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v2.6.1 + uses: docker/build-push-action@v2.7.0 with: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 232500a9..baf8ef13 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,7 +70,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v2.6.1 + uses: docker/build-push-action@v2.7.0 with: context: . file: ./Dockerfile From 657db124b2d84504afa25415ff919b77708f0d1c Mon Sep 17 00:00:00 2001 From: Daniel Ramp <12480131+DanielRamp@users.noreply.github.com> Date: Sun, 29 Aug 2021 23:26:35 +0200 Subject: [PATCH 06/10] docs: generator_settings json for 1.13+ (#1020) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ec984459..a6f10d49 100644 --- a/README.md +++ b/README.md @@ -1009,6 +1009,10 @@ For example (just the `-e` bits): -e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;' +In Minecraft 1.13+ you need to pass json ([generator site](https://misode.github.io/world/)) like this (details see [here](https://github.com/itzg/docker-minecraft-server/issues/999#issuecomment-907849644)): + + -e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS={"biome":"minecraft:the_void","layers":[{"block":"minecraft:bedrock","height":1},{"block":"minecraft:stone","height":10},{"block":"minecraft:dirt","height":1}],"structures":{"structures":{}}}' + ### Custom Server Resource Pack You can set a link to a custom resource pack and set it's checksum using the `RESOURCE_PACK` and `RESOURCE_PACK_SHA1` options respectively, the default is blank: From b5b4257032ee2382b77d527a103d947b93f2914d Mon Sep 17 00:00:00 2001 From: itzg Date: Sun, 29 Aug 2021 21:26:47 +0000 Subject: [PATCH 07/10] docs: Auto update markdown TOC --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a6f10d49..45d1b375 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,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 0ae15c2b3c9c0500933283e55c4cbb6b2bd4a930 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 29 Aug 2021 17:11:29 -0500 Subject: [PATCH 08/10] Fixed binding address of Limbo server #994 --- start-deployLimbo | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/start-deployLimbo b/start-deployLimbo index d9ad0fd5..5abb5bce 100644 --- a/start-deployLimbo +++ b/start-deployLimbo @@ -9,6 +9,10 @@ isDebugging && set -x : ${FORCE_REDOWNLOAD:=false} : ${LIMBO_SCHEMA_FILENAME:=default.schem} : ${LEVEL:=Default;${LIMBO_SCHEMA_FILENAME}} +# defaults to localhost, if this is not set +: ${SERVER_IP:=0.0.0.0} + +export LEVEL SERVER_IP if [[ ${LIMBO_BUILD^^} == LATEST ]]; then LIMBO_BUILD=lastStableBuild @@ -22,11 +26,14 @@ if [ $? != 0 ]; then exit 1 fi -PURPUR_BUILD=$(jq -r '.number' <<<${buildJson}) +if [[ ${LIMBO_BUILD} = lastStableBuild ]]; then + LIMBO_BUILD=$(jq -r '.number' <<<${buildJson}) + log "Resolved latest Limbo build to ${LIMBO_BUILD}" +fi artifactPath=$(jq -r '.artifacts[] | select(.fileName|test("^Limbo-")) | .relativePath' <<<${buildJson}) defaultSchemaPath=$(jq -r '.artifacts[] | select(.fileName|test(".*\\.schem")) | .relativePath' <<<${buildJson}) -export SERVER="purpur-${PURPUR_BUILD}.jar" +export SERVER="limbo-${LIMBO_BUILD}.jar" if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then downloadUrl="${baseUrl}/artifact/${artifactPath}" @@ -46,7 +53,7 @@ if [ ! -f "${LIMBO_SCHEMA_FILENAME}" ]; then fi fi -if [[ ${LEVEL} != "*;*" ]]; then +if [[ ${LEVEL} != *\;* ]]; then LEVEL="${LEVEL};${LIMBO_SCHEMA_FILENAME}" fi export LEVEL From 788548d1f48d64696c73741ae8f0f670e03aaace Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 30 Aug 2021 21:17:48 -0500 Subject: [PATCH 09/10] misc: upgraded mc-server-runner to 1.7.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bf450b53..d2da5881 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ - --var version=1.6.0 --var app=mc-server-runner --file {{.app}} \ + --var version=1.7.0 --var app=mc-server-runner --file {{.app}} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ From 179cd878a9bc76d64e683f80e0c2051d642d669f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 30 Aug 2021 21:31:06 -0500 Subject: [PATCH 10/10] Added error check on download of GENERIC_PACK #1017 --- start-finalSetupModpack | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/start-finalSetupModpack b/start-finalSetupModpack index 4e956070..855233e2 100644 --- a/start-finalSetupModpack +++ b/start-finalSetupModpack @@ -154,7 +154,10 @@ fi if [[ "${GENERIC_PACK}" ]]; then if isURL "${GENERIC_PACK}"; then log "Downloading generic pack ..." - curl -fsSL -o /tmp/generic_pack.zip "${GENERIC_PACK}" + if ! curl -fsSL -o /tmp/generic_pack.zip "${GENERIC_PACK}"; then + log "ERROR: failed to download ${GENERIC_PACK}" + exit 2 + fi GENERIC_PACK=/tmp/generic_pack.zip fi