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
This commit is contained in:
Geoff Bourne authored and GitHub committed 2023-07-13 22:20:01 -05:00
1 parent e421ad2ca6
commit a77ed28d69
2 files changed
+11 -9

No files matched your search

+1 -1
View File
@@ -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
+10 -8
View File
@@ -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