From 7d4e4c167ee2ef1cc10eca19f96b3c608d78fd9f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 8 Feb 2021 20:42:54 -0600 Subject: [PATCH 1/4] Added support for Yatopia #704 --- README.md | 12 ++++++++++++ start-configuration | 6 +++++- start-deployYatopia | 30 ++++++++++++++++++++++++++++++ start-utils | 14 ++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 start-deployYatopia diff --git a/README.md b/README.md index 90e36b26..64c8fd80 100644 --- a/README.md +++ b/README.md @@ -499,6 +499,18 @@ 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 Yatopia server + +A [Yatopia](https://github.com/YatopiaMC/Yatopia) server, which is a "blazing fast Tuinity fork with best in class performance". + + -e TYPE=YATOPIA + +> NOTE: the `VERSION` variable is used to locate the Yatopia version to download + +Extra variables: +- `RELEASE=stable` : set to `stable` or `latest` +- `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 614d7851..e1377fc4 100644 --- a/start-configuration +++ b/start-configuration @@ -147,11 +147,15 @@ case "${TYPE^^}" in exec ${SCRIPTS:-/}start-deployPurpur "$@" ;; + YATOPIA) + exec ${SCRIPTS:-/}start-deployYatopia "$@" + ;; + *) 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" + log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA" exit 1 ;; diff --git a/start-deployYatopia b/start-deployYatopia new file mode 100644 index 00000000..0cbc28ce --- /dev/null +++ b/start-deployYatopia @@ -0,0 +1,30 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +. ${SCRIPTS:-/}start-utils +isDebugging && set -x + +: ${VANILLA_VERSION:?} +: ${RELEASE:=stable} +: ${FORCE_REDOWNLOAD:=false} + +requireEnum RELEASE stable latest + +export SERVER="yatopia-${RELEASE}-${VANILLA_VERSION}.jar" + +if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then + downloadUrl="https://api.yatopiamc.org/v2/${RELEASE}Build/download?branch=ver/${VANILLA_VERSION}" + log "Downloading Yatopia 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-utils b/start-utils index 81876838..51c70d64 100644 --- a/start-utils +++ b/start-utils @@ -144,6 +144,20 @@ requireVar() { fi } +requireEnum() { + var=${1?} + shift + + for allowed in $*; do + if [[ ${!var} = $allowed ]]; then + return 0 + fi + done + + log "ERROR: $var must be set to one of $@" +# exit 1 +} + function writeEula() { if ! echo "# Generated via Docker # $(date) From 31f25cfd1bcb77d0939199510d9846f7ba3b1eea Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 8 Feb 2021 21:15:28 -0600 Subject: [PATCH 2/4] Added java8 recommendation to CURSEFORGE / FTB --- start-configuration | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/start-configuration b/start-configuration index e1377fc4..d5d36bcd 100644 --- a/start-configuration +++ b/start-configuration @@ -112,6 +112,10 @@ case "${TYPE^^}" in ;; FTB|CURSEFORGE) + log "**********************************************************************" + log "WARNING: The image tag itzg/minecraft-server:java8 is recommended" + log " since some mods require Java 8" + log "**********************************************************************" exec ${SCRIPTS:-/}start-deployCF "$@" ;; From b2d23edf6d109e5132256f7273b2f16e63a76c8e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 8 Feb 2021 21:27:25 -0600 Subject: [PATCH 3/4] ci: Added pull:true to multiarch build --- .github/workflows/build-multiarch.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index a0ec4aa8..f5ee8f6c 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -68,6 +68,8 @@ jobs: platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.prep.outputs.tags }} + # ensure latest base image is used + pull: true cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache labels: | From c48f6c31ce165cfe2e2ec9dbef7ec7f164f43f2e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 10 Feb 2021 13:57:14 -0600 Subject: [PATCH 4/4] Missing EULA failed without proper log message #749 --- start-configuration | 1 + 1 file changed, 1 insertion(+) diff --git a/start-configuration b/start-configuration index d5d36bcd..60e38fd5 100644 --- a/start-configuration +++ b/start-configuration @@ -4,6 +4,7 @@ IFS=$'\n\t' . ${SCRIPTS:-/}start-utils +: ${EULA:=} : ${PROXY:=} : ${RCON_PASSWORD_FILE:=}