From 81994ec3b3fd15d76825b619fb87f1d92c0873c6 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 1 Nov 2021 17:23:45 -0500 Subject: [PATCH 1/8] docs: described using MaxRAMPercentage when MEMORY is unset --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d34486a9..b14f8ffb 100644 --- a/README.md +++ b/README.md @@ -1288,7 +1288,9 @@ The values of all three are passed directly to the JVM and support format/units -e MEMORY=2G -> To let the JVM calculate the heap size from the container declared memory limit, unset `MEMORY` with an empty value, such as `-e MEMORY=""`. +To let the JVM calculate the heap size from the container declared memory limit, unset `MEMORY` with an empty value, such as `-e MEMORY=""`. By default, the JVM will use 25% of the container memory limit as the heap limit; however, as an example the following would tell the JVM to use 75% of the container limit of 2GB of memory: + + -e MEMORY="" -e JVM_XX_OPTS="-XX:MaxRAMPercentage=75" -m 2000M > The settings above only set the Java **heap** limits. Memory resource requests and limits on the overall container should also account for non-heap memory usage. An extra 25% is [a general best practice](https://dzone.com/articles/best-practices-java-memory-arguments-for-container). From 8177dd9a5ab4b695525a3e1eebd11dcdcce0fcce Mon Sep 17 00:00:00 2001 From: itzg Date: Mon, 1 Nov 2021 22:24:07 +0000 Subject: [PATCH 2/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 b14f8ffb..14c4f2cb 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Running on RaspberryPi](#running-on-raspberrypi) * [Contributing](#contributing) - + From 6ad7773e2b0cf3e026dd0a861b6e8fd10120f80b Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 1 Nov 2021 17:28:58 -0500 Subject: [PATCH 3/8] docs: clarified JVM_OPTS and JVM_XX_OPTS syntax --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 14c4f2cb..27f11705 100644 --- a/README.md +++ b/README.md @@ -1297,8 +1297,7 @@ To let the JVM calculate the heap size from the container declared memory limit, ### JVM Options General JVM options can be passed to the Minecraft Server invocation by passing a `JVM_OPTS` -environment variable. Options like `-X` that need to proceed general JVM options can be passed -via a `JVM_XX_OPTS` environment variable. +environment variable. The JVM requires `-XX` options to precede `-X` options, so those can be declared in `JVM_XX_OPTS`. Both variables are space-delimited, raw JVM arguments. For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this: `JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`. From 9de9ec2e347112472c2803e81e3a49e8ee7bac31 Mon Sep 17 00:00:00 2001 From: itzg Date: Mon, 1 Nov 2021 22:29:26 +0000 Subject: [PATCH 4/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 27f11705..66cd48d8 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Running on RaspberryPi](#running-on-raspberrypi) * [Contributing](#contributing) - + From 367f07b7842194dbb414edf508e1e772a434a1cb Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 4 Nov 2021 20:55:15 -0500 Subject: [PATCH 5/8] feat: added SKIP_SERVER_PROPERTIES #1108 --- README.md | 13 +++++------- scripts/start-setupServerProperties | 32 ++++++++++++++++------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 66cd48d8..37e22c3e 100644 --- a/README.md +++ b/README.md @@ -796,18 +796,15 @@ The world will only be downloaded or copied if it doesn't exist already. Set `FO ## Server configuration -By default the server configuration will be created and set based on the following -environment variables, but only the first time the server is started. If the -`server.properties` file already exists, the values in them will not be changed. +By default, the server configuration will be created and set based on the following environment variables, but only the first time the server is started. If the `server.properties` file already exists, the values in them will not be changed. -If you would like to override the server configuration each time the container -starts up, you can set the OVERRIDE_SERVER_PROPERTIES environment variable like: +If you would like to override the server configuration each time the container starts up, you can set the `OVERRIDE_SERVER_PROPERTIES` environment variable like: docker run -d -e OVERRIDE_SERVER_PROPERTIES=true ... -This will reset any manual configuration of the `server.properties` file, so if -you want to make any persistent configuration changes you will need to make sure -you have properly set the proper environment variables in your docker run command (described below). +This will reset any manual configuration of the `server.properties` file, so if you want to make any persistent configuration changes you will need to make sure you have properly set the proper environment variables in your container configuration. + +In the opposite case, you can skip the startup script's creation of `server.properties`, by setting `SKIP_SERVER_PROPERTIES` to "true". ### Message of the Day diff --git a/scripts/start-setupServerProperties b/scripts/start-setupServerProperties index 50677d84..80931ec2 100755 --- a/scripts/start-setupServerProperties +++ b/scripts/start-setupServerProperties @@ -187,21 +187,25 @@ if [[ ${TYPE} == "CURSEFORGE" ]]; then log "detected FTB, changing properties path to ${SERVER_PROPERTIES}" fi -if [ ! -e "$SERVER_PROPERTIES" ]; then - log "Creating server.properties in ${SERVER_PROPERTIES}" - cp /tmp/server.properties "$SERVER_PROPERTIES" - customizeServerProps -elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then - case ${OVERRIDE_SERVER_PROPERTIES^^} in - TRUE|1) - customizeServerProps - ;; - *) - log "server.properties already created, skipping" - ;; - esac +if ! isTrue "${SKIP_SERVER_PROPERTIES:-false}"; then + if [ ! -e "$SERVER_PROPERTIES" ]; then + log "Creating server.properties in ${SERVER_PROPERTIES}" + cp /tmp/server.properties "$SERVER_PROPERTIES" + customizeServerProps + elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then + case ${OVERRIDE_SERVER_PROPERTIES^^} in + TRUE|1) + customizeServerProps + ;; + *) + log "server.properties already created, skipping" + ;; + esac + else + log "server.properties already created, skipping" + fi else - log "server.properties already created, skipping" + log "Skipping setup of server.properties" fi if isTrue "${ENABLE_AUTOPAUSE}"; then From df2962bdb3bf003ee29123601790bb1189821433 Mon Sep 17 00:00:00 2001 From: itzg Date: Fri, 5 Nov 2021 01:55:28 +0000 Subject: [PATCH 6/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 37e22c3e..4e44acce 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Running on RaspberryPi](#running-on-raspberrypi) * [Contributing](#contributing) - + From e813007f494cfa6c6b353d3115b6d6f520158a3d Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 4 Nov 2021 20:59:42 -0500 Subject: [PATCH 7/8] docs: added cautionary note to Mohist section #1107 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4e44acce..4c872bfb 100644 --- a/README.md +++ b/README.md @@ -482,6 +482,8 @@ By default, the "stable" channel is used, but you can set `MAGMA_CHANNEL` to "de ### Running a Mohist server +> **CAUTION** Be sure to [read this article](https://essentialsx.net/do-not-use-mohist.html) to understand the risks associated with using Mohist. + A [Mohist](https://github.com/MohistMC/Mohist) server can be used with -e TYPE=MOHIST From 0198c15b8cffd47f9bf393523d34aef334147640 Mon Sep 17 00:00:00 2001 From: itzg Date: Fri, 5 Nov 2021 02:00:07 +0000 Subject: [PATCH 8/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 4c872bfb..4a263a33 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Running on RaspberryPi](#running-on-raspberrypi) * [Contributing](#contributing) - +