Bugfixes.

This commit is contained in:
gSpot
2026-03-04 16:22:22 +03:00
parent ebeb870d82
commit ef15f50b9f
12 changed files with 49 additions and 32 deletions
+3 -3
View File
@@ -10,9 +10,9 @@ LUCI_APP=1
HTTPS_DNS_PROXY=1 HTTPS_DNS_PROXY=1
OWRT_VERSION="25.12" OWRT_VERSION="25.12"
RUAB_VERSION="2.1.12-r2" RUAB_VERSION="2.1.12-r3"
RUAB_MOD_LUA_VERSION="2.1.12-r1" RUAB_MOD_LUA_VERSION="2.1.12-r3"
RUAB_LUCI_APP_VERSION="2.1.12-r1" RUAB_LUCI_APP_VERSION="2.1.12-r3"
BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master" BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master"
PKG_DIR="/tmp" PKG_DIR="/tmp"
+3 -3
View File
@@ -10,9 +10,9 @@ LUCI_APP=1
HTTPS_DNS_PROXY=1 HTTPS_DNS_PROXY=1
OWRT_VERSION="24.10" OWRT_VERSION="24.10"
RUAB_VERSION="2.1.12-r2" RUAB_VERSION="2.1.12-r3"
RUAB_MOD_LUA_VERSION="2.1.12-r1" RUAB_MOD_LUA_VERSION="2.1.12-r3"
RUAB_LUCI_APP_VERSION="2.1.12-r1" RUAB_LUCI_APP_VERSION="2.1.12-r3"
BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master" BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master"
PKG_DIR="/tmp" PKG_DIR="/tmp"
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ruantiblock PKG_NAME:=luci-app-ruantiblock
PKG_VERSION:=2.1.12 PKG_VERSION:=2.1.12
PKG_RELEASE:=1 PKG_RELEASE:=3
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt> PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
LUCI_TITLE:=LuCI support for ruantiblock LUCI_TITLE:=LuCI support for ruantiblock
LUCI_DEPENDS:=+ruantiblock LUCI_DEPENDS:=+ruantiblock
@@ -53,13 +53,13 @@ return view.extend({
}); });
}, },
delRuabShedules() { delRuabSchedules() {
this.currentCrontabLines = this.currentCrontabLines.filter( this.currentCrontabLines = this.currentCrontabLines.filter(
s => s.match(this.crontabRegexp) ? false : true); s => s.match(this.crontabRegexp) ? false : true);
}, },
delCronSchedule(ev) { delCronSchedule(ev) {
this.delRuabShedules(); this.delRuabSchedules();
return this.writeCronFile(); return this.writeCronFile();
}, },
@@ -82,7 +82,7 @@ return view.extend({
tools.execPath tools.execPath
); );
this.delRuabShedules(); this.delRuabSchedules();
this.currentCrontabLines.push(task_string); this.currentCrontabLines.push(task_string);
return this.writeCronFile(); return this.writeCronFile();
@@ -96,7 +96,6 @@ return view.extend({
cron_hour.disabled = bool; cron_hour.disabled = bool;
cron_day_interval.disabled = bool; cron_day_interval.disabled = bool;
// For luci-theme-material
if(bool) { if(bool) {
cron_hour.style.opacity = '50%'; cron_hour.style.opacity = '50%';
cron_day_interval.style.opacity = '50%'; cron_day_interval.style.opacity = '50%';
@@ -93,7 +93,7 @@ return view.extend({
load() { load() {
return Promise.all([ 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), L.resolveDefault(fs.list(tools.parsersDir), null),
uci.load(tools.appName), uci.load(tools.appName),
]).catch(e => { ]).catch(e => {
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock-mod-lua PKG_NAME:=ruantiblock-mod-lua
PKG_VERSION:=2.1.12 PKG_VERSION:=2.1.12
PKG_RELEASE:=1 PKG_RELEASE:=3
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt> PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock-mod-py PKG_NAME:=ruantiblock-mod-py
PKG_VERSION:=2.1.12 PKG_VERSION:=2.1.12
PKG_RELEASE:=1 PKG_RELEASE:=3
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt> PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@@ -477,7 +477,7 @@ class Summarize:
def _group_ip_ranges(cls, ip_list, raw_list=None): def _group_ip_ranges(cls, ip_list, raw_list=None):
def remove_items(start, end): def remove_items(start, end):
for ip in range(int(start), int(end) + 1): 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 start = end = None
hosts = 1 hosts = 1
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock PKG_NAME:=ruantiblock
PKG_VERSION:=2.1.12 PKG_VERSION:=2.1.12
PKG_RELEASE:=2 PKG_RELEASE:=3
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt> PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@@ -89,7 +89,7 @@ ENABLE_TMP_DOWNLOADS=0
### Скачивать блэклисты через прокси ### Скачивать блэклисты через прокси
ENABLE_BLLIST_PROXY=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 MODULE_RUN_ATTEMPTS=3
### Таймаут между попытками обновления ### Таймаут между попытками обновления
+9 -4
View File
@@ -125,7 +125,7 @@ export ENABLE_TMP_DOWNLOADS=0
### Скачивать блэклисты через прокси ### Скачивать блэклисты через прокси
export ENABLE_BLLIST_PROXY=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 export MODULE_RUN_ATTEMPTS=3
### Таймаут между попытками обновления ### Таймаут между попытками обновления
@@ -241,11 +241,12 @@ if [ "$ENABLE_LOGGING" = "1" -a $? -ne 0 ]; then
fi fi
export LOGGER_CMD export LOGGER_CMD
export LOGGER_PARAMS="-t ${APP_NAME}" export LOGGER_PARAMS="-t ${APP_NAME}"
export WGET_CMD="$(which wget)" WGET_CMD="$(which wget)"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo " Error! Wget doesn't exists" >&2 echo " Error! Wget doesn't exists" >&2
exit 1 exit 1
fi fi
export WGET_CMD
export WGET_PARAMS="--no-check-certificate -q -O" export WGET_PARAMS="--no-check-certificate -q -O"
NSLOOKUP_CMD="$(which nslookup)" NSLOOKUP_CMD="$(which nslookup)"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@@ -1046,7 +1047,7 @@ CheckDnsmasqConfDir() {
} }
Update() { Update() {
local _arg="$1" _return_code=0 local _arg="$1" _return_code=0 _upd_sets_ret_code=0
MakeToken MakeToken
if [ -e "$U_PID_FILE" ] && [ "$_arg" != "force-update" ]; then if [ -e "$U_PID_FILE" ] && [ "$_arg" != "force-update" ]; then
echo " ${NAME} ${_arg} - Error! Another instance of update is already running" >&2 echo " ${NAME} ${_arg} - Error! Another instance of update is already running" >&2
@@ -1062,9 +1063,13 @@ Update() {
FlushInstancesNftSets bllist FlushInstancesNftSets bllist
fi fi
GetBlacklistFiles GetBlacklistFiles
_return_code=$?
FlushInstancesNftSets bllist FlushInstancesNftSets bllist
UpdateBllistSets UpdateBllistSets
_return_code=$? _upd_sets_ret_code=$?
if [ $_return_code -eq 0 ]; then
_return_code=$_upd_sets_ret_code
fi
RestartDnsmasq RestartDnsmasq
ToggleUPIDFile del ToggleUPIDFile del
### Post-update script ### Post-update script
@@ -42,7 +42,9 @@ NftRouteDelete() {
NftRouteAdd() { NftRouteAdd() {
local _vpn_ip _type="$1" _route_table_id=$2 _pkts_mark=$3 _if_vpn="$4" _vpn_gw_ip="$5" local _vpn_ip _type="$1" _route_table_id=$2 _pkts_mark=$3 _if_vpn="$4" _vpn_gw_ip="$5"
if [ "$_type" = "lo" ]; then 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 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" $IP_CMD route add local default dev lo table "$_route_table_id"
@@ -58,22 +60,33 @@ NftRouteAdd() {
else 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}') _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 fi
if [ -n "$_vpn_ip" -a "$_type" = "vpn" ]; then if [ "$_type" = "vpn" ]; then
echo 0 > "/proc/sys/net/ipv4/conf/${_if_vpn}/rp_filter" 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 NftRouteDelete "$_route_table_id" 2> /dev/null
$IP_CMD rule add fwmark "$_pkts_mark" table "$_route_table_id" priority "$VPN_RULE_PRIO" $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 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 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}" 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 fi
MakeLogRecord "debug" "nft_functions.NftRouteAdd: ${IP_CMD} route add default via ${_vpn_ip} table ${_route_table_id}"
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 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" MakeLogRecord "debug" "nft_functions.NftRouteAdd: ${IP_CMD} route add blackhole default table ${_route_table_id} metric 200"
fi fi