From 40547439b24d772d36e4cbf3f68258bb71571a6c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 27 Apr 2020 07:55:38 -0500 Subject: [PATCH 1/5] Added DEBUG_MEMORY option --- start-minecraftFinalSetup | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index b89f9718..97b08867 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -163,6 +163,10 @@ if isTrue "${USE_LARGE_PAGES}"; then " fi +if isTrue "${DEBUG_MEMORY}"; then + free -m +fi + mcServerRunnerArgs="--stop-duration 60s" if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}" From c68997936a261c319d73a302f95dbec27d2018e1 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 27 Apr 2020 08:04:11 -0500 Subject: [PATCH 2/5] Added units description for DEBUG_MEMORY option --- start-minecraftFinalSetup | 2 ++ 1 file changed, 2 insertions(+) diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 97b08867..c17ce18c 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -164,6 +164,8 @@ if isTrue "${USE_LARGE_PAGES}"; then fi if isTrue "${DEBUG_MEMORY}"; then + log "Memory usage and availability (in MB)" + uname -a free -m fi From 6941e63a2ce2890c33d263a0913121294954a91f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 28 Apr 2020 07:27:33 -0500 Subject: [PATCH 3/5] Added skipping of log4j config for Paper For #476 --- start-deployPaper | 1 + 1 file changed, 1 insertion(+) diff --git a/start-deployPaper b/start-deployPaper index 59026a01..07d77117 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -17,6 +17,7 @@ fi # Normalize on Spigot for operations below export TYPE=SPIGOT +export SKIP_LOG4J_CONFIG=true # Continue to Final Setup exec /start-finalSetup01World $@ From 08e8fcdc7cceaa2f1696a373e0da944b1289edff Mon Sep 17 00:00:00 2001 From: Gabriel Oliveira Date: Tue, 28 Apr 2020 20:57:55 -0300 Subject: [PATCH 4/5] Add explanation for timezone config on README (#510) --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 0ff7c610..49751e05 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,24 @@ such as docker run -d -it -e EULA=TRUE -p 25565:25565 --name mc itzg/minecraft-server +## Timezone Configuration + +You can configure the timezone to match yours by setting the `TZ` environment variable: + + -e TZ=Europe/London + +such as: + + docker run -d -it -e TZ=Europe/London -p 25565:25565 --name mc itzg/minecraft-server + +Or mounting `/etc/timezone` as readonly (not supported on Windows): + + -v /etc/timezone:/etc/timezone:ro + +such as: + + docker run -d -it -v /etc/timezone:/etc/timezone:ro -p 25565:25565 --name mc itzg/minecraft-server + ## Attaching data directory to host filesystem In order to readily access the Minecraft data, use the `-v` argument From 79ac19937f501c6e5e8bcc813dced763579ad782 Mon Sep 17 00:00:00 2001 From: orblazer Date: Wed, 29 Apr 2020 02:07:45 +0200 Subject: [PATCH 5/5] Add possibility to use secrets in environment variables (#512) --- README.md | 16 +++++++++++++--- start-finalSetup05EnvVariables | 6 ++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 49751e05..13e2a4d1 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,8 @@ Optionally you can also define a prefix to only match predefined enviroment vari `ENV_VARIABLE_PREFIX="CFG_"` <-- this is the default prefix +If you want use file for value (like when use secrets) you can add suffix `_FILE` to your variable name (in run command). + There are some limitations to what characters you can use. | Type | Allowed Characters | @@ -323,7 +325,7 @@ services: # and here are the actual variables CFG_DB_HOST: "http://localhost:3306" CFG_DB_NAME: "minecraft" - CFG_DB_PASSWORD: "ug23u3bg39o-ogADSs" + CFG_DB_PASSWORD_FILE: "/run/secrets/db_password" restart: always rcon: image: itzg/rcon @@ -336,8 +338,16 @@ services: volumes: mc: rcon: + +secrets: + db_password: + file: ./db_password ``` +The content of `db_password`: + + ug23u3bg39o-ogADSs + ## Running a Bukkit/Spigot server Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT -e VERSION=1.8` or `-e TYPE=SPIGOT -e VERSION=1.8` to your command-line. @@ -470,7 +480,7 @@ in either persistent volumes or a downloadable archive. 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 a Magma server @@ -478,7 +488,7 @@ A [Tuinity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of P A [Magma](https://magmafoundation.org/) server, which is a combination of Forge and PaperMC, can be used with -e TYPE=MAGMA - + > **NOTE** there are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2" ## Running a Server with a Feed-The-Beast (FTB) / CurseForge modpack diff --git a/start-finalSetup05EnvVariables b/start-finalSetup05EnvVariables index 8f08d30a..90a85d52 100644 --- a/start-finalSetup05EnvVariables +++ b/start-finalSetup05EnvVariables @@ -10,6 +10,12 @@ if [ "${REPLACE_ENV_VARIABLES^^}" = "TRUE" ]; then if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] \ && [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] \ && [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then + # Read content from file environment + if [[ $name = *"_FILE" ]] && [[ -f $value ]]; then + name="${name/_FILE/}" + value=$(<$value) + fi + log "Replacing $name with $value ..." find /data/ -type f \ \( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \