mirror of
https://github.com/gSpotx2f/ruantiblock_openwrt.git
synced 2026-05-13 14:10:59 +00:00
Bugfixes.
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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 <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||
LUCI_TITLE:=LuCI support for ruantiblock
|
||||
LUCI_DEPENDS:=+ruantiblock
|
||||
|
||||
@@ -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%';
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
@@ -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 <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -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 <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -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
|
||||
### Таймаут между попытками обновления
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user