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
+9 -6
+9 -6
View File
@@ -165,9 +165,11 @@ if [ -n "$OPS" ] || [ -n "$MEMBERS" ] || [ -n "$VISITORS" ]; then
]| flatten' > permissions.json ]| flatten' > permissions.json
fi fi
allowListUsers=${ALLOW_LIST_USERS:-${WHITE_LIST_USERS}}
if [ -n "$allowListUsers" ]; then if [[ -v ALLOW_LIST_USERS || -v WHITE_LIST_USERS ]]; then
allowListUsers=${ALLOW_LIST_USERS:-${WHITE_LIST_USERS}}
if [[ $allowListUsers ]]; then
echo "Setting allow list" echo "Setting allow list"
f=allowlist.json f=allowlist.json
rm -rf "$f" rm -rf "$f"
@@ -175,12 +177,13 @@ if [ -n "$allowListUsers" ]; then
# activate server property to enable list usage # activate server property to enable list usage
WHITE_LIST=true WHITE_LIST=true
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
export WHITE_LIST ALLOW_LIST
fi fi
export WHITE_LIST ALLOW_LIST
set-property --file server.properties --bulk /etc/bds-property-definitions.json set-property --file server.properties --bulk /etc/bds-property-definitions.json