commit c717b3d14c608a5e85563d0ebf4ed0f9714f28b5 from: xs date: Tue Jan 30 17:27:03 2024 UTC In the process of fixing whitelisting commit - 5c2b78f6a8717367294a69c8c39532681130d83b commit + c717b3d14c608a5e85563d0ebf4ed0f9714f28b5 blob - 849a2d3c3bf70d625b361aa41f8d3b09cbff63fd blob + 02d9e6e5ea3ddb0bb8445d0d51a433747245356f --- http-ban.sh +++ http-ban.sh @@ -28,12 +28,6 @@ access() { doas /usr/bin/zcat /var/www/logs/access.log.*gz 2>/dev/null } -apply_whitelist() { - GF=$(for ip in $(printf %s\\n $QUICK_WHITELIST); do printf -- '-ve "%s" ' "$ip"; done) - GF=${GF:-'.*'} - grep $GF -} - limit() { awk -vtrig="${1:-10}" ' $1 >= trig { print $2 }' } @@ -45,7 +39,9 @@ pre_block() { } block() { - pre_block | sort | uniq | apply_whitelist + GF=$(for ip in $(printf %s\\n $QUICK_WHITELIST); do printf -- '-e "^%s$" ' "$ip"; done) + GF=${GF:-'.*'} + pre_block | sort | uniq | grep $GF } umask 127