From e6a3ca0a1fd1d8b095aa66d5c63e4f781588cc1c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 18 Apr 2020 18:42:55 -0500 Subject: [PATCH 1/8] Added JVM property to skip Spigot update check For #417 --- start-deployBukkitSpigot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index a6e25f19..cfec08cf 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -57,6 +57,9 @@ ERROR: failed to download from $downloadUrl EOF exit 3 fi + + JVM_OPTS="${JVM_OPTS} -DIReallyKnowWhatIAmDoingISwear" + export JVM_OPTS } From f9defda10657d0d7d55087bd9628142f13cc75dd Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 19 Apr 2020 13:42:39 -0500 Subject: [PATCH 2/8] Fixed wording of CF/FTB pre-downloads --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fdf5077..409120c2 100644 --- a/README.md +++ b/README.md @@ -460,7 +460,7 @@ Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line. -e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.6.zip \ -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server -If you don't want to keep the pre-download modpacks separate from your data directory, +If you want to keep the pre-download modpacks separate from your data directory, then you can attach another volume at a path of your choosing and reference that. The following example uses `/modpacks` as the container path as the pre-download area: From 757a5146a10e399c4b1e23f09bb16a5ab62c8e43 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 19 Apr 2020 13:47:14 -0500 Subject: [PATCH 3/8] Added forge example compose file --- examples/docker-compose-forge.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/docker-compose-forge.yml diff --git a/examples/docker-compose-forge.yml b/examples/docker-compose-forge.yml new file mode 100644 index 00000000..4c9f6c86 --- /dev/null +++ b/examples/docker-compose-forge.yml @@ -0,0 +1,23 @@ +version: "3.7" + +services: + mc: + image: itzg/minecraft-server + ports: + # expose the Minecraft server port outside of container + - 25565:25565 + environment: + # REQUIRED for all types + EULA: "TRUE" + # Set server type (vs the default of vanilla) + TYPE: FORGE + volumes: + # use a named, managed volume for data volume + - mc_forge:/data + # attach local host directory "mods" in same directory as this compose file + # all mods in this directory get copied into /data/mods at startup + - ./mods:/mods:ro + +volumes: + # declared the named volume, but use default/local storage engine + mc_forge: {} From e9b13321197fc77ba18648a82635c425878dd1f8 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 21 Apr 2020 18:30:48 -0500 Subject: [PATCH 4/8] Added support for Magma servers For #497 --- README.md | 8 ++++++++ start-configuration | 4 ++++ start-deployBukkitSpigot | 1 + start-deployCustom | 2 ++ start-magma | 18 ++++++++++++++++++ start-minecraftFinalSetup | 2 +- 6 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 start-magma diff --git a/README.md b/README.md index 409120c2..073c648e 100644 --- a/README.md +++ b/README.md @@ -444,6 +444,14 @@ This works well if you want to have a common set of plugins in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive. +## Running a Magma server + +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 Enable this server mode by adding a `-e TYPE=FTB` or `-e TYPE=CURSEFORGE` to your command-line, diff --git a/start-configuration b/start-configuration index a79f7471..15c19ca1 100644 --- a/start-configuration +++ b/start-configuration @@ -106,6 +106,10 @@ case "${TYPE^^}" in exec /start-validateCurseInstance "$@" ;; + MAGMA) + exec /start-magma "$@" + ;; + *) log "Invalid type: '$TYPE'" log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, CURSEFORGE, SPONGEVANILLA" diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index cfec08cf..05e29994 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -82,6 +82,7 @@ fi # Normalize on Spigot for operations below export TYPE=SPIGOT +export SKIP_LOG4J_CONFIG=true # Continue to Final Setup exec /start-finalSetup01World $@ diff --git a/start-deployCustom b/start-deployCustom index 0d64f912..5b7e6f8d 100644 --- a/start-deployCustom +++ b/start-deployCustom @@ -25,5 +25,7 @@ else exit 2 fi +export SKIP_LOG4J_CONFIG=true + # Continue to Final Setup exec /start-finalSetup01World $@ diff --git a/start-magma b/start-magma new file mode 100755 index 00000000..70b201f4 --- /dev/null +++ b/start-magma @@ -0,0 +1,18 @@ +#!/bin/bash + +. /start-utils + +export SERVER="/data/magma-server-${VANILLA_VERSION}.jar" + +# Always download since new updates of each base version are published frequently +if ! curl -o /data/magma-server-${VANILLA_VERSION}.jar -fsSL \ + https://api.magmafoundation.org/api/resources/Magma/${VANILLA_VERSION}/stable/latest/download; then + log "ERROR unable to download version ${VANILLA_VERSION} of Magma" + log " Check https://magmafoundation.org/ for available versions" + exit 1 +fi + +export SKIP_LOG4J_CONFIG=true + +# Continue to Final Setup +exec /start-finalSetup01World $@ diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index ff20ceea..b89f9718 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -27,7 +27,7 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then fi fi -if [ ${TYPE} != "SPIGOT" ]; then +if ! isTrue ${SKIP_LOG4J_CONFIG}; then # Set up log configuration LOGFILE="/data/log4j2.xml" if [ ! -e "$LOGFILE" ]; then From c2846fc586c757fcb523415b40d79b6df3ff90d6 Mon Sep 17 00:00:00 2001 From: orblazer Date: Wed, 22 Apr 2020 14:06:57 +0200 Subject: [PATCH 5/8] Allow specify paper build and don't use legacy gamemode and difficulty (#503) --- README.md | 19 +++++----- start-deployPaper | 8 +++-- start-finalSetup04ServerProperties | 58 ++++++++++++++++++++++-------- 3 files changed, 60 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 073c648e..563ed2c1 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ up: This is the easiest way if you are using an ephemeral `/data` filesystem, or downloading a world with the `WORLD` option. -There are two additional volumes that can be mounted; `/mods` and `/config`. +There are two additional volumes that can be mounted; `/mods` and `/config`. Any files in either of these filesystems will be copied over to the main `/data` filesystem before starting Minecraft. @@ -374,7 +374,7 @@ up: This is the easiest way if you are using an ephemeral `/data` filesystem, or downloading a world with the `WORLD` option. -There is one additional volume that can be mounted; `/plugins`. +There is one additional volume that can be mounted; `/plugins`. Any files in this filesystem will be copied over to the main `/data/plugins` filesystem before starting Minecraft. @@ -386,6 +386,9 @@ in either persistent volumes or a downloadable archive. Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to your command-line. +By default the container will run the latest build of [Paper server](https://papermc.io/downloads) +but you can also choose to run a specific build with `-e PAPERBUILD=205`. + docker run -d -v /path/on/host:/data \ -e TYPE=PAPER -e VERSION=1.9.4 \ -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server @@ -436,7 +439,7 @@ up: This is the easiest way if you are using an ephemeral `/data` filesystem, or downloading a world with the `WORLD` option. -There is one additional volume that can be mounted; `/plugins`. +There is one additional volume that can be mounted; `/plugins`. Any files in this filesystem will be copied over to the main `/data/plugins` filesystem before starting Minecraft. @@ -459,8 +462,8 @@ but note the following additional steps needed... You need to specify a modpack to run, using the `FTB_SERVER_MOD` or `CF_SERVER_MOD` environment variable. An FTB/CurseForge server modpack is available together with its respective -client modpack on https://www.feed-the-beast.com under "Additional Files." Similar you can -locate the modpacks for CurseForge at https://www.curseforge.com/minecraft/modpacks . +client modpack on under "Additional Files." Similar you can +locate the modpacks for CurseForge at . Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line. @@ -498,7 +501,7 @@ To use these packs you will need to: - Specify the manifest location with env var `MANIFEST=/data/FeedTheBeast/manifest` - Pick a relevant ServerStart.sh and potentially settings.cfg and put them in `/data/FeedTheBeast` -An example of the latter would be to use https://github.com/AllTheMods/Server-Scripts +An example of the latter would be to use There, you'll find that all you have to do is put `ServerStart.sh` and `settings.cfg` into `/data/FeedTheBeast`, taking care to update `settings.cfg` to specify your desired version of minecraft and forge. You can do this in the cli with something like: @@ -596,7 +599,7 @@ up: This is the easiest way if you are using an ephemeral `/data` filesystem, or downloading a world with the `WORLD` option. -There are two additional volumes that can be mounted; `/mods` and `/config`. +There are two additional volumes that can be mounted; `/mods` and `/config`. Any files in either of these filesystems will be copied over to the main `/data` filesystem before starting Minecraft. @@ -995,7 +998,7 @@ Allows users to use flight on your server while in Survival mode, if they have a -e ALLOW_FLIGHT=TRUE|FALSE -### Other server property mappings: +### Other server property mappings Environment Variable | Server Property ---------------------|----------------- diff --git a/start-deployPaper b/start-deployPaper index bec4016f..a0d15e8d 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -2,10 +2,12 @@ . /start-utils -export SERVER=paper_server-${VANILLA_VERSION}.jar +PAPERBUILD=${PAPERBUILD:-LATEST} +export SERVER=paper_server-${VANILLA_VERSION}-${PAPERBUILD}.jar + if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then - downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/latest/download} - log "Downloading Paper $VANILLA_VERSION from $downloadUrl ..." + downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/${PAPERBUILD}/download} + log "Downloading Paper $VANILLA_VERSION (build $PAPERBUILD) from $downloadUrl ..." curl -fsSL -o "$SERVER" "$downloadUrl" if [ ! -f "$SERVER" ]; then log "ERROR: failed to download from $downloadUrl (status=$?)" diff --git a/start-finalSetup04ServerProperties b/start-finalSetup04ServerProperties index d5ef5503..bdc02108 100644 --- a/start-finalSetup04ServerProperties +++ b/start-finalSetup04ServerProperties @@ -81,16 +81,32 @@ function customizeServerProps { if [ -n "$DIFFICULTY" ]; then case $DIFFICULTY in peaceful|0) - DIFFICULTY=0 + if versionLessThan 1.13; then + DIFFICULTY=0 + else + DIFFICULTY=peaceful + fi ;; easy|1) - DIFFICULTY=1 + if versionLessThan 1.13; then + DIFFICULTY=1 + else + DIFFICULTY=easy + fi ;; normal|2) - DIFFICULTY=2 + if versionLessThan 1.13; then + DIFFICULTY=2 + else + DIFFICULTY=normal + fi ;; hard|3) - DIFFICULTY=3 + if versionLessThan 1.13; then + DIFFICULTY=3 + else + DIFFICULTY=hard + fi ;; *) log "DIFFICULTY must be peaceful, easy, normal, or hard." @@ -104,19 +120,33 @@ function customizeServerProps { log "Setting mode" MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' ) case $MODE_LC in - 0|1|2|3) + su*|0) + if versionLessThan 1.13; then + MODE=0 + else + MODE=survival + fi ;; - su*) - MODE=0 + c*|1) + if versionLessThan 1.13; then + MODE=1 + else + MODE=creative + fi ;; - c*) - MODE=1 + a*|2) + if versionLessThan 1.13; then + MODE=2 + else + MODE=adventure + fi ;; - a*) - MODE=2 - ;; - sp*) - MODE=3 + sp*|3) + if versionLessThan 1.13; then + MODE=3 + else + MODE=spectator + fi ;; *) log "ERROR: Invalid game mode: $MODE" From 664f3d7eaa2c607beb26fe297b3f87fee8f2c7c3 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 22 Apr 2020 17:08:07 -0500 Subject: [PATCH 6/8] Fixed latest Paper build to be "latest" --- start-deployPaper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-deployPaper b/start-deployPaper index a0d15e8d..59026a01 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -2,7 +2,7 @@ . /start-utils -PAPERBUILD=${PAPERBUILD:-LATEST} +: ${PAPERBUILD:=latest} export SERVER=paper_server-${VANILLA_VERSION}-${PAPERBUILD}.jar if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then From fbdee6a7a73a1cc2ec1622b19c48f282efc89ea1 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 24 Apr 2020 18:56:15 -0500 Subject: [PATCH 7/8] Added support for Tunity server type --- README.md | 8 ++++++++ start-configuration | 4 ++++ start-deployTunity | 27 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100755 start-deployTunity diff --git a/README.md b/README.md index 563ed2c1..4453b3fe 100644 --- a/README.md +++ b/README.md @@ -447,6 +447,14 @@ This works well if you want to have a common set of plugins in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive. +## Running a Tunity server + +A [Tunity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of Paper aimed at improving server performance at high playercounts. + + -e TYPE=TUNITY + +> **NOTE** only `VERSION=LATEST` is supported + ## 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 15c19ca1..4b6a5499 100644 --- a/start-configuration +++ b/start-configuration @@ -78,6 +78,10 @@ case "${TYPE^^}" in exec /start-deployPaper "$@" ;; + TUNITY) + exec /start-deployTunity "$@" + ;; + FORGE) exec /start-deployForge "$@" ;; diff --git a/start-deployTunity b/start-deployTunity new file mode 100755 index 00000000..b998bdd9 --- /dev/null +++ b/start-deployTunity @@ -0,0 +1,27 @@ +#!/bin/bash + +. /start-utils + +if [ "${VERSION}" != "LATEST" ]; then + log "ERROR: Tunity server type only supports VERSION=LATEST" + exit 1 +fi + +: ${TUNITY_BUILD:=lastSuccessfulBuild} +export SERVER=tunity-${VANILLA_VERSION}-${TUNITY_BUILD}.jar + +if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then + downloadUrl="https://ci.codemc.io/job/Spottedleaf/job/Tuinity/${TUNITY_BUILD}/artifact/tuinity-paperclip.jar" + log "Downloading Tunity (build $TUNITY_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 operations below +export TYPE=SPIGOT + +# Continue to Final Setup +exec /start-finalSetup01World $@ From 691fe638e4d171023b16f15898b57429acb2f887 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 24 Apr 2020 19:13:51 -0500 Subject: [PATCH 8/8] Fixed spelling of Tuinity --- README.md | 6 +++--- start-configuration | 4 ++-- start-deployTunity => start-deployTuinity | 0 3 files changed, 5 insertions(+), 5 deletions(-) rename start-deployTunity => start-deployTuinity (100%) mode change 100755 => 100644 diff --git a/README.md b/README.md index 4453b3fe..0ff7c610 100644 --- a/README.md +++ b/README.md @@ -447,11 +447,11 @@ This works well if you want to have a common set of plugins in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive. -## Running a Tunity server +## Running a Tuinity server -A [Tunity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of Paper aimed at improving server performance at high playercounts. +A [Tuinity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of Paper aimed at improving server performance at high playercounts. - -e TYPE=TUNITY + -e TYPE=TUINITY > **NOTE** only `VERSION=LATEST` is supported diff --git a/start-configuration b/start-configuration index 4b6a5499..0d6290c9 100644 --- a/start-configuration +++ b/start-configuration @@ -78,8 +78,8 @@ case "${TYPE^^}" in exec /start-deployPaper "$@" ;; - TUNITY) - exec /start-deployTunity "$@" + TUINITY) + exec /start-deployTuinity "$@" ;; FORGE) diff --git a/start-deployTunity b/start-deployTuinity old mode 100755 new mode 100644 similarity index 100% rename from start-deployTunity rename to start-deployTuinity