Only remove allowlist.json when ALLOW_LIST_USERS is set to empty string (#338)

This commit is contained in:
Geoff Bourne authored and GitHub committed 2023-07-14 07:43:49 -05:00
1 parent a77ed28d69
commit 8756c97fab
1 file changed
+6 -3
+6 -3
View File
@@ -165,9 +165,11 @@ if [ -n "$OPS" ] || [ -n "$MEMBERS" ] || [ -n "$VISITORS" ]; then
]| flatten' > permissions.json ]| flatten' > permissions.json
fi fi
if [[ -v ALLOW_LIST_USERS || -v WHITE_LIST_USERS ]]; then
allowListUsers=${ALLOW_LIST_USERS:-${WHITE_LIST_USERS}} allowListUsers=${ALLOW_LIST_USERS:-${WHITE_LIST_USERS}}
if [ -n "$allowListUsers" ]; then if [[ $allowListUsers ]]; then
echo "Setting allow list" echo "Setting allow list"
f=allowlist.json f=allowlist.json
rm -rf "$f" rm -rf "$f"
@@ -177,10 +179,11 @@ if [ -n "$allowListUsers" ]; then
ALLOW_LIST=true ALLOW_LIST=true
else else
rm -rf whitelist.json allowlist.json rm -rf whitelist.json allowlist.json
: "${WHITE_LIST:=false}" WHITE_LIST=false
: "${ALLOW_LIST:=false}" ALLOW_LIST=false
fi fi
export WHITE_LIST ALLOW_LIST export WHITE_LIST ALLOW_LIST
fi
set-property --file server.properties --bulk /etc/bds-property-definitions.json set-property --file server.properties --bulk /etc/bds-property-definitions.json