mirror of
https://github.com/openwrt/packages.git
synced 2026-06-17 14:50:07 +04:00
banip: update 1.8.0-3
* support the new possible nft expiry options in the backend as well Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=banip
|
||||
PKG_VERSION:=1.8.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=3
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ Available commands:
|
||||
| ban_nftloglevel | option | warn | nft loglevel, values: emerg, alert, crit, err, warn, notice, info, debug |
|
||||
| ban_nftpriority | option | -100 | nft priority for the banIP table (the prerouting table is fixed to priority -150) |
|
||||
| ban_nftpolicy | option | memory | nft policy for banIP-related Sets, values: memory, performance |
|
||||
| ban_nftexpiry | option | - | expiry time for auto added blocklist members, e.g. '5m', '2h' or '1d' |
|
||||
| ban_nftexpiry | option | - | expiry time (ms|s|m|h|d|w) for auto added blocklist members, e.g. '5m', '2h' or '1d' |
|
||||
| ban_nftretry | option | 5 | number of Set load attempts in case of an error |
|
||||
| ban_nftcount | option | 0 | enable nft counter for every Set element |
|
||||
| ban_bcp38 | option | 0 | block packets with spoofed source IP addresses in all supported chains |
|
||||
|
||||
@@ -2153,8 +2153,10 @@ f_mail() {
|
||||
# log monitor
|
||||
#
|
||||
f_monitor() {
|
||||
local daemon logread_cmd loglimit_cmd logread_filter nft_expiry line ip_proto ip proto log_count idx base cidr rdap_log rdap_rc rdap_idx rdap_info
|
||||
local logread_cmd loglimit_cmd logread_filter nft_expiry line ip_proto ip proto log_count idx base cidr rdap_log rdap_rc rdap_idx rdap_info
|
||||
|
||||
# log reading configuration
|
||||
#
|
||||
if [ -f "${ban_logreadfile}" ] && [ -x "${ban_logreadcmd}" ] && [ "${ban_logreadcmd##*/}" = "tail" ]; then
|
||||
logread_cmd="${ban_logreadcmd} -qf ${ban_logreadfile} 2>/dev/null"
|
||||
loglimit_cmd="${ban_logreadcmd} -qn ${ban_loglimit} ${ban_logreadfile} 2>/dev/null"
|
||||
@@ -2165,9 +2167,13 @@ f_monitor() {
|
||||
logread_filter=""
|
||||
fi
|
||||
|
||||
# start log monitoring
|
||||
#
|
||||
if [ -n "${logread_cmd}" ] && [ -n "${loglimit_cmd}" ] && [ -n "${ban_logterm}" ] && [ "${ban_loglimit}" != "0" ]; then
|
||||
f_log "info" "start detached banIP log service (${ban_logreadcmd})"
|
||||
[ -n "${ban_nftexpiry}" ] && nft_expiry="timeout $(printf "%s" "${ban_nftexpiry}" | "${ban_grepcmd}" -oE "([0-9]+[d|h|m|s])+$")"
|
||||
if printf "%s" "${ban_nftexpiry}" | grep -qE '^([1-9][0-9]*(ms|s|m|h|d|w))+$'; then
|
||||
nft_expiry="timeout ${ban_nftexpiry}"
|
||||
fi
|
||||
|
||||
# retrieve/cache current allowlist/blocklist content
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user