From 98ad3b0f4acb2ca5429e7de15902cab02adee972 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 15 Sep 2021 21:37:10 -0500 Subject: [PATCH 1/8] misc: fixed execute bit on scripts --- files/autopause/autopause-daemon.sh | 0 files/autopause/autopause-fcns.sh | 0 health.sh | 0 start | 0 start-configuration | 0 start-deployAirplane | 0 start-deployBukkitSpigot | 0 start-deployCF | 0 start-deployCanyon | 0 start-deployCatserver | 0 start-deployCustom | 0 start-deployFTBA | 0 start-deployFabric | 0 start-deployForge | 0 start-deployLimbo | 0 start-deployMagma | 0 start-deployMohist | 0 start-deployPaper | 0 start-deploySpongeVanilla | 0 start-deployTuinity | 0 start-deployVanilla | 0 start-deployYatopia | 0 start-finalExec | 0 start-setupEnvVariables | 0 start-setupModconfig | 0 start-setupModpack | 0 start-setupMounts | 0 start-setupServerProperties | 0 start-setupWorld | 0 start-spiget | 0 start-utils | 0 31 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 files/autopause/autopause-daemon.sh mode change 100644 => 100755 files/autopause/autopause-fcns.sh mode change 100644 => 100755 health.sh mode change 100644 => 100755 start mode change 100644 => 100755 start-configuration mode change 100644 => 100755 start-deployAirplane mode change 100644 => 100755 start-deployBukkitSpigot mode change 100644 => 100755 start-deployCF mode change 100644 => 100755 start-deployCanyon mode change 100644 => 100755 start-deployCatserver mode change 100644 => 100755 start-deployCustom mode change 100644 => 100755 start-deployFTBA mode change 100644 => 100755 start-deployFabric mode change 100644 => 100755 start-deployForge mode change 100644 => 100755 start-deployLimbo mode change 100644 => 100755 start-deployMagma mode change 100644 => 100755 start-deployMohist mode change 100644 => 100755 start-deployPaper mode change 100644 => 100755 start-deploySpongeVanilla mode change 100644 => 100755 start-deployTuinity mode change 100644 => 100755 start-deployVanilla mode change 100644 => 100755 start-deployYatopia mode change 100644 => 100755 start-finalExec mode change 100644 => 100755 start-setupEnvVariables mode change 100644 => 100755 start-setupModconfig mode change 100644 => 100755 start-setupModpack mode change 100644 => 100755 start-setupMounts mode change 100644 => 100755 start-setupServerProperties mode change 100644 => 100755 start-setupWorld mode change 100644 => 100755 start-spiget mode change 100644 => 100755 start-utils diff --git a/files/autopause/autopause-daemon.sh b/files/autopause/autopause-daemon.sh old mode 100644 new mode 100755 diff --git a/files/autopause/autopause-fcns.sh b/files/autopause/autopause-fcns.sh old mode 100644 new mode 100755 diff --git a/health.sh b/health.sh old mode 100644 new mode 100755 diff --git a/start b/start old mode 100644 new mode 100755 diff --git a/start-configuration b/start-configuration old mode 100644 new mode 100755 diff --git a/start-deployAirplane b/start-deployAirplane old mode 100644 new mode 100755 diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot old mode 100644 new mode 100755 diff --git a/start-deployCF b/start-deployCF old mode 100644 new mode 100755 diff --git a/start-deployCanyon b/start-deployCanyon old mode 100644 new mode 100755 diff --git a/start-deployCatserver b/start-deployCatserver old mode 100644 new mode 100755 diff --git a/start-deployCustom b/start-deployCustom old mode 100644 new mode 100755 diff --git a/start-deployFTBA b/start-deployFTBA old mode 100644 new mode 100755 diff --git a/start-deployFabric b/start-deployFabric old mode 100644 new mode 100755 diff --git a/start-deployForge b/start-deployForge old mode 100644 new mode 100755 diff --git a/start-deployLimbo b/start-deployLimbo old mode 100644 new mode 100755 diff --git a/start-deployMagma b/start-deployMagma old mode 100644 new mode 100755 diff --git a/start-deployMohist b/start-deployMohist old mode 100644 new mode 100755 diff --git a/start-deployPaper b/start-deployPaper old mode 100644 new mode 100755 diff --git a/start-deploySpongeVanilla b/start-deploySpongeVanilla old mode 100644 new mode 100755 diff --git a/start-deployTuinity b/start-deployTuinity old mode 100644 new mode 100755 diff --git a/start-deployVanilla b/start-deployVanilla old mode 100644 new mode 100755 diff --git a/start-deployYatopia b/start-deployYatopia old mode 100644 new mode 100755 diff --git a/start-finalExec b/start-finalExec old mode 100644 new mode 100755 diff --git a/start-setupEnvVariables b/start-setupEnvVariables old mode 100644 new mode 100755 diff --git a/start-setupModconfig b/start-setupModconfig old mode 100644 new mode 100755 diff --git a/start-setupModpack b/start-setupModpack old mode 100644 new mode 100755 diff --git a/start-setupMounts b/start-setupMounts old mode 100644 new mode 100755 diff --git a/start-setupServerProperties b/start-setupServerProperties old mode 100644 new mode 100755 diff --git a/start-setupWorld b/start-setupWorld old mode 100644 new mode 100755 diff --git a/start-spiget b/start-spiget old mode 100644 new mode 100755 diff --git a/start-utils b/start-utils old mode 100644 new mode 100755 From 72461546b82f476ff35d436b0898909f746e931c Mon Sep 17 00:00:00 2001 From: Mufin <61682723+mufinlive@users.noreply.github.com> Date: Thu, 16 Sep 2021 18:26:05 +0200 Subject: [PATCH 2/8] Remove tuinity section from README.md (#1045) --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index 98a9ab59..f2e9d691 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,6 @@ By default, the container will download the latest version of the "vanilla" [Min * [Running a Forge Server](#running-a-forge-server) * [Running a Bukkit/Spigot server](#running-a-bukkitspigot-server) * [Running a Paper server](#running-a-paper-server) - * [Running a Tuinity server](#running-a-tuinity-server) * [Running an Airplane server](#running-an-airplane-server) * [Running a Purpur server](#running-a-purpur-server) * [Running a Yatopia server](#running-a-yatopia-server) @@ -430,14 +429,6 @@ If you have attached a host directory to the `/data` volume, then you can instal [You can also auto-download plugins using `SPIGET_RESOURCES`.](#auto-downloading-spigotmcbukkitpapermc-plugins) -### Running a Tuinity server - -A [Tuinity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of Paper aimed at improving server performance at high playercounts. - - -e TYPE=TUINITY - -> **NOTE** only `VERSION=LATEST` is supported - ### Running an Airplane server An [Airplane](https://github.com/TECHNOVE/Airplane) server, which is a fork of Tuinity aimed at further improving server performance at high playercounts. From 764e1e93631a208c7d158262d6c003756e74dd1d Mon Sep 17 00:00:00 2001 From: itzg Date: Thu, 16 Sep 2021 16:26:22 +0000 Subject: [PATCH 3/8] docs: Auto update markdown TOC --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f2e9d691..4bec3b9b 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 bdeab5bb9c166857eadf1ea0abdb50c16a738c41 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 16 Sep 2021 22:11:32 -0500 Subject: [PATCH 4/8] Upgraded mc-image-helper to 1.2.1 #1048 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 384bede4..e43fa4fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -ARG MC_HELPER_VERSION=1.2.0 +ARG MC_HELPER_VERSION=1.2.1 RUN curl -fsSL https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ | tar -C /usr/share -zxf - \ && ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin From 250d32e3dc73a1024d4c03e44228f9e42f87c684 Mon Sep 17 00:00:00 2001 From: Jawa_Juice <67296752+Jawa-Juice@users.noreply.github.com> Date: Sun, 19 Sep 2021 10:46:40 -0400 Subject: [PATCH 5/8] Remove Yatopia support as discontinued (#1049) --- README.md | 16 ++-------------- start-configuration | 12 ++---------- start-deployTuinity | 26 -------------------------- start-deployYatopia | 29 ----------------------------- 4 files changed, 4 insertions(+), 79 deletions(-) delete mode 100755 start-deployTuinity delete mode 100755 start-deployYatopia diff --git a/README.md b/README.md index 4bec3b9b..869da72e 100644 --- a/README.md +++ b/README.md @@ -431,7 +431,7 @@ If you have attached a host directory to the `/data` volume, then you can instal ### Running an Airplane server -An [Airplane](https://github.com/TECHNOVE/Airplane) server, which is a fork of Tuinity aimed at further improving server performance at high playercounts. +An [Airplane](https://airplane.gg) server, which is "a stable, optimized, well supported 1.17 Paper fork." -e TYPE=AIRPLANE @@ -444,7 +444,7 @@ Extra variables: ### Running a Purpur server -A [Purpur](https://purpur.pl3x.net/) server, which is "a drop-in replacement for Paper servers designed for configurability, new fun and exciting gameplay features, and high performance built on top of Tuinity." +A [Purpur](https://purpur.pl3x.net/) server, which is "drop-in replacement for Paper servers designed for configurability, new fun and exciting gameplay features, and performance built on top of Airplane." -e TYPE=PURPUR @@ -453,18 +453,6 @@ A [Purpur](https://purpur.pl3x.net/) server, which is "a drop-in replacement for 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 - `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the [Flare](https://blog.airplane.gg/flare) profiler ### Running a Magma server diff --git a/start-configuration b/start-configuration index d3bbec3e..0d5cb5de 100755 --- a/start-configuration +++ b/start-configuration @@ -93,10 +93,6 @@ case "${TYPE^^}" in exec ${SCRIPTS:-/}start-deployPaper "$@" ;; - TUINITY) - exec ${SCRIPTS:-/}start-deployTuinity "$@" - ;; - FORGE) if versionLessThan 1.17; then log "**********************************************************************" @@ -159,10 +155,6 @@ case "${TYPE^^}" in exec ${SCRIPTS:-/}start-deployPurpur "$@" ;; - YATOPIA) - exec ${SCRIPTS:-/}start-deployYatopia "$@" - ;; - AIRPLANE) exec ${SCRIPTS:-/}start-deployAirplane "$@" ;; @@ -178,8 +170,8 @@ case "${TYPE^^}" in *) 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, LIMBO" + log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, PURPUR, CUSTOM," + log " MAGMA, MOHIST, CATSERVER, AIRPLANE, CANYON, LIMBO" exit 1 ;; diff --git a/start-deployTuinity b/start-deployTuinity deleted file mode 100755 index 052cf4b1..00000000 --- a/start-deployTuinity +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -. ${SCRIPTS:-/}start-utils - -if [ "${VERSION}" != "LATEST" ]; then - log "ERROR: Tuinity server type only supports VERSION=LATEST" - exit 1 -fi - -: ${TUINITY_BUILD:=lastSuccessfulBuild} -export SERVER=tuinity-${VANILLA_VERSION}-${TUINITY_BUILD}.jar - -if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then - downloadUrl="https://ci.codemc.io/job/Spottedleaf/job/Tuinity/${TUINITY_BUILD}/artifact/tuinity-paperclip.jar" - log "Downloading Tuinity (build $TUINITY_BUILD) from $downloadUrl ..." - curl -fsSL -o "$SERVER" "$downloadUrl" - if [ ! -f "$SERVER" ]; then - log "ERROR: failed to download from $downloadUrl (status=$?)" - exit 3 - fi -fi - -# Normalize on Spigot for later operations -export TYPE=SPIGOT - -exec ${SCRIPTS:-/}start-spiget "$@" diff --git a/start-deployYatopia b/start-deployYatopia deleted file mode 100755 index 890b9b30..00000000 --- a/start-deployYatopia +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -set -euo pipefail -IFS=$'\n\t' - -. ${SCRIPTS:-/}start-utils -isDebugging && set -x - -: ${VANILLA_VERSION:?} -: ${RELEASE:=latest} -: ${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 - -exec ${SCRIPTS:-/}start-setupWorld $@ From 7ef031e24451a5573ab33f4bf39797957f450448 Mon Sep 17 00:00:00 2001 From: itzg Date: Sun, 19 Sep 2021 14:46:55 +0000 Subject: [PATCH 6/8] docs: Auto update markdown TOC --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 869da72e..3935e9ff 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,6 @@ By default, the container will download the latest version of the "vanilla" [Min * [Running a Paper server](#running-a-paper-server) * [Running an Airplane server](#running-an-airplane-server) * [Running a Purpur server](#running-a-purpur-server) - * [Running a Yatopia server](#running-a-yatopia-server) * [Running a Magma server](#running-a-magma-server) * [Running a Mohist server](#running-a-mohist-server) * [Running a Catserver type server](#running-a-catserver-type-server) @@ -129,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 8bac02bbcfdd3980c0b0e3d8a425a0ebe8a1bc0c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 19 Sep 2021 21:32:59 -0500 Subject: [PATCH 7/8] Added JSON-patching support #1051 --- Dockerfile | 2 +- README.md | 50 ++++++++++++++++++++++++++++++++--------- start-setupEnvVariables | 10 +++++++++ 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index e43fa4fe..46f7d49d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -ARG MC_HELPER_VERSION=1.2.1 +ARG MC_HELPER_VERSION=1.3.0 RUN curl -fsSL https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ | tar -C /usr/share -zxf - \ && ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin diff --git a/README.md b/README.md index 3935e9ff..bd7d1029 100644 --- a/README.md +++ b/README.md @@ -1124,14 +1124,6 @@ services: CFG_DB_HOST: "http://localhost:3306" CFG_DB_NAME: "minecraft" CFG_DB_PASSWORD_FILE: "/run/secrets/db_password" - restart: always - rcon: - image: itzg/rcon - ports: - - "4326:4326" - - "4327:4327" - volumes: - - "rcon:/opt/rcon-web-admin/db" volumes: mc: @@ -1142,9 +1134,47 @@ secrets: file: ./db_password ``` -The content of `db_password`: +### Patching existing files - ug23u3bg39o-ogADSs +JSON path based patches can be applied to one or more existing files by setting the variable `PATCH_DEFINITIONS` to the path of a directory that contains one or more [patch definition json files](https://github.com/itzg/mc-image-helper#patchdefinition) or a [patch set json file](https://github.com/itzg/mc-image-helper#patchset). + +Variable placeholders in the patch values can be restricted by setting `REPLACE_ENV_VARIABLE_PREFIX`, which defaults to "CFG_". + +The following example shows a patch-set file were various fields in the `paper.yaml` configuration file can be modified and added: + +```json +{ + "patches": [ + { + "file": "/data/paper.yml", + "ops": [ + { + "$set": { + "path": "$.verbose", + "value": true + } + }, + { + "$set": { + "path": "$.settings['velocity-support'].enabled", + "value": "${CFG_VELOCITY_ENABLED}", + "value-type": "bool" + } + }, + { + "$put": { + "path": "$.settings", + "key": "my-test-setting", + "value": "testing" + } + } + ] + } + ] +} +``` + +> **NOTES:** Only JSON and Yaml files can be patched at this time. TOML support is planned to be added next. Removal of comments and other cosmetic changes will occur when patched files are processed. ### Running with a custom server JAR diff --git a/start-setupEnvVariables b/start-setupEnvVariables index 51232c0f..67677af8 100755 --- a/start-setupEnvVariables +++ b/start-setupEnvVariables @@ -2,12 +2,15 @@ . ${SCRIPTS:-/}start-utils +set -e + : ${REPLACE_ENV_IN_PLACE:=${REPLACE_ENV_VARIABLES:-false}} : ${REPLACE_ENV_PATHS:=/data} : ${REPLACE_ENV_SUFFIXES:=yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml} : ${REPLACE_ENV_VARIABLE_PREFIX:=${ENV_VARIABLE_PREFIX:-CFG_}} : ${REPLACE_ENV_VARIABLES_EXCLUDES:=} : ${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS:=} +: ${PATCH_DEFINITIONS:=} : ${DEBUG:=false} if isTrue "${REPLACE_ENV_IN_PLACE}"; then @@ -21,4 +24,11 @@ if isTrue "${REPLACE_ENV_IN_PLACE}"; then "${REPLACE_ENV_PATHS[@]}" fi +if [[ ${PATCH_DEFINITIONS} ]]; then + log "Applying patch definitions from ${PATCH_DEFINITIONS}" + mc-image-helper --debug=${DEBUG} patch \ + --patch-env-prefix=${REPLACE_ENV_VARIABLE_PREFIX} \ + "${PATCH_DEFINITIONS}" +fi + exec ${SCRIPTS:-/}start-finalExec $@ From 814559bef89e1b9a52384e2ef16451921586d622 Mon Sep 17 00:00:00 2001 From: itzg Date: Mon, 20 Sep 2021 02:33:20 +0000 Subject: [PATCH 8/8] docs: Auto update markdown TOC --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bd7d1029..477eb809 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Other server property mappings](#other-server-property-mappings) * [Miscellaneous Options](#miscellaneous-options) * [Replacing variables inside configs](#replacing-variables-inside-configs) + * [Patching existing files](#patching-existing-files) * [Running with a custom server JAR](#running-with-a-custom-server-jar) * [Force re-download of the server file](#force-re-download-of-the-server-file) * [Running as alternate user/group ID](#running-as-alternate-usergroup-id) @@ -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) - +