From ef15f50b9ff4bd918f00be2bbcd092932f6f4770 Mon Sep 17 00:00:00 2001 From: gSpot Date: Wed, 4 Mar 2026 16:22:22 +0300 Subject: [PATCH] Bugfixes. --- autoinstall/2.x/apk/autoinstall.sh | 6 ++-- autoinstall/2.x/autoinstall.sh | 6 ++-- luci-app-ruantiblock/Makefile | 2 +- .../resources/view/ruantiblock/cron.js | 7 ++-- .../resources/view/ruantiblock/settings.js | 2 +- ruantiblock-mod-lua/Makefile | 2 +- ruantiblock-mod-py/Makefile | 2 +- .../usr/libexec/ruantiblock/ruab_parser.py | 2 +- ruantiblock/Makefile | 2 +- .../files/etc/ruantiblock/ruantiblock.conf | 2 +- ruantiblock/files/usr/bin/ruantiblock | 13 ++++--- .../files/usr/share/ruantiblock/nft_functions | 35 +++++++++++++------ 12 files changed, 49 insertions(+), 32 deletions(-) diff --git a/autoinstall/2.x/apk/autoinstall.sh b/autoinstall/2.x/apk/autoinstall.sh index 4b4d902..530711a 100755 --- a/autoinstall/2.x/apk/autoinstall.sh +++ b/autoinstall/2.x/apk/autoinstall.sh @@ -10,9 +10,9 @@ LUCI_APP=1 HTTPS_DNS_PROXY=1 OWRT_VERSION="25.12" -RUAB_VERSION="2.1.12-r2" -RUAB_MOD_LUA_VERSION="2.1.12-r1" -RUAB_LUCI_APP_VERSION="2.1.12-r1" +RUAB_VERSION="2.1.12-r3" +RUAB_MOD_LUA_VERSION="2.1.12-r3" +RUAB_LUCI_APP_VERSION="2.1.12-r3" BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master" PKG_DIR="/tmp" diff --git a/autoinstall/2.x/autoinstall.sh b/autoinstall/2.x/autoinstall.sh index 4c2c2e0..38a31af 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="24.10" -RUAB_VERSION="2.1.12-r2" -RUAB_MOD_LUA_VERSION="2.1.12-r1" -RUAB_LUCI_APP_VERSION="2.1.12-r1" +RUAB_VERSION="2.1.12-r3" +RUAB_MOD_LUA_VERSION="2.1.12-r3" +RUAB_LUCI_APP_VERSION="2.1.12-r3" 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 ab06e82..cc92378 100644 --- a/luci-app-ruantiblock/Makefile +++ b/luci-app-ruantiblock/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ruantiblock PKG_VERSION:=2.1.12 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_MAINTAINER:=gSpot LUCI_TITLE:=LuCI support for ruantiblock LUCI_DEPENDS:=+ruantiblock diff --git a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/cron.js b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/cron.js index e950aa1..90b9913 100644 --- a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/cron.js +++ b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/cron.js @@ -53,13 +53,13 @@ return view.extend({ }); }, - delRuabShedules() { + delRuabSchedules() { this.currentCrontabLines = this.currentCrontabLines.filter( s => s.match(this.crontabRegexp) ? false : true); }, delCronSchedule(ev) { - this.delRuabShedules(); + this.delRuabSchedules(); return this.writeCronFile(); }, @@ -82,7 +82,7 @@ return view.extend({ tools.execPath ); - this.delRuabShedules(); + this.delRuabSchedules(); this.currentCrontabLines.push(task_string); return this.writeCronFile(); @@ -96,7 +96,6 @@ return view.extend({ cron_hour.disabled = bool; cron_day_interval.disabled = bool; - // For luci-theme-material if(bool) { cron_hour.style.opacity = '50%'; cron_day_interval.style.opacity = '50%'; 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 0bd81d7..32178dc 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 @@ -93,7 +93,7 @@ return view.extend({ load() { return Promise.all([ - L.resolveDefault(fs.exec(tools.execPath, [ 'raw-status' ]), 1), + fs.exec(tools.execPath, [ 'raw-status' ]), L.resolveDefault(fs.list(tools.parsersDir), null), uci.load(tools.appName), ]).catch(e => { diff --git a/ruantiblock-mod-lua/Makefile b/ruantiblock-mod-lua/Makefile index 38e3252..d013b51 100644 --- a/ruantiblock-mod-lua/Makefile +++ b/ruantiblock-mod-lua/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ruantiblock-mod-lua PKG_VERSION:=2.1.12 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_MAINTAINER:=gSpot include $(INCLUDE_DIR)/package.mk diff --git a/ruantiblock-mod-py/Makefile b/ruantiblock-mod-py/Makefile index 2f194dc..92bb9f5 100644 --- a/ruantiblock-mod-py/Makefile +++ b/ruantiblock-mod-py/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ruantiblock-mod-py PKG_VERSION:=2.1.12 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_MAINTAINER:=gSpot include $(INCLUDE_DIR)/package.mk diff --git a/ruantiblock-mod-py/files/usr/libexec/ruantiblock/ruab_parser.py b/ruantiblock-mod-py/files/usr/libexec/ruantiblock/ruab_parser.py index 7f2fe01..e627158 100755 --- a/ruantiblock-mod-py/files/usr/libexec/ruantiblock/ruab_parser.py +++ b/ruantiblock-mod-py/files/usr/libexec/ruantiblock/ruab_parser.py @@ -477,7 +477,7 @@ class Summarize: def _group_ip_ranges(cls, ip_list, raw_list=None): def remove_items(start, end): for ip in range(int(start), int(end) + 1): - raw_list.pop(str(IPv4Address(ip)), None) + raw_list.remove(str(IPv4Address(ip))) start = end = None hosts = 1 diff --git a/ruantiblock/Makefile b/ruantiblock/Makefile index c9541dc..44395e2 100644 --- a/ruantiblock/Makefile +++ b/ruantiblock/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ruantiblock PKG_VERSION:=2.1.12 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_MAINTAINER:=gSpot include $(INCLUDE_DIR)/package.mk diff --git a/ruantiblock/files/etc/ruantiblock/ruantiblock.conf b/ruantiblock/files/etc/ruantiblock/ruantiblock.conf index 1d69f91..367225e 100644 --- a/ruantiblock/files/etc/ruantiblock/ruantiblock.conf +++ b/ruantiblock/files/etc/ruantiblock/ruantiblock.conf @@ -89,7 +89,7 @@ ENABLE_TMP_DOWNLOADS=0 ### Скачивать блэклисты через прокси ENABLE_BLLIST_PROXY=0 ### Список хостов источников блэклиста -BLLIST_HOSTS="reestr.rublacklist.net raw.githubusercontent.com app.assembla.com antifilter.download" +BLLIST_HOSTS="reestr.rublacklist.net raw.githubusercontent.com app.assembla.com antifilter.download blockedin.org" ### Кол-во попыток обновления блэклиста (в случае неудачи) MODULE_RUN_ATTEMPTS=3 ### Таймаут между попытками обновления diff --git a/ruantiblock/files/usr/bin/ruantiblock b/ruantiblock/files/usr/bin/ruantiblock index a203b8c..f2eb91f 100755 --- a/ruantiblock/files/usr/bin/ruantiblock +++ b/ruantiblock/files/usr/bin/ruantiblock @@ -125,7 +125,7 @@ export ENABLE_TMP_DOWNLOADS=0 ### Скачивать блэклисты через прокси export ENABLE_BLLIST_PROXY=0 ### Список хостов источников блэклиста -export BLLIST_HOSTS="reestr.rublacklist.net raw.githubusercontent.com app.assembla.com antifilter.download" +export BLLIST_HOSTS="reestr.rublacklist.net raw.githubusercontent.com app.assembla.com antifilter.download blockedin.org" ### Кол-во попыток обновления блэклиста (в случае неудачи) export MODULE_RUN_ATTEMPTS=3 ### Таймаут между попытками обновления @@ -241,11 +241,12 @@ if [ "$ENABLE_LOGGING" = "1" -a $? -ne 0 ]; then fi export LOGGER_CMD export LOGGER_PARAMS="-t ${APP_NAME}" -export WGET_CMD="$(which wget)" +WGET_CMD="$(which wget)" if [ $? -ne 0 ]; then echo " Error! Wget doesn't exists" >&2 exit 1 fi +export WGET_CMD export WGET_PARAMS="--no-check-certificate -q -O" NSLOOKUP_CMD="$(which nslookup)" if [ $? -ne 0 ]; then @@ -1046,7 +1047,7 @@ CheckDnsmasqConfDir() { } Update() { - local _arg="$1" _return_code=0 + local _arg="$1" _return_code=0 _upd_sets_ret_code=0 MakeToken if [ -e "$U_PID_FILE" ] && [ "$_arg" != "force-update" ]; then echo " ${NAME} ${_arg} - Error! Another instance of update is already running" >&2 @@ -1062,9 +1063,13 @@ Update() { FlushInstancesNftSets bllist fi GetBlacklistFiles + _return_code=$? FlushInstancesNftSets bllist UpdateBllistSets - _return_code=$? + _upd_sets_ret_code=$? + if [ $_return_code -eq 0 ]; then + _return_code=$_upd_sets_ret_code + fi RestartDnsmasq ToggleUPIDFile del ### Post-update script diff --git a/ruantiblock/files/usr/share/ruantiblock/nft_functions b/ruantiblock/files/usr/share/ruantiblock/nft_functions index a452c7a..40e9f7a 100644 --- a/ruantiblock/files/usr/share/ruantiblock/nft_functions +++ b/ruantiblock/files/usr/share/ruantiblock/nft_functions @@ -42,7 +42,9 @@ NftRouteDelete() { NftRouteAdd() { local _vpn_ip _type="$1" _route_table_id=$2 _pkts_mark=$3 _if_vpn="$4" _vpn_gw_ip="$5" if [ "$_type" = "lo" ]; then - echo 0 > "/proc/sys/net/ipv4/conf/lo/rp_filter" + if [ -d "/proc/sys/net/ipv4/conf/lo" ]; then + echo 0 > "/proc/sys/net/ipv4/conf/lo/rp_filter" + fi $IP_CMD rule add fwmark "$_pkts_mark" table "$_route_table_id" priority "$LO_RULE_PRIO" $IP_CMD route add local default dev lo table "$_route_table_id" @@ -58,22 +60,33 @@ NftRouteAdd() { else _vpn_ip=$($IP_CMD addr list dev "$_if_vpn" 2> /dev/null | $AWK_CMD '/inet/{f=($3 == "peer") ? 4 : 2; sub("/[0-9]{1,2}$", "", $f); print $f; exit}') fi - if [ -n "$_vpn_ip" -a "$_type" = "vpn" ]; then - echo 0 > "/proc/sys/net/ipv4/conf/${_if_vpn}/rp_filter" + if [ "$_type" = "vpn" ]; then + if [ -d "/proc/sys/net/ipv4/conf/${_if_vpn}" ]; then + echo 0 > "/proc/sys/net/ipv4/conf/${_if_vpn}/rp_filter" + fi NftRouteDelete "$_route_table_id" 2> /dev/null $IP_CMD rule add fwmark "$_pkts_mark" table "$_route_table_id" priority "$VPN_RULE_PRIO" - $IP_CMD route add default via "$_vpn_ip" table "$_route_table_id" metric 100 - if [ $? -ne 0 ]; then - echo " Error! An error occurred while adding the route. Routing table id=${_route_table_id}, VPN gateway IP=${_vpn_ip}" >&2 - MakeLogRecord "err" "Error! An error occurred while adding the route. Routing table id=${_route_table_id}, VPN gateway IP=${_vpn_ip}" - fi - $IP_CMD route add blackhole default table "$_route_table_id" metric 200 if [ $DEBUG -ge 1 ]; then echo " nft_functions.NftRouteAdd: ${IP_CMD} rule add fwmark ${_pkts_mark} table ${_route_table_id} priority ${VPN_RULE_PRIO}" >&2 MakeLogRecord "debug" "nft_functions.NftRouteAdd: ${IP_CMD} rule add fwmark ${_pkts_mark} table ${_route_table_id} priority ${VPN_RULE_PRIO}" - echo " nft_functions.NftRouteAdd: ${IP_CMD} route add default via ${_vpn_ip} table ${_route_table_id}" >&2 - MakeLogRecord "debug" "nft_functions.NftRouteAdd: ${IP_CMD} route add default via ${_vpn_ip} table ${_route_table_id}" + fi + + if [ -n "$_vpn_ip" ]; then + $IP_CMD route add default via "$_vpn_ip" table "$_route_table_id" metric 100 + if [ $? -ne 0 ]; then + echo " Error! An error occurred while adding the route. Routing table id=${_route_table_id}, VPN gateway IP=${_vpn_ip}" >&2 + MakeLogRecord "err" "Error! An error occurred while adding the route. Routing table id=${_route_table_id}, VPN gateway IP=${_vpn_ip}" + fi + + if [ $DEBUG -ge 1 ]; then + echo " nft_functions.NftRouteAdd: ${IP_CMD} route add default via ${_vpn_ip} table ${_route_table_id}" >&2 + MakeLogRecord "debug" "nft_functions.NftRouteAdd: ${IP_CMD} route add default via ${_vpn_ip} table ${_route_table_id}" + fi + fi + $IP_CMD route add blackhole default table "$_route_table_id" metric 200 + + if [ $DEBUG -ge 1 ]; then echo " nft_functions.NftRouteAdd: ${IP_CMD} route add blackhole default table ${_route_table_id} metric 200" >&2 MakeLogRecord "debug" "nft_functions.NftRouteAdd: ${IP_CMD} route add blackhole default table ${_route_table_id} metric 200" fi