From 88e64a2ae488e1cd8d4d539c6d976c9ccc728d2f Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sat, 8 Jul 2023 19:51:52 +0200 Subject: [PATCH] banip: update 0.8.9-3 * prevent superflous etag function calls during start action (on start backups will be used anyway) * changed the ipthreat feed download URL (load a compressed file variant to save bandwidth) Signed-off-by: Dirk Brenken --- net/banip/Makefile | 2 +- net/banip/files/banip-functions.sh | 5 +++-- net/banip/files/banip.feeds | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/net/banip/Makefile b/net/banip/Makefile index 4be2afd695..ebc88007d5 100644 --- a/net/banip/Makefile +++ b/net/banip/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=banip PKG_VERSION:=0.8.9 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Dirk Brenken diff --git a/net/banip/files/banip-functions.sh b/net/banip/files/banip-functions.sh index 1fa1578d65..ad642ee129 100644 --- a/net/banip/files/banip-functions.sh +++ b/net/banip/files/banip-functions.sh @@ -582,7 +582,7 @@ f_nftinit() { # handle downloads # f_down() { - local log_input log_forwardwan log_forwardlan start_ts end_ts tmp_raw tmp_load tmp_file split_file ruleset_raw handle rc etag_rc="0" + local log_input log_forwardwan log_forwardlan start_ts end_ts tmp_raw tmp_load tmp_file split_file ruleset_raw handle rc etag_rc local cnt_set cnt_dl restore_rc feed_direction feed_rc feed_log feed="${1}" proto="${2}" feed_url="${3}" feed_rule="${4}" feed_flag="${5}" start_ts="$(date +%s)" @@ -648,7 +648,8 @@ f_down() { # restore local backups # if { [ "${ban_action}" != "reload" ] || [ "${feed_url}" = "local" ] || [ -n "${ban_etagparm}" ]; } && [ "${feed%v*}" != "allowlist" ] && [ "${feed%v*}" != "blocklist" ]; then - if [ -n "${ban_etagparm}" ] && [ "${feed_url}" != "local" ]; then + if [ -n "${ban_etagparm}" ] && [ "${ban_action}" = "reload" ] && [ "${feed_url}" != "local" ]; then + etag_rc="0" if [ "${feed%v*}" = "country" ]; then for country in ${ban_country}; do f_etag "${feed}" "${feed_url}${country}-aggregated.zone" ".${country}" diff --git a/net/banip/files/banip.feeds b/net/banip/files/banip.feeds index d54f2de498..cfe1a70cc6 100644 --- a/net/banip/files/banip.feeds +++ b/net/banip/files/banip.feeds @@ -158,9 +158,10 @@ "descr": "blackhole IP blocklist" }, "ipthreat":{ - "url_4": "https://lists.ipthreat.net/file/ipthreat-lists/threat/threat-30.txt", + "url_4": "https://lists.ipthreat.net/file/ipthreat-lists/threat/threat-30.txt.gz", "rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)[-[:space:]]?/{printf \"%s,\\n\",$1}", - "descr": "hacker and botnet IPs" + "descr": "hacker and botnet IPs", + "flag": "gz" }, "myip":{ "url_4": "https://myip.ms/files/blacklist/general/latest_blacklist.txt", -- 2.30.2