Fix: Improve firewall configuration based on code review
- Remove redundant subdomain entries (www.gnu.org, ftp.gnu.org) already covered by *.gnu.org wildcard - Improve error handling in setup-firewall.sh - fail explicitly on JSON parse errors instead of silently continuing - Better error messages for troubleshooting configuration issues Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
"allowlist": {
|
||||
"domains": [
|
||||
"*.gnu.org",
|
||||
"www.gnu.org",
|
||||
"ftp.gnu.org",
|
||||
"fsf.org",
|
||||
"www.fsf.org",
|
||||
"spdx.org",
|
||||
|
||||
@@ -19,7 +19,10 @@ if [ ! -f "$ALLOWLIST_FILE" ]; then
|
||||
fi
|
||||
|
||||
# Read domains from the allowlist configuration
|
||||
DOMAINS=$(jq -r '.allowlist.domains[]' "$ALLOWLIST_FILE" 2>/dev/null || echo "")
|
||||
if ! DOMAINS=$(jq -r '.allowlist.domains[]' "$ALLOWLIST_FILE" 2>&1); then
|
||||
echo "ERROR: Failed to parse allowlist configuration: $DOMAINS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$DOMAINS" ]; then
|
||||
echo "WARNING: No domains found in allowlist configuration"
|
||||
|
||||
Reference in New Issue
Block a user