diff --git a/Dockerfile b/Dockerfile index e17ca3fd..f8777bdd 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.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 98a9ab59..477eb809 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,8 @@ 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) * [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) @@ -108,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) @@ -130,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) - + @@ -430,17 +429,9 @@ 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. +An [Airplane](https://airplane.gg) server, which is "a stable, optimized, well supported 1.17 Paper fork." -e TYPE=AIRPLANE @@ -453,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 @@ -462,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 @@ -1146,14 +1125,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: @@ -1164,9 +1135,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/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 index 855df234..db96d264 --- a/start-configuration +++ b/start-configuration @@ -93,10 +93,6 @@ case "${TYPE^^}" in exec ${SCRIPTS:-/}start-deployPaper "$@" ;; - TUINITY) - exec ${SCRIPTS:-/}start-deployTuinity "$@" - ;; - FORGE) exec ${SCRIPTS:-/}start-deployForge "$@" ;; @@ -145,10 +141,6 @@ case "${TYPE^^}" in exec ${SCRIPTS:-/}start-deployPurpur "$@" ;; - YATOPIA) - exec ${SCRIPTS:-/}start-deployYatopia "$@" - ;; - AIRPLANE) exec ${SCRIPTS:-/}start-deployAirplane "$@" ;; @@ -164,8 +156,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-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 deleted file mode 100644 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-deployVanilla b/start-deployVanilla old mode 100644 new mode 100755 diff --git a/start-deployYatopia b/start-deployYatopia deleted file mode 100644 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 $@ 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 index 51232c0f..67677af8 --- 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 $@ 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