diff --git a/README.md b/README.md index e011bb6..7a70123 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,8 @@ There are two ways to handle a whitelist. The first is to set the `WHITE_LIST` e -e WHITE_LIST_USERS="player1,player2,player3" ``` +> Starting with 1.16.230.50, `ALLOW_LIST`, `ALLOW_LIST_USERS`, and the file `allowlist.json` will be used instead. + ## More information For more information about managing Bedrock Dedicated Servers in general, [check out this Reddit post](https://old.reddit.com/user/ProfessorValko/comments/9f438p/bedrock_dedicated_server_tutorial/). diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 5c16880..b117372 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -115,12 +115,19 @@ if [ -n "$OPS" ] || [ -n "$MEMBERS" ] || [ -n "$VISITORS" ]; then ]| flatten' > permissions.json fi -if [ -n "$WHITE_LIST_USERS" ]; then - echo "Setting whitelist" - rm -rf whitelist.json - jq -n --arg users "$WHITE_LIST_USERS" '$users | split(",") | map({"name": .})' > whitelist.json - # flag whitelist to true so the server properties process correctly +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 + jq -n --arg users "$allowListUsers" '$users | split(",") | map({"name": .})' > $f + fi + done + # activate server property to enable list usage export WHITE_LIST=true + export ALLOW_LIST=true fi set-property --file server.properties --bulk /etc/bds-property-definitions.json diff --git a/property-definitions.json b/property-definitions.json index 8cc84e4..ae21882 100644 --- a/property-definitions.json +++ b/property-definitions.json @@ -51,6 +51,10 @@ "env": "WHITE_LIST", "allowed": ["true","false"] }, + "allow-list": { + "env": "ALLOW_LIST", + "allowed": ["true","false"] + }, "view-distance": { "env": "VIEW_DISTANCE" },