Compare commits

..

101 Commits

Author SHA1 Message Date
Geoff Bourne 0e1c9261d1 Auto-merging via docker-versions-create 2021-12-11 16:25:20 -06:00
Geoff Bourne 3f2022da40 Merge branch 'master' of github.com:itzg/docker-minecraft-server 2021-12-11 16:23:25 -06:00
Geoff Bourne 0f7464403c build: added github release creation step to docker-versions-create.sh 2021-12-11 16:09:15 -06:00
itzg bee39343a6 docs: Auto update markdown TOC 2021-12-11 22:09:11 +00:00
StealthCT e9326db933 Improved whitelist and ops support (#1182) 2021-12-11 16:08:53 -06:00
itzg dd1cc82fcd docs: Auto update markdown TOC 2021-12-11 19:01:44 +00:00
Brett Randall 93825895b9 Startup fail-fast with error message if both ENABLE_AUTOPAUSE=true and EXEC_DIRECTLY=true are set. (#1186) 2021-12-11 13:01:30 -06:00
Bram 492aebc718 Remove old Airplane versions (#1185) 2021-12-11 12:56:11 -06:00
Levy Ehrstein e66b2eda60 fix: log4j patch being applied to <1.7 versions (#1183)
As described in https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition,
versions below 1.7 are not affected by the log4j exploit. They should therefore not use any mitigations.

See #1179 discussion after merge.

Reported-and-tested-by: Daniel Porter "Stealthii" <dan.porter@rehabstudio.com>
2021-12-11 11:33:44 -06:00
Geoff Bourne acc7c0568a Auto-merging via docker-versions-create 2021-12-10 21:05:18 -06:00
Geoff Bourne 3bb21d8581 Used log4j2.formatMsgNoLookups as fallback for non-vanilla
#1180
2021-12-10 20:50:40 -06:00
Geoff Bourne 3b0f82fedd Auto-merging via docker-versions-create 2021-12-10 10:43:00 -06:00
Geoff Bourne ac234ae658 Auto-merging via docker-versions-create 2021-12-10 07:58:17 -06:00
Geoff Bourne 0f9d81e5f1 Auto-merging via docker-versions-create 2021-12-06 22:06:46 -06:00
Geoff Bourne 7072f5dc91 Auto-merging via docker-versions-create 2021-12-04 10:00:46 -06:00
Geoff Bourne 9b155f2496 Auto-merging via docker-versions-create 2021-12-02 19:47:29 -06:00
Geoff Bourne add00ad38d Auto-merging via docker-versions-create 2021-11-24 15:58:14 -06:00
Geoff Bourne a3cff3ce88 Auto-merging via docker-versions-create 2021-11-24 14:35:05 -06:00
Geoff Bourne 601d587927 Track latest from master 2021-11-16 19:02:49 -06:00
Geoff Bourne e195a38faa Auto-merging via docker-versions-create 2021-11-16 18:52:40 -06:00
Geoff Bourne e704348630 Auto-merging via docker-versions-create 2021-11-15 20:49:24 -06:00
Geoff Bourne 893f6754f0 Auto-merging via docker-versions-create 2021-11-13 19:18:35 -06:00
Geoff Bourne f137251e22 Auto-merging via docker-versions-create 2021-11-13 18:53:09 -06:00
Geoff Bourne 869f167c0c Auto-merging via docker-versions-create 2021-11-12 21:24:57 -06:00
Geoff Bourne 3d7107bdbd Auto-merging via docker-versions-create 2021-11-06 21:40:38 -05:00
Geoff Bourne bce01eb1a2 Auto-merging via docker-versions-create 2021-11-04 21:07:26 -05:00
Geoff Bourne c5d1b655ce Auto-merging via docker-versions-create 2021-10-31 09:48:44 -05:00
Geoff Bourne 529e9fd058 Switched base image to JDK
#1064
2021-10-27 21:28:11 -05:00
Geoff Bourne 905768d050 Merge branch 'master' into java16-openj9 2021-10-27 21:27:47 -05:00
Geoff Bourne 0dd0199d5c Auto-merging via docker-versions-create 2021-10-25 19:26:11 -05:00
Geoff Bourne 925a63f035 Auto-merging via docker-versions-create 2021-10-24 20:31:17 -05:00
Geoff Bourne f4be04ceb4 Auto-merging via docker-versions-create 2021-10-23 09:46:52 -05:00
Geoff Bourne db4594b3b3 Auto-merging via docker-versions-create 2021-10-22 15:57:06 -05:00
Geoff Bourne bfd4e6247c Auto-merging via docker-versions-create 2021-10-18 22:16:50 -05:00
Geoff Bourne 4e31acb896 Auto-merging via docker-versions-create 2021-10-17 14:55:46 -05:00
Geoff Bourne 78e4ecc1d7 Auto-merging via docker-versions-create 2021-10-15 19:00:24 -05:00
Geoff Bourne a2251f23e1 Auto-merging via docker-versions-create 2021-10-15 18:51:30 -05:00
Geoff Bourne 6ef0da9a63 Auto-merging via docker-versions-create 2021-10-10 09:59:06 -05:00
Geoff Bourne 4321d2a7e6 Auto-merging via docker-versions-create 2021-10-09 15:28:15 -05:00
Geoff Bourne 639e0264c2 Auto-merging via docker-versions-create 2021-10-09 12:06:49 -05:00
Geoff Bourne 1c4db94b1b Auto-merging via docker-versions-create 2021-10-02 19:24:42 -05:00
Geoff Bourne f0cebe526a Auto-merging via docker-versions-create 2021-09-29 10:27:14 -05:00
Geoff Bourne 20b1477672 Auto-merging via docker-versions-create 2021-09-27 20:53:03 -05:00
Geoff Bourne c4b4997fac Auto-merging via docker-versions-create 2021-09-20 12:32:48 -05:00
Geoff Bourne d442f164ba Auto-merging via docker-versions-create 2021-09-15 21:33:29 -05:00
Geoff Bourne 34d4385ea6 Auto-merging via docker-versions-create 2021-09-15 21:11:04 -05:00
Geoff Bourne cc84e65979 Auto-merging via docker-versions-create 2021-09-15 20:39:44 -05:00
Geoff Bourne 6f5fcc42f9 Auto-merging via docker-versions-create 2021-08-30 21:40:08 -05:00
Geoff Bourne 071621b54a Auto-merging via docker-versions-create 2021-08-10 12:58:17 -05:00
Geoff Bourne 230a64af1b Auto-merging via docker-versions-create 2021-08-01 12:15:47 -05:00
Geoff Bourne 1f980edeb1 Auto-merging via docker-versions-create 2021-07-31 09:29:52 -05:00
Geoff Bourne 649263290f Auto-merging via docker-versions-create 2021-07-26 19:37:48 -05:00
Geoff Bourne 990de92dd7 Merge branch 'master' into java16-openj9 2021-07-25 18:22:02 -05:00
Geoff Bourne 4f15c244b2 Auto-merging via docker-versions-create 2021-07-25 09:39:28 -05:00
Geoff Bourne 5f9c8f53e4 Auto-merging via docker-versions-create 2021-07-23 21:29:47 -05:00
Geoff Bourne 57fee8b46d Auto-merging via docker-versions-create 2021-07-17 21:16:49 -05:00
Geoff Bourne 79face2d60 Auto-merging via docker-versions-create 2021-07-17 20:59:35 -05:00
Geoff Bourne ceec69391c Auto-merging via docker-versions-create 2021-07-17 18:06:45 -05:00
Geoff Bourne dfa5add6ba Auto-merging via docker-versions-create 2021-07-14 18:43:35 -05:00
Geoff Bourne 02677ce1e2 Auto-merging via docker-versions-create 2021-07-12 19:11:49 -05:00
Geoff Bourne 2902e13c61 Auto-merging via docker-versions-create 2021-07-09 20:00:33 -05:00
Geoff Bourne 6d01021a30 Auto-merging via docker-versions-create 2021-07-08 18:01:57 -05:00
Geoff Bourne 07ded28d20 Auto-merging via docker-versions-create 2021-07-08 08:06:08 -05:00
itzg a2d79fb85b Auto-merging via docker-versions-create 2021-07-08 12:56:12 +00:00
Geoff Bourne ecf9a090b1 Auto-merging via docker-versions-create 2021-07-08 07:41:13 -05:00
itzg 17a3aa8079 Auto-merging via docker-versions-create 2021-07-04 19:54:11 +00:00
Geoff Bourne 14fb905ec1 Auto-merging from master 2021-07-03 14:29:24 -05:00
Geoff Bourne 8629bf5cb5 ci: auto-merge from master 2021-07-02 16:06:34 -05:00
itzg f05891e475 Auto-merging via docker-versions-create 2021-07-02 16:56:06 +00:00
itzg f1453dd4c1 Auto-merging via docker-versions-create 2021-06-28 12:14:17 +00:00
itzg 22b560ba5d Auto-merging via docker-versions-create 2021-06-27 13:13:22 +00:00
itzg e3acafee2f Auto-merging via docker-versions-create 2021-06-24 12:47:16 +00:00
Geoff Bourne 03df627881 Auto-merging via docker-versions-create 2021-06-23 22:36:07 -05:00
Geoff Bourne d87e5bdaa2 Auto-merging via docker-versions-create 2021-06-20 12:51:26 -05:00
Geoff Bourne 2543a5417c Auto-merging via docker-versions-create 2021-06-05 17:55:19 -05:00
Geoff Bourne 614f6a4be0 Auto-merging via docker-versions-create 2021-05-24 20:53:08 -05:00
Geoff Bourne fe9735d8c1 Merge branch 'master' into java16-openj9 2021-05-23 12:27:35 -05:00
Geoff Bourne 10dcbe7b03 Merge from master 2021-05-22 13:47:41 -05:00
Geoff Bourne 85103cd8cf Auto-merging via docker-versions-create 2021-05-21 23:04:11 -05:00
Geoff Bourne 12915b04b7 Auto-merging via docker-versions-create 2021-05-21 22:53:22 -05:00
Geoff Bourne fbc8f72a22 ci: adjusted for adoptopenjdk for openj9 only on amd64 2021-05-21 16:49:29 -05:00
Geoff Bourne 7229c40202 Merge branch 'master' into java16-openj9
# Conflicts:
#	.github/workflows/build-multiarch.yml
#	Dockerfile
2021-05-21 16:46:51 -05:00
Geoff Bourne 581b514970 ci: added java16-openj9 branch
#885
2021-05-21 16:42:23 -05:00
Geoff Bourne d030daf354 Auto-merging via docker-versions-create 2021-05-19 20:30:40 -05:00
Geoff Bourne 98e6adbe1a Auto-merging via docker-versions-create 2021-05-15 12:43:32 -05:00
Geoff Bourne b94cfc44a0 Merge branch 'multiarch' into java15-openj9
# Conflicts:
#	.github/workflows/build-multiarch.yml
#	Dockerfile
2021-05-14 18:03:39 -05:00
Geoff Bourne 8a9e85fb17 Auto-merging via docker-versions-create 2021-05-06 20:17:17 -05:00
Geoff Bourne 8a39719427 Auto-merging via docker-versions-create 2021-04-30 14:30:25 -05:00
Geoff Bourne 4100aa1f61 Auto-merging via docker-versions-create 2021-04-30 11:14:31 -05:00
Geoff Bourne 4d5fe0a03b Auto-merging via docker-versions-create 2021-04-28 16:55:09 -05:00
Geoff Bourne 236bb565ce Auto-merging via docker-versions-create 2021-04-26 08:23:22 -05:00
Geoff Bourne 7608168823 Auto-merging via docker-versions-create 2021-04-24 13:44:55 -05:00
Geoff Bourne acabb9d93c Auto-merging via docker-versions-create 2021-04-23 21:05:53 -05:00
Geoff Bourne 4e9c00c4d5 Auto-merging via docker-versions-create 2021-04-18 13:32:45 -05:00
Geoff Bourne f3826422cf Auto-merging via docker-versions-create 2021-04-11 10:12:00 -05:00
Geoff Bourne 9b7459ad5c Merged latest from master 2021-04-08 19:28:35 -05:00
Geoff Bourne c9dc6012f6 Auto-merging via docker-versions-create 2021-04-01 16:40:16 -05:00
Geoff Bourne a5aec72837 Added git
#819
2021-04-01 16:29:06 -05:00
Geoff Bourne af38a8fc7a ci: removed armv7 build since 15-openj9 doesn't include it 2021-03-06 17:27:08 -06:00
Geoff Bourne 58fa3c897d Merge branch 'master' into java15-openj9 2021-03-06 17:23:02 -06:00
Geoff Bourne e45621d8e2 ci: Added java15-openj9 branch 2021-03-06 17:22:36 -06:00
25 changed files with 189 additions and 78 deletions
+2 -2
View File
@@ -68,7 +68,7 @@ jobs:
load: true
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
# no cache-to to avoid cross-cache update from next build step
- name: Run tests
# It is assumed that image variants are merged from master and tested there
@@ -81,7 +81,7 @@ jobs:
uses: docker/build-push-action@v2.7.0
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
# ensure latest base image is used
+2 -2
View File
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17-jdk
FROM adoptopenjdk:16-jdk-openj9
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
@@ -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.9.10
ARG MC_HELPER_VERSION=1.10.0
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \
+23 -14
View File
@@ -134,7 +134,7 @@ By default, the container will download the latest version of the "vanilla" [Min
* [Running on RaspberryPi](#running-on-raspberrypi)
* [Contributing](#contributing)
<!-- Added by: runner, at: Tue Dec 7 03:43:47 UTC 2021 -->
<!-- Added by: runner, at: Sat Dec 11 22:09:10 UTC 2021 -->
<!--te-->
@@ -846,30 +846,35 @@ values.
> **NOTE** it is very important to set this with servers exposed to the internet where you want only limited players to join.
To whitelist players for your Minecraft server, pass the Minecraft usernames separated by commas via the `WHITELIST` environment variable, such as
To whitelist players for your Minecraft server, you can:
- Provide the url or path to a whitelist file via `WHITELIST_FILE` environment variable
`docker run -d -e WHITELIST_FILE=/extra/whitelist.json ...`
- Provide a list of usernames and/or UUIDs separated by commas via the `WHITELIST` environment variable
`docker run -d -e WHITELIST=user1,uuid2 ...`
docker run -d -e WHITELIST=user1,user2 ...
To enforce the whitelist and auto-kick players not included in whitelist configuration, set `ENFORCE_WHITELIST=TRUE`. **By default** any user can join your Minecraft server if it's publicly accessible, regardless of your whitelist configuration.
or
If whitelist configuration already exists, `WHITELIST_FILE` will not be retrieved and any usernames in `WHITELIST` are **added** to the whitelist configuration. You can enforce regeneration of the whitelist on each server startup by setting `OVERRIDE_WHITELIST` to "true". This will delete the whitelist file before processing whitelist configuration.
docker run -d -e WHITELIST=uuid1,uuid2 ...
> NOTE: You can provide both `WHITELIST_FILE` and `WHITELIST`, which are processed in that order.
If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible.
> NOTE: UUIDs passed via `WHITELIST` need to be the dashed variant, otherwise it not be recognised and instead added as a username.
> NOTE: When using uuids in the whitelist, please make sure it is the dashed variant otherwise it will not parse correctly.
> If running Minecraft 1.7.5 or earlier, these variables will apply to `white-list.txt`, with 1.7.6 implementing support for `whitelist.json`. Make sure your `WHITELIST_FILE` is in the appropriate format.
> NOTE: When `WHITELIST` is used the server properties `white-list` and `whitelist` will automatically get set to `true`.
If either `WHITELIST_FILE` or `WHITELIST` is provided, the server property `white-list` is automatically set to `true`, enabline whitelist functionality. Alternatively you can set `ENABLE_WHITELIST=TRUE` to only set the server property `white-list` without modifying the whitelist file. In this case the whitelist can be managed using the `whitelist add` and `whitelist remove` commands. Remember you can set enforcement via the `ENFORCE_WHITELIST` variable.
> By default, the players in `WHITELIST` are **added** to the final `whitelist.json` file by the Minecraft server. If you set `OVERRIDE_WHITELIST` to "true" then the `whitelist.json` file will be recreated on each server startup.
Alternatively, you can set `ENABLE_WHITELIST=true` to only set the server properties `white-list` and `whitelist` without modifying the whitelist file. In this case the whitelist is solely managed using the `whitelist add` and `whitelist remove` commands.
### Op/Administrator Players
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
Similar to the whitelist, to add users as operators (aka adminstrators) to your Minecraft server, you can:
- Provide te url or path to an ops file via `OPS_FILE` environment variable
`docker run -d -e OPS_FILE=https://config.example.com/extra/ops.json ...`
- Provide a list of usernames and/or UUIDs separated by commas via the `OPS` environment variable
`docker run -d -e OPS=user1,uuid2 ...`
docker run -d -e OPS=user1,user2 ...
If ops configuration already exists, `OPS_FILE` will not be retrieved and any usernames in `OPS` are **added** to the ops configuration. You can enforce regeneration of the ops configuration on each server startup by setting `OVERRIDE_OPS` to "true". This will delete the ops file before processing ops configuration.
> By default, the players in `OPS` are **added** to the final `ops.json` file by the Minecraft server. If you set `OVERRIDE_OPS` to "true" then the `ops.json` file will be recreated on each server startup.
> Similar to whitelists, you can provide both `OPS_FILE` and `OPS`, and Minecraft 1.7.5 or earlier will use `ops.txt` rather than `ops.json`.
### Server icon
@@ -1327,6 +1332,8 @@ If you would like to `docker attach` to the Minecraft server console with color
> This will bypass graceful server shutdown handling when using `docker stop`, so be sure the server console's `stop` command.
>
> Make to enable stdin and tty with `-it` when using `docker run` or `stdin_open: true` and `tty: true` when using docker compose.
>
> This feature is incompatible with Autopause and cannot be set when `ENABLE_AUTOPAUSE=true`.
### Server Shutdown Options
@@ -1444,6 +1451,8 @@ Enable the Autopause functionality by setting:
-e ENABLE_AUTOPAUSE=TRUE
```
Autopause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.
The following environment variables define the behaviour of auto-pausing:
* `AUTOPAUSE_TIMEOUT_EST`, default `3600` (seconds)
describes the time between the last client disconnect and the pausing of the process (read as timeout established)
+25
View File
@@ -130,3 +130,28 @@ EOL
fi
done
if [[ $tag ]]; then
if [ -f "$HOME/.github.env" ]; then
source "$HOME/.github.env"
if [[ $GITHUB_TOKEN ]]
then
auth=(-u ":$GITHUB_TOKEN")
base=https://api.github.com
: "${owner:=itzg}"
: "${repo:=docker-minecraft-server}"
read -r -d '' releaseBody << EOF
{
"tag_name": "$tag",
"name": "$tag",
"generate_release_notes": true
}
EOF
if ! echo curl "${auth[@]}" -H "Accept: application/vnd.github.v3+json" \
"${base}/repos/${owner}/${repo}/releases" -d "$releaseBody"; then
echo "ERROR failed to create github release $tag"
exit 1
fi
fi
fi
fi
+4
View File
@@ -32,6 +32,10 @@ if [ ! -e /data/eula.txt ]; then
writeEula
fi
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${EXEC_DIRECTLY:-false}"; then
log "EXEC_DIRECTLY=true is incompatible with ENABLE_AUTOPAUSE=true"
exit 1
fi
if [[ $PROXY ]]; then
export http_proxy="$PROXY"
+10 -2
View File
@@ -1,10 +1,11 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
. ${SCRIPTS:-/}start-utils
set -euo pipefail
isDebugging && set -x
IFS=$'\n\t'
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] && [ "${VERSION}" != "PURPUR-1.16" ] ; then
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=1.16, VERSION=PURPUR or VERSION=PURPUR-1.16. Note that these are branches, not #.#.# versions."
exit 1
@@ -35,6 +36,12 @@ log "Using Airplane-${AIRPLANE_BRANCH} branch"
export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar
log "Removing old Airplane versions ..."
shopt -s nullglob
for f in airplane-*.jar; do
[[ $f != $SERVER ]] && rm $f
done
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-${AIRPLANE_TYPE}.jar"
log "Downloading Airplane from $downloadUrl ..."
@@ -47,6 +54,7 @@ fi
# Normalize on Spigot for later operations
export TYPE=SPIGOT
export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@"
+1
View File
@@ -127,6 +127,7 @@ fi
# Normalize on Spigot for operations below
export TYPE=SPIGOT
export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@"
+1
View File
@@ -233,4 +233,5 @@ elif [ -e "${FTB_DIR}/Install.sh" ]; then
popd
fi
export FAMILY=FORGE
exec "${SCRIPTS:-/}start-setupWorld" "$@"
+1
View File
@@ -44,6 +44,7 @@ fi
# Normalize on Spigot for later operations
export TYPE=SPIGOT
export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@"
+1
View File
@@ -28,5 +28,6 @@ fi
export SKIP_LOG4J_CONFIG=true
export FAMILY=HYBRID
# Continue to Final Setup
exec ${SCRIPTS:-/}start-setupWorld "$@"
+1
View File
@@ -56,5 +56,6 @@ fi
export SERVER
export SKIP_LOG4J_CONFIG=true
export FAMILY=HYBRID
exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"
+1 -1
View File
@@ -31,5 +31,5 @@ else
fi
export SKIP_LOG4J_CONFIG=true
export FAMILY=HYBRID
exec ${SCRIPTS:-/}start-setupWorld $@
+1
View File
@@ -79,4 +79,5 @@ if ! [ -v SERVER ]; then
exit 2
fi
export FAMILY=FORGE
exec ${SCRIPTS:-/}start-setupWorld $@
+1
View File
@@ -69,4 +69,5 @@ if [[ ! -e ${SERVER} ]]; then
mv fabric-server-launch.jar "${SERVER}"
fi
export FAMILY=FABRIC
exec ${SCRIPTS:-/}start-setupWorld "$@"
+1
View File
@@ -147,4 +147,5 @@ else
fi
fi
export FAMILY=FORGE
exec "${SCRIPTS:-/}start-setupWorld" "$@"
+1
View File
@@ -60,4 +60,5 @@ export LEVEL
export SKIP_LOG4J_CONFIG=true
export FAMILY=LIMBO
exec ${SCRIPTS:-/}start-setupWorld $@
+2 -1
View File
@@ -89,4 +89,5 @@ else
fi
fi
exec ${SCRIPTS:-/}start-setupWorld $@
export FAMILY=HYBRID
exec ${SCRIPTS:-/}start-setupWorld "$@"
+1
View File
@@ -40,4 +40,5 @@ fi
export SKIP_LOG4J_CONFIG=true
export FAMILY=HYBRID
exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"
+1
View File
@@ -74,6 +74,7 @@ fi
# Normalize on Spigot for downstream operations
export TYPE=SPIGOT
export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@"
+1
View File
@@ -32,6 +32,7 @@ fi
# Normalize on Spigot for later operations
export TYPE=SPIGOT
export FAMILY=SPIGOT
export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@"
+2 -1
View File
@@ -37,4 +37,5 @@ if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
fi
exec ${SCRIPTS:-/}start-setupWorld $@
export FAMILY=SPONGE
exec ${SCRIPTS:-/}start-setupWorld "$@"
+1 -1
View File
@@ -52,5 +52,5 @@ elif [[ -L /data/minecraft_server.jar ]]; then
fi
isDebugging && ls -l
export FAMILY=VANILLA
exec "${SCRIPTS:-/}start-setupWorld" "$@"
+86 -19
View File
@@ -3,28 +3,93 @@
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
if [ -n "$OPS" ]; then
log "Updating ops"
rm -f /data/ops.txt.converted
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
fi
if isTrue "${OVERRIDE_OPS}"; then
log "Recreating ops.json file at server startup"
rm -f /data/ops.json
if versionLessThan 1.7.6; then
opsFile=ops.txt
whitelistFile=white-list.txt
else
opsFile=ops.json
whitelistFile=whitelist.json
fi
if [ -n "$WHITELIST" ]; then
log "Updating whitelist"
rm -f /data/white-list.txt.converted
if [[ $WHITELIST == *"-"* ]]; then
echo $WHITELIST | awk -v RS=, '{print}' | xargs -l -i curl -s https://playerdb.co/api/player/minecraft/{} | jq -r '.["data"]["player"] | {"uuid": .id, "name": .username}' | jq -s . > "whitelist.json"
function process_user_file() {
local output=$1
local source=$2
if isURL "$source"; then
log "Downloading $output from $source"
if ! get -o /data/$output "$source"; then
log "ERROR: failed to download from $source"
exit 2
fi
else
echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt
log "Copying $output from $source"
if ! cp "$source" /data/$output; then
log "ERROR: failed to copy from $source"
exit 1
fi
fi
}
function process_user_csv() {
local output=$1
local list=$2
local playerDataList
if [[ "$output" == *"ops"* ]]; then
# Extra data for ops.json
userData='{"uuid": .id, "name": .username, "level": 4}'
else
userData='{"uuid": .id, "name": .username}'
fi
log "Updating ${output%.*}"
for i in ${list//,/ }
do
if [ -e "$output" ] && grep -q "$i" "$output"; then
log "$i already present in $output, skipping"
continue
fi
if ! playerData=$(get "https://playerdb.co/api/player/minecraft/$i" | jq -re ".data.player"); then
log "WARNING: Could not lookup user $i for ${output} addition"
else
playerDataList=$playerDataList$(echo $playerData | jq -r "$userData")
fi
done
local newUsers=$(echo $playerDataList | jq -s .)
if [[ $output =~ .*\.txt ]]; then
# username list for txt config (Minecraft <= 1.7.5)
echo $newUsers | jq -r '.[].name' >> /data/${output}
sort -u /data/${output} -o /data/${output}
elif [ -e /data/${output} ]; then
# Merge with existing json file
local currentUsers=$(cat /data/${output})
jq --argjson current "$currentUsers" --argjson new "$newUsers" -n '$new + $current | unique_by(.uuid)' > /data/${output}
else
# New json file
echo $newUsers > /data/${output}
fi
}
if isTrue "${OVERRIDE_OPS}"; then
log "Recreating ${opsFile} file at server startup"
rm -f /data/${opsFile}
fi
if [ -n "${OPS_FILE}" ] && [ ! -e "/data/${opsFile}" ]; then
process_user_file ${opsFile} "$OPS_FILE"
fi
if [ -n "${OPS}" ]; then
process_user_csv ${opsFile} "$OPS"
fi
if isTrue "${OVERRIDE_WHITELIST}"; then
log "Recreating whitelist.json file at server startup"
rm -f /data/whitelist.json
log "Recreating ${whitelistFile} file at server startup"
rm -f /data/${whitelistFile}
fi
if [ -n "${WHITELIST_FILE}" ] && [ ! -e "/data/${whitelistFile}" ]; then
process_user_file ${whitelistFile} "$WHITELIST_FILE"
fi
if [ -n "${WHITELIST}" ]; then
process_user_csv ${whitelistFile} "$WHITELIST"
fi
if [ -n "$ICON" ]; then
@@ -96,10 +161,12 @@ patchLog4jConfig() {
}
# Patch Log4j remote code execution vulnerability
# NOTE: Paper, bukkit, and spigot are normalized to SPIGOT
if [[ ${TYPE^^} != SPIGOT ]] && versionLessThan 1.12; then
# See https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition
if versionLessThan 1.7; then
: # No patch required here.
elif isFamily VANILLA && versionLessThan 1.12; then
patchLog4jConfig log4j2_17-111.xml https://launcher.mojang.com/v1/objects/dd2b723346a8dcd48e7f4d245f6bf09e98db9696/log4j2_17-111.xml
elif [[ ${TYPE^^} != SPIGOT ]] && versionLessThan 1.17; then
elif isFamily VANILLA && versionLessThan 1.17; then
patchLog4jConfig log4j2_112-116.xml https://launcher.mojang.com/v1/objects/02937d122c86ce73319ef9975b58896fc1b491d1/log4j2_112-116.xml
elif versionLessThan 1.18.1; then
JVM_OPTS="-Dlog4j2.formatMsgNoLookups=true ${JVM_OPTS}"
+8 -6
View File
@@ -33,15 +33,18 @@ function setServerProp {
}
function customizeServerProps {
if [ -n "$WHITELIST" ] || isTrue "${ENABLE_WHITELIST:-false}"; then
log "Creating whitelist"
setServerPropValue "whitelist" "true"
# Whitelist processing
if [ -n "$WHITELIST" ] || [ -n "$WHITELIST_FILE" ] || isTrue "${ENABLE_WHITELIST:-false}"; then
log "Enabling whitelist functionality"
setServerPropValue "white-list" "true"
else
log "Disabling whitelist"
setServerPropValue "whitelist" "false"
log "Disabling whitelist functionality"
setServerPropValue "white-list" "false"
fi
setServerProp "enforce-whitelist" ENFORCE_WHITELIST
if [[ $(grep "enforce-whitelist" $SERVER_PROPERTIES) != *true ]]; then
log "WARNING: whitelist enabled but not enforced. Set ENFORCE_WHITELIST=TRUE or update 'enforce-whitelist' in server.properties to enforce the whitelist."
fi
# If not provided, generate a reasonable default message-of-the-day,
# which shows up in the server listing in the client
@@ -104,7 +107,6 @@ function customizeServerProps {
setServerProp "op-permission-level" OP_PERMISSION_LEVEL
setServerProp "prevent-proxy-connections" PREVENT_PROXY_CONNECTIONS
setServerProp "use-native-transport" USE_NATIVE_TRANSPORT
setServerProp "enforce-whitelist" ENFORCE_WHITELIST
setServerProp "simulation-distance" SIMULATION_DISTANCE
setServerPropValue "motd" "$(echo "$MOTD" | mc-image-helper asciify)"
[[ $LEVEL_TYPE ]] && setServerPropValue "level-type" "${LEVEL_TYPE^^}"
+11 -29
View File
@@ -112,34 +112,7 @@ function normalizeMemSize() {
}
function versionLessThan() {
local activeParts
version=${VANILLA_VERSION%%-*} # for snapshot/rc versions
version=${version##b} # for versions like b1.7.3
IFS=. read -ra activeParts <<<"${version}"
local givenParts
IFS=. read -ra givenParts <<<"$1"
if ((${#activeParts[@]} < 2)); then
return 1
fi
if ((${#activeParts[@]} == 2)); then
if ((activeParts[0] < givenParts[0])) ||
((activeParts[0] == givenParts[0] && activeParts[1] < givenParts[1])); then
return 0
else
return 1
fi
else
if ((activeParts[0] < givenParts[0])) ||
((activeParts[0] == givenParts[0] && activeParts[1] < givenParts[1])) ||
((activeParts[0] == givenParts[0] && activeParts[1] == givenParts[1] && activeParts[2] < givenParts[2])); then
return 0
else
return 1
fi
fi
mc-image-helper compare-versions "${VANILLA_VERSION}" lt "${1?}"
}
requireVar() {
@@ -163,7 +136,7 @@ requireEnum() {
fi
done
log "ERROR: $var must be set to one of $@"
log "ERROR: $var must be set to one of $*"
# exit 1
}
@@ -189,4 +162,13 @@ function get() {
flags+=("--debug")
fi
mc-image-helper "${flags[@]}" get "$@"
}
function isFamily() {
for f in "${@}"; do
if [[ $FAMILY == "$f" ]]; then
return 0
fi
done
return 1
}