From a77ed28d69f89d48b84c774823585f86e8bfea0d Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 13 Jul 2023 22:20:01 -0500 Subject: [PATCH] Format allowlist.json exactly like command does (#337) Also * box64 package now needs to be qualified by platform * Default ALLOW_LIST to false when ALLOW_LIST_USERS not used --- Dockerfile | 2 +- bedrock-entry.sh | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index f3a26e0..5280403 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN if [ "$TARGETARCH" = "arm64" ] ; then \ curl -L https://ryanfortner.github.io/box64-debs/box64.list -o /etc/apt/sources.list.d/box64.list && \ curl -L https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg && \ apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y box64 \ + DEBIAN_FRONTEND=noninteractive apt-get install -y box64-generic-arm \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* ;\ fi diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 0be1f75..ad9404f 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -169,16 +169,18 @@ allowListUsers=${ALLOW_LIST_USERS:-${WHITE_LIST_USERS}} if [ -n "$allowListUsers" ]; then echo "Setting allow list" - for f in whitelist.json allowlist.json; do - if [ -f $f ]; then - rm -rf $f - fi - jq -n --arg users "$allowListUsers" '$users | split(",") | map({"name": .})' > $f - done + f=allowlist.json + rm -rf "$f" + jq -c -n --arg users "$allowListUsers" '$users | split(",") | map({"ignoresPlayerLimit":false,"name": .})' > "$f" # activate server property to enable list usage - export WHITE_LIST=true - export ALLOW_LIST=true + WHITE_LIST=true + ALLOW_LIST=true +else + rm -rf whitelist.json allowlist.json + : "${WHITE_LIST:=false}" + : "${ALLOW_LIST:=false}" fi +export WHITE_LIST ALLOW_LIST set-property --file server.properties --bulk /etc/bds-property-definitions.json