From 50a1c68afde811ea09da1d40c111d1d8cbcff007 Mon Sep 17 00:00:00 2001 From: gSpot Date: Sun, 15 Dec 2024 16:39:24 +0300 Subject: [PATCH] Updated: blacklist_sources, fqdn_filter. Minor fixes. --- autoinstall/2.x/autoinstall.sh | 6 +++--- luci-app-ruantiblock/Makefile | 2 +- .../resources/view/ruantiblock/settings.js | 2 +- ruantiblock-mod-lua/Makefile | 2 +- .../usr/libexec/ruantiblock/ruab_parser.lua | 2 +- ruantiblock-mod-py/Makefile | 2 +- ruantiblock/Makefile | 4 ++-- ruantiblock/files/etc/ruantiblock/fqdn_filter | 2 ++ .../files/etc/ruantiblock/gr_excluded_sld | 1 + ruantiblock/files/usr/bin/ruantiblock | 20 +++++++++++++++++-- .../usr/share/ruantiblock/blacklist_sources | 3 ++- 11 files changed, 33 insertions(+), 13 deletions(-) diff --git a/autoinstall/2.x/autoinstall.sh b/autoinstall/2.x/autoinstall.sh index e1c987a..2b31dac 100755 --- a/autoinstall/2.x/autoinstall.sh +++ b/autoinstall/2.x/autoinstall.sh @@ -10,9 +10,9 @@ LUCI_APP=1 HTTPS_DNS_PROXY=1 OWRT_VERSION="current" -RUAB_VERSION="2.1.1-r2" -RUAB_MOD_LUA_VERSION="2.1.1-r1" -RUAB_LUCI_APP_VERSION="2.1.1-1" +RUAB_VERSION="2.1.2-r1" +RUAB_MOD_LUA_VERSION="2.1.2-r1" +RUAB_LUCI_APP_VERSION="2.1.2-r1" BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master" PKG_DIR="/tmp" diff --git a/luci-app-ruantiblock/Makefile b/luci-app-ruantiblock/Makefile index b973969..623d874 100644 --- a/luci-app-ruantiblock/Makefile +++ b/luci-app-ruantiblock/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ruantiblock -PKG_VERSION:=2.1.1 +PKG_VERSION:=2.1.2 PKG_RELEASE:=1 LUCI_TITLE:=LuCI support for ruantiblock LUCI_DEPENDS:=+ruantiblock diff --git a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js index 7f141ac..157d659 100644 --- a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js +++ b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js @@ -702,7 +702,7 @@ return view.extend({ fs.exec_direct(tools.execPath, [ 'restart' ]).then( () => console.log(tools.execPath + ' restarted...') ); - }, 1000); + }, 2000); }); }; tasks.push(res); diff --git a/ruantiblock-mod-lua/Makefile b/ruantiblock-mod-lua/Makefile index bfd05be..29f1681 100644 --- a/ruantiblock-mod-lua/Makefile +++ b/ruantiblock-mod-lua/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ruantiblock-mod-lua -PKG_VERSION:=2.1.1 +PKG_VERSION:=2.1.2 PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot diff --git a/ruantiblock-mod-lua/files/usr/libexec/ruantiblock/ruab_parser.lua b/ruantiblock-mod-lua/files/usr/libexec/ruantiblock/ruab_parser.lua index e4fdde0..05bd798 100755 --- a/ruantiblock-mod-lua/files/usr/libexec/ruantiblock/ruab_parser.lua +++ b/ruantiblock-mod-lua/files/usr/libexec/ruantiblock/ruab_parser.lua @@ -340,7 +340,7 @@ function BlackListParser:ip_value_processing(value) if not self.BLLIST_IP_FILTER or (self.BLLIST_IP_FILTER and not self:check_filter(ip_entry, self.BLLIST_IP_FILTER_PATTERNS, self.BLLIST_IP_FILTER_TYPE)) then if ip_entry:match("^" .. self.ip_pattern .. "$") and not self.ip_table[ip_entry] then local subnet = self:get_subnet(ip_entry) - if subnet and (self.BLLIST_GR_EXCLUDED_NETS_PATTERNS[subnet] or ((not self.BLLIST_IP_LIMIT or self.BLLIST_IP_LIMIT == 0) or (not self.ip_subnet_table[subnet] or self.ip_subnet_table[subnet] <= self.BLLIST_IP_LIMIT))) then + if subnet and (self.BLLIST_GR_EXCLUDED_NETS_PATTERNS[subnet] or ((not self.BLLIST_IP_LIMIT or self.BLLIST_IP_LIMIT == 0) or (not self.ip_subnet_table[subnet] or self.ip_subnet_table[subnet] < self.BLLIST_IP_LIMIT))) then self.ip_table[ip_entry] = subnet self.ip_subnet_table[subnet] = (self.ip_subnet_table[subnet] or 0) + 1 self.ip_count = self.ip_count + 1 diff --git a/ruantiblock-mod-py/Makefile b/ruantiblock-mod-py/Makefile index d2a4772..bce4a76 100644 --- a/ruantiblock-mod-py/Makefile +++ b/ruantiblock-mod-py/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ruantiblock-mod-py -PKG_VERSION:=2.1.1 +PKG_VERSION:=2.1.2 PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot diff --git a/ruantiblock/Makefile b/ruantiblock/Makefile index 7953f4d..f2885e8 100644 --- a/ruantiblock/Makefile +++ b/ruantiblock/Makefile @@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ruantiblock -PKG_VERSION:=2.1.1 -PKG_RELEASE:=2 +PKG_VERSION:=2.1.2 +PKG_RELEASE:=1 PKG_MAINTAINER:=gSpot include $(INCLUDE_DIR)/package.mk diff --git a/ruantiblock/files/etc/ruantiblock/fqdn_filter b/ruantiblock/files/etc/ruantiblock/fqdn_filter index f8888d0..caebd7c 100644 --- a/ruantiblock/files/etc/ruantiblock/fqdn_filter +++ b/ruantiblock/files/etc/ruantiblock/fqdn_filter @@ -82,3 +82,5 @@ birds forex kraken zerkalo +^1w +^1x diff --git a/ruantiblock/files/etc/ruantiblock/gr_excluded_sld b/ruantiblock/files/etc/ruantiblock/gr_excluded_sld index f6abd71..b1aae7d 100644 --- a/ruantiblock/files/etc/ruantiblock/gr_excluded_sld +++ b/ruantiblock/files/etc/ruantiblock/gr_excluded_sld @@ -17,3 +17,4 @@ duckdns.org dyndns.org dynsip.org mydns.jp +mooo.com diff --git a/ruantiblock/files/usr/bin/ruantiblock b/ruantiblock/files/usr/bin/ruantiblock index 67a8e3c..9abf7c7 100755 --- a/ruantiblock/files/usr/bin/ruantiblock +++ b/ruantiblock/files/usr/bin/ruantiblock @@ -72,6 +72,8 @@ export PKTS_MARK_START=8 export ENABLE_LOGGING=1 ### Вывод дополнительных сообщений в лог (0 - выкл, 1, 2) export DEBUG=0 +### Файл для вывода некоторых отладочных сообщений +export DEBUG_FILE="/tmp/ruanliblock.debug" ### Html-страница с инфо о текущем статусе (0 - выкл, 1 - вкл) (не используется в OpenWrt) export ENABLE_HTML_INFO=0 ### Максимальное кол-во элементов списка nftables @@ -940,8 +942,22 @@ GetMainInstanceEntries() { if [ "$ENABLE_BLLIST_PROXY" = "1" ]; then UpdateBllistProxySet " " "$BLLIST_HOSTS" fi - $BLLIST_MODULE - _return_code=$? + + if [ $DEBUG -ge 1 ]; then + echo " ruantiblock.GetMainInstanceEntries: BLLIST_MODULE=${BLLIST_MODULE} MODULE_RUN_TIMEOUT=${MODULE_RUN_TIMEOUT} _attempt=${_attempt}" >&2 + MakeLogRecord "debug" "ruantiblock.GetMainInstanceEntries: BLLIST_MODULE=${BLLIST_MODULE} MODULE_RUN_TIMEOUT=${MODULE_RUN_TIMEOUT} _attempt=${_attempt}" + + echo "BLLIST_MODULE=${BLLIST_MODULE}" > "$DEBUG_FILE" + $BLLIST_MODULE >> "$DEBUG_FILE" 2>&1 + _return_code=$? + + echo " ruantiblock.GetMainInstanceEntries._return_code=${_return_code}" >&2 + MakeLogRecord "debug" "ruantiblock.GetMainInstanceEntries._return_code=${_return_code}" + else + $BLLIST_MODULE + _return_code=$? + fi + [ $_return_code -eq 0 ] && break ### STDOUT echo " Module run attempt ${_attempt}: failed [${BLLIST_MODULE}]" >&2 diff --git a/ruantiblock/files/usr/share/ruantiblock/blacklist_sources b/ruantiblock/files/usr/share/ruantiblock/blacklist_sources index e9350bb..7288371 100644 --- a/ruantiblock/files/usr/share/ruantiblock/blacklist_sources +++ b/ruantiblock/files/usr/share/ruantiblock/blacklist_sources @@ -5,7 +5,8 @@ export RBL_IP_URL="https://reestr.rublacklist.net/api/v3/ips/" export RBL_DPI_URL="https://reestr.rublacklist.net/api/v3/dpi/" export RBL_ENCODING="" ## zapret-info -export ZI_ALL_URL="https://raw.githubusercontent.com/zapret-info/z-i/master/dump.csv" +export ZI_ALL_URL="https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-00.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-01.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-02.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-03.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-04.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-05.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-06.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-07.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-08.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-09.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-10.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-11.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-12.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-13.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-14.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-15.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-16.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-17.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-18.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-19.csv" +#export ZI_ALL_URL="https://app.assembla.com/spaces/z-i/git/source/master/dump.csv?_format=raw" export ZI_ENCODING="CP1251" ## antifilter export AF_IP_URL="https://antifilter.download/list/allyouneed.lst"