Compare commits
6 Commits
v70.202504
...
v70.202505
| Author | SHA1 | Date | |
|---|---|---|---|
| 62401bbad5 | |||
| c31fab4aaf | |||
| d56cd06281 | |||
| 5f681a372a | |||
| d9d339e157 | |||
| dfbd77bb91 |
@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-zapret
|
||||
PKG_VERSION:=70.20250419
|
||||
PKG_VERSION:=70.20250505
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
||||
|
||||
|
||||
@ -86,6 +86,10 @@ return view.extend({
|
||||
o.rmempty = false;
|
||||
o.default = 0;
|
||||
|
||||
o = s.taboption(tabname, form.Flag, 'FILTER_TTL_EXPIRED_ICMP', 'FILTER_TTL_EXPIRED_ICMP');
|
||||
o.rmempty = false;
|
||||
o.default = 1;
|
||||
|
||||
o = s.taboption(tabname, form.ListValue, 'MODE_FILTER', _('MODE_FILTER'));
|
||||
//o.value('none', 'none');
|
||||
//o.value('ipset', 'ipset');
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
"file": {
|
||||
"/opt/zapret/config": [ "read" ],
|
||||
"/opt/zapret/ipset/*": [ "read" ],
|
||||
"/opt/zapret/init.d/openwrt/custom.d/*": [ "read" ],
|
||||
"/etc/crontabs/root": [ "read" ],
|
||||
"/tmp/zapret*": [ "read" ],
|
||||
"/etc/init.d/zapret*": [ "exec" ],
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret-ip2net
|
||||
PKG_VERSION:=70.20250419
|
||||
PKG_VERSION:=70.20250505
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
PKG_LICENSE:=MIT
|
||||
@ -9,8 +9,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b996abd5ce22942b09be6b6445c4c9f3dd49d6b3
|
||||
PKG_SOURCE_DATE:=2025-04-19
|
||||
PKG_SOURCE_VERSION:=b0c7af789a2a82d1cf285fba5282df0fe2951760
|
||||
PKG_SOURCE_DATE:=2025-05-05
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret-mdig
|
||||
PKG_VERSION:=70.20250419
|
||||
PKG_VERSION:=70.20250505
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
PKG_LICENSE:=MIT
|
||||
@ -9,8 +9,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b996abd5ce22942b09be6b6445c4c9f3dd49d6b3
|
||||
PKG_SOURCE_DATE:=2025-04-19
|
||||
PKG_SOURCE_VERSION:=b0c7af789a2a82d1cf285fba5282df0fe2951760
|
||||
PKG_SOURCE_DATE:=2025-05-05
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret-tpws
|
||||
PKG_VERSION:=70.20250419
|
||||
PKG_VERSION:=70.20250505
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
PKG_LICENSE:=MIT
|
||||
@ -9,8 +9,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b996abd5ce22942b09be6b6445c4c9f3dd49d6b3
|
||||
PKG_SOURCE_DATE:=2025-04-19
|
||||
PKG_SOURCE_VERSION:=b0c7af789a2a82d1cf285fba5282df0fe2951760
|
||||
PKG_SOURCE_DATE:=2025-05-05
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret
|
||||
PKG_VERSION:=70.20250419
|
||||
PKG_VERSION:=70.20250505
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
PKG_LICENSE:=MIT
|
||||
@ -13,8 +13,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b996abd5ce22942b09be6b6445c4c9f3dd49d6b3
|
||||
PKG_SOURCE_DATE:=2025-04-19
|
||||
PKG_SOURCE_VERSION:=b0c7af789a2a82d1cf285fba5282df0fe2951760
|
||||
PKG_SOURCE_DATE:=2025-05-05
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
@ -108,7 +108,9 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
fi
|
||||
if [ "$${PKG_UPGRADE}" = "1" ]; then
|
||||
# stop service if PKG_UPGRADE
|
||||
[ -x "/etc/init.d/zapret" ] && /etc/init.d/zapret stop >/dev/null 2>&1
|
||||
if [ -x "/etc/init.d/zapret" ]; then
|
||||
/etc/init.d/zapret running && /etc/init.d/zapret stop >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
if [ ! -f "/opt/zapret/ipset/zapret-hosts-google.txt" ]; then
|
||||
if [ -f "/opt/zapret/ipset/zapret-hosts-user.txt" ]; then
|
||||
@ -186,8 +188,8 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
. "$${ZAPRET_BASE}/common/fwtype.sh"
|
||||
. "$${ZAPRET_BASE}/common/nft.sh"
|
||||
. "$${ZAPRET_BASE}/common/installer.sh"
|
||||
/etc/init.d/zapret running && /etc/init.d/zapret stop
|
||||
/etc/init.d/zapret disable
|
||||
/etc/init.d/zapret stop
|
||||
ps w | grep '/opt/zapret/nfq/nfqws' | grep -v grep | awk '{print $$1}' | xargs -r kill -9
|
||||
remove_openwrt_firewall
|
||||
nft_del_table
|
||||
|
||||
@ -21,8 +21,7 @@ CRONTAB_FILE="/etc/crontabs/root"
|
||||
|
||||
function adapt_for_sed
|
||||
{
|
||||
local str=$( ( echo $1|sed -r 's/([\$\.\*\/\[\\^])/\\\1/g'|sed 's/[]]/\\]/g' )>&1 )
|
||||
echo "$str"
|
||||
echo -n "$1" | tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed -r 's/([\$\.\*\/\[\\^])/\\\1/g' | sed 's/[]]/\\]/g'
|
||||
}
|
||||
|
||||
function is_valid_config
|
||||
@ -157,3 +156,35 @@ function init_before_start
|
||||
remove_cron_task_logs
|
||||
fi
|
||||
}
|
||||
|
||||
function patch_luci_header_ut
|
||||
{
|
||||
# INFO: https://github.com/openwrt/luci/pull/7725
|
||||
local header_ut=/usr/share/ucode/luci/template/header.ut
|
||||
local runtime_uc=/usr/share/ucode/luci/runtime.uc
|
||||
local newenv
|
||||
[ ! -f $header_ut ] && return 0
|
||||
[ ! -f $runtime_uc ] && return 0
|
||||
if grep -q "pkgs_update_time" $runtime_uc; then
|
||||
return 0
|
||||
fi
|
||||
if grep -q "pkgs_update_time" $header_ut; then
|
||||
return 0
|
||||
fi
|
||||
sed -i "/^import { access/i import { stat } from 'fs';" $runtime_uc
|
||||
if ! grep -q "{ stat }" $runtime_uc; then
|
||||
return 1
|
||||
fi
|
||||
newenv="self.env.pkgs_update_time = stat('/lib/apk/db/installed')?.mtime ?? stat('/usr/lib/opkg/status')?.mtime ?? 0;"
|
||||
newenv=`adapt_for_sed "$newenv"`
|
||||
sed -i "/self.env.include =/i $newenv" $runtime_uc
|
||||
if ! grep -q "pkgs_update_time" $runtime_uc; then
|
||||
return 1
|
||||
fi
|
||||
sed -i 's/luci.js?v=\(.*\)"><\/script>/luci.js?v=\1-{{ pkgs_update_time }}"><\/script>/g' $header_ut
|
||||
if ! grep -q "pkgs_update_time" $header_ut; then
|
||||
return 1
|
||||
fi
|
||||
logger -p notice -t ZAPRET "patch_luci_header_ut: OK"
|
||||
return 0
|
||||
}
|
||||
|
||||
@ -136,6 +136,11 @@ DISABLE_IPV4=0
|
||||
# do not work with ipv6
|
||||
DISABLE_IPV6=1
|
||||
|
||||
# drop icmp time exceeded messages for nfqws tampered connections
|
||||
# in POSTNAT mode this can interfere with default mtr/traceroute in tcp or udp mode. use source port not redirected to nfqws
|
||||
# set to 0 if you are not expecting connection breakage due to icmp in response to TCP SYN or UDP
|
||||
FILTER_TTL_EXPIRED_ICMP=1
|
||||
|
||||
# select which init script will be used to get ip or host list
|
||||
# possible values : get_user.sh get_antizapret.sh get_combined.sh get_reestr.sh get_hostlist.sh
|
||||
# comment if not required
|
||||
|
||||
@ -14,6 +14,7 @@ function set_cfg_default_values
|
||||
set $cfgname.config.INIT_APPLY_FW='1'
|
||||
set $cfgname.config.DISABLE_IPV4='0'
|
||||
set $cfgname.config.DISABLE_IPV6='1'
|
||||
set $cfgname.config.FILTER_TTL_EXPIRED_ICMP='1'
|
||||
set $cfgname.config.MODE_FILTER='hostlist'
|
||||
set $cfgname.config.DISABLE_CUSTOM='0'
|
||||
set $cfgname.config.WS_USER='daemon'
|
||||
|
||||
@ -25,6 +25,7 @@ is_run_on_boot && IS_RUN_ON_BOOT=1 || IS_RUN_ON_BOOT=0
|
||||
function enable
|
||||
{
|
||||
local run_on_boot=""
|
||||
patch_luci_header_ut
|
||||
if [ "$IS_RUN_ON_BOOT" = "1" ]; then
|
||||
if [ -n "$ZAPRET_CFG_SEC_NAME" ]; then
|
||||
run_on_boot=$( get_run_on_boot_option )
|
||||
@ -59,6 +60,7 @@ function enabled
|
||||
function boot
|
||||
{
|
||||
local run_on_boot=""
|
||||
patch_luci_header_ut
|
||||
if [ "$IS_RUN_ON_BOOT" = "1" ]; then
|
||||
if [ -n "$ZAPRET_CFG_SEC_NAME" ]; then
|
||||
run_on_boot=$( get_run_on_boot_option )
|
||||
|
||||
@ -80,6 +80,7 @@ sync_param FLOWOFFLOAD
|
||||
sync_param INIT_APPLY_FW
|
||||
sync_param DISABLE_IPV4
|
||||
sync_param DISABLE_IPV6
|
||||
sync_param FILTER_TTL_EXPIRED_ICMP
|
||||
sync_param MODE_FILTER
|
||||
sync_param DISABLE_CUSTOM
|
||||
sync_param WS_USER str
|
||||
|
||||
Reference in New Issue
Block a user