From 45ead46ff465626b65420384fd47d9e89abfcfe8 Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 29 Nov 2021 16:59:16 +0000 Subject: [PATCH 1/2] Update start-finalExec Added a check to see if WHITELIST contains a "-", if it does then parse it as a list of UUIDs rather than normal Usernames --- scripts/start-finalExec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/start-finalExec b/scripts/start-finalExec index 1112f104bc3..519883e9613 100755 --- a/scripts/start-finalExec +++ b/scripts/start-finalExec @@ -16,7 +16,11 @@ fi if [ -n "$WHITELIST" ]; then log "Updating whitelist" rm -f /data/white-list.txt.converted - echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt + 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" + else + echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt + fi fi if isTrue "${OVERRIDE_WHITELIST}"; then log "Recreating whitelist.json file at server startup" From 7684a5f2d6c0faf76ecebf4b0a3120fc60657fe7 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 30 Nov 2021 18:57:31 +0000 Subject: [PATCH 2/2] Updated Whitelist Section - Includes warning to use dashed uuid variant and command example --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 068c701a3be..a5568e77773 100644 --- a/README.md +++ b/README.md @@ -846,8 +846,14 @@ To whitelist players for your Minecraft server, pass the Minecraft usernames sep docker run -d -e WHITELIST=user1,user2 ... +or + + docker run -d -e WHITELIST=uuid1,uuid2 ... + If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible. +> NOTE: When using uuids in the whitelist, please make sure it is the dashed variant otherwise it will not parse correctly. + > NOTE: When `WHITELIST` is used the server properties `white-list` and `whitelist` will automatically get set to `true`. > 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.