From 959bf73485b2a5964d7241e8bfafeff55d374864 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 7 Feb 2021 09:26:37 -0600 Subject: [PATCH 1/5] Limit depth when finding old PaperMC server jars Fixes #750 --- start-deployPaper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-deployPaper b/start-deployPaper index 5bc7a02c..10a88d25 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -58,7 +58,7 @@ else log "Removing old PaperMC versions ..." paperJarSearchString=${SERVER/$build/[0-9]*} - find . -name "$paperJarSearchString" ! -name "$SERVER" -delete -print + find . -maxdepth 1 -name "$paperJarSearchString" ! -name "$SERVER" -delete -print log "Downloading PaperMC $VANILLA_VERSION (build $build) ..." curl -fsSL -o "$SERVER" "${zarg[@]}" \ From 8312233a9393832d62d6638e1e6b516abbe33ff5 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 7 Feb 2021 11:22:08 -0600 Subject: [PATCH 2/5] Added support for Purpur servers #746 --- README.md | 12 ++++++++++++ start-configuration | 4 ++++ start-deployPurpur | 38 ++++++++++++++++++++++++++++++++++++++ start-deployTuinity | 2 +- 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100755 start-deployPurpur diff --git a/README.md b/README.md index 0f0007af..90e36b26 100644 --- a/README.md +++ b/README.md @@ -487,6 +487,18 @@ A [Tuinity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of P > **NOTE** only `VERSION=LATEST` is supported +## Running a Purpur server + +A [Purpur](https://purpur.pl3x.net/) server, which is "a fork of Paper and Tuinity with the goal of providing new and interesting configuration options". + + -e TYPE=PURPUR + +> NOTE: the `VERSION` variable is used to lookup a build of Purpur to download + +Extra variables: +- `PURPUR_BUILD=LATEST` : set a specific Purpur build to use +- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded + ## Running a Magma server A [Magma](https://magmafoundation.org/) server, which is a combination of Forge and PaperMC, can be used with diff --git a/start-configuration b/start-configuration index e4431321..1cb1a387 100644 --- a/start-configuration +++ b/start-configuration @@ -138,6 +138,10 @@ case "${TYPE^^}" in exec ${SCRIPTS:-/}start-deployCatserver "$@" ;; + PURPUR) + exec ${SCRIPTS:-/}start-deployPurpur "$@" + ;; + *) log "Invalid type: '$TYPE'" log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only)," diff --git a/start-deployPurpur b/start-deployPurpur new file mode 100755 index 00000000..91a5fbf3 --- /dev/null +++ b/start-deployPurpur @@ -0,0 +1,38 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +. ${SCRIPTS:-/}start-utils +isDebugging && set -x + +: ${VANILLA_VERSION:?} +: ${PURPUR_BUILD:=LATEST} +: ${FORCE_REDOWNLOAD:=false} + +if [[ ${PURPUR_BUILD} == LATEST ]]; then + PURPUR_BUILD=$(curl -fsSL "https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}" | + jq -r '.builds.latest' || echo "") + if [[ -z ${PURPUR_BUILD} ]]; then + log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}." + log " Please check if a download is available at https://purpur.pl3x.net/downloads/" + exit 3 + fi +fi + +export SERVER="purpur-${VANILLA_VERSION}-${PURPUR_BUILD}.jar" + +if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then + downloadUrl="https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download" + log "Downloading Purpur from $downloadUrl ..." + if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then + log "ERROR: failed to download from $downloadUrl (status=$?)" + exit 3 + fi +fi + +# Normalize on Spigot for later operations +export TYPE=SPIGOT +export SKIP_LOG4J_CONFIG=true + +# Continue to Final Setup +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deployTuinity b/start-deployTuinity index f2c6f039..d0343402 100644 --- a/start-deployTuinity +++ b/start-deployTuinity @@ -20,7 +20,7 @@ if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then fi fi -# Normalize on Spigot for operations below +# Normalize on Spigot for later operations export TYPE=SPIGOT # Continue to Final Setup From 861faaa2857f5052ff46375dc0e30ea109c43460 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 7 Feb 2021 17:52:42 -0600 Subject: [PATCH 3/5] Trimmed back some ENV defaults from Dockerfile --- Dockerfile | 6 +++--- start-deployForge | 2 +- start-deploySpongeVanilla | 2 ++ start-finalSetupServerProperties | 2 +- start-finalSetupWorld | 3 +++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9cf2b045..c6d9c63c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,9 +71,9 @@ WORKDIR /data ENV UID=1000 GID=1000 \ JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \ - TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \ - PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \ - LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \ + TYPE=VANILLA VERSION=LATEST \ + ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \ + SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \ ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \ AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0 diff --git a/start-deployForge b/start-deployForge index e58d885c..f6b273eb 100644 --- a/start-deployForge +++ b/start-deployForge @@ -1,8 +1,8 @@ #!/bin/bash . ${SCRIPTS:-/}start-utils - export TYPE=FORGE +: ${FORGEVERSION:=RECOMMENDED} if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then norm=$VANILLA_VERSION diff --git a/start-deploySpongeVanilla b/start-deploySpongeVanilla index 199107cb..8c80b4d3 100644 --- a/start-deploySpongeVanilla +++ b/start-deploySpongeVanilla @@ -3,6 +3,8 @@ . ${SCRIPTS:-/}start-utils export TYPE=spongevanilla +: ${SPONGEBRANCH:=STABLE} +: ${SPONGEVERSION:=} # Parse branch log "Choosing branch for Sponge" diff --git a/start-finalSetupServerProperties b/start-finalSetupServerProperties index d058cf95..08f19bef 100644 --- a/start-finalSetupServerProperties +++ b/start-finalSetupServerProperties @@ -69,7 +69,7 @@ function customizeServerProps { setServerProp "max-world-size" "$MAX_WORLD_SIZE" setServerProp "level-name" "$LEVEL" setServerProp "level-seed" "$SEED" - setServerProp "pvp" "$PVP" + setServerProp "pvp" "${PVP}" setServerProp "generator-settings" "$GENERATOR_SETTINGS" setServerProp "online-mode" "$ONLINE_MODE" setServerProp "allow-flight" "$ALLOW_FLIGHT" diff --git a/start-finalSetupWorld b/start-finalSetupWorld index 5d1bd79c..96537246 100644 --- a/start-finalSetupWorld +++ b/start-finalSetupWorld @@ -4,6 +4,9 @@ set -e isDebugging && set -x +: ${LEVEL:=world} +export LEVEL + if [ $TYPE = "FEED-THE-BEAST" ]; then worldDest=$FTB_DIR/$LEVEL else From e46af9d54c014adb94d6dd2293ef162732f0f251 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 7 Feb 2021 17:58:50 -0600 Subject: [PATCH 4/5] Fixed vanilla version lookup to fail early #756 --- start-configuration | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/start-configuration b/start-configuration index 1cb1a387..1daf08d2 100644 --- a/start-configuration +++ b/start-configuration @@ -1,7 +1,12 @@ #!/bin/bash +set -euo pipefail +IFS=$'\n\t' . ${SCRIPTS:-/}start-utils +: ${PROXY:=} +: ${RCON_PASSWORD_FILE:=} + shopt -s nullglob #umask 002 From eb1203097565980c7abd0d7c3c2af1b570734d19 Mon Sep 17 00:00:00 2001 From: LichLord91 <8435580+LichLord91@users.noreply.github.com> Date: Sun, 7 Feb 2021 16:00:53 -0800 Subject: [PATCH 5/5] Update Invalid Server Type Logging Message (#758) Includes Tuinity and Purpur Co-authored-by: lichlord91 --- start-configuration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-configuration b/start-configuration index 1daf08d2..614d7851 100644 --- a/start-configuration +++ b/start-configuration @@ -150,7 +150,7 @@ case "${TYPE^^}" in *) log "Invalid type: '$TYPE'" log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only)," - log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA," + log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, TUINITY, PURPUR" log " CUSTOM, MAGMA, MOHIST, CATSERVER" exit 1 ;;