Compare commits

...

6 Commits

Author SHA1 Message Date
62401bbad5 Bump version to v70.20250505
Some checks failed
build / build (arm_cortex-a8_vfpv3, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_cortex-a8_vfpv3, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_cortex-a9, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_cortex-a9, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_cortex-a9_neon, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_cortex-a9_neon, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_cortex-a9_vfpv3-d16, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_fa526, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_fa526, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_xscale, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (arm_xscale, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mips64_octeonplus, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mips64_octeonplus, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mips_24kc, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mips_24kc, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mips_4kec, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mips_4kec, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mips_mips32, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mips_mips32, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mipsel_24kc, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mipsel_24kc, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mipsel_24kc_24kf, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mipsel_24kc_24kf, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mipsel_74kc, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mipsel_74kc, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mipsel_mips32, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (mipsel_mips32, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (x86_64, SNAPSHOT, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / build (x86_64, openwrt-24.10, ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}) (push) Has been cancelled
build / release (push) Has been cancelled
2025-05-05 15:26:18 +03:00
c31fab4aaf config: Add new param FILTER_TTL_EXPIRED_ICMP
Source: dc1dc5c876
2025-05-05 15:26:17 +03:00
d56cd06281 luci: Fix access to files into custom.d dir 2025-05-05 15:26:17 +03:00
5f681a372a install: Patch luci header.ut for force update browser-cache
Aux info: https://github.com/openwrt/luci/pull/7725
2025-05-05 15:26:17 +03:00
d9d339e157 comfunc: Fix stdout into func adapt_for_sed 2025-05-05 15:26:17 +03:00
dfbd77bb91 install: Check service running before stop 2025-04-27 20:30:01 +03:00
12 changed files with 64 additions and 17 deletions

View File

@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-zapret PKG_NAME:=luci-app-zapret
PKG_VERSION:=70.20250419 PKG_VERSION:=70.20250505
PKG_LICENSE:=MIT PKG_LICENSE:=MIT
PKG_MAINTAINER:=remittor <https://github.com/remittor> PKG_MAINTAINER:=remittor <https://github.com/remittor>

View File

@ -86,6 +86,10 @@ return view.extend({
o.rmempty = false; o.rmempty = false;
o.default = 0; 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 = s.taboption(tabname, form.ListValue, 'MODE_FILTER', _('MODE_FILTER'));
//o.value('none', 'none'); //o.value('none', 'none');
//o.value('ipset', 'ipset'); //o.value('ipset', 'ipset');

View File

@ -6,6 +6,7 @@
"file": { "file": {
"/opt/zapret/config": [ "read" ], "/opt/zapret/config": [ "read" ],
"/opt/zapret/ipset/*": [ "read" ], "/opt/zapret/ipset/*": [ "read" ],
"/opt/zapret/init.d/openwrt/custom.d/*": [ "read" ],
"/etc/crontabs/root": [ "read" ], "/etc/crontabs/root": [ "read" ],
"/tmp/zapret*": [ "read" ], "/tmp/zapret*": [ "read" ],
"/etc/init.d/zapret*": [ "exec" ], "/etc/init.d/zapret*": [ "exec" ],

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=zapret-ip2net PKG_NAME:=zapret-ip2net
PKG_VERSION:=70.20250419 PKG_VERSION:=70.20250505
PKG_MAINTAINER:=bol-van PKG_MAINTAINER:=bol-van
PKG_LICENSE:=MIT 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_URL:=https://github.com/bol-van/zapret.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b996abd5ce22942b09be6b6445c4c9f3dd49d6b3 PKG_SOURCE_VERSION:=b0c7af789a2a82d1cf285fba5282df0fe2951760
PKG_SOURCE_DATE:=2025-04-19 PKG_SOURCE_DATE:=2025-05-05
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz #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? #PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=zapret-mdig PKG_NAME:=zapret-mdig
PKG_VERSION:=70.20250419 PKG_VERSION:=70.20250505
PKG_MAINTAINER:=bol-van PKG_MAINTAINER:=bol-van
PKG_LICENSE:=MIT 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_URL:=https://github.com/bol-van/zapret.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b996abd5ce22942b09be6b6445c4c9f3dd49d6b3 PKG_SOURCE_VERSION:=b0c7af789a2a82d1cf285fba5282df0fe2951760
PKG_SOURCE_DATE:=2025-04-19 PKG_SOURCE_DATE:=2025-05-05
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz #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? #PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=zapret-tpws PKG_NAME:=zapret-tpws
PKG_VERSION:=70.20250419 PKG_VERSION:=70.20250505
PKG_MAINTAINER:=bol-van PKG_MAINTAINER:=bol-van
PKG_LICENSE:=MIT 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_URL:=https://github.com/bol-van/zapret.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b996abd5ce22942b09be6b6445c4c9f3dd49d6b3 PKG_SOURCE_VERSION:=b0c7af789a2a82d1cf285fba5282df0fe2951760
PKG_SOURCE_DATE:=2025-04-19 PKG_SOURCE_DATE:=2025-05-05
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz #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? #PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?

View File

@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=zapret PKG_NAME:=zapret
PKG_VERSION:=70.20250419 PKG_VERSION:=70.20250505
PKG_MAINTAINER:=bol-van PKG_MAINTAINER:=bol-van
PKG_LICENSE:=MIT 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_URL:=https://github.com/bol-van/zapret.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b996abd5ce22942b09be6b6445c4c9f3dd49d6b3 PKG_SOURCE_VERSION:=b0c7af789a2a82d1cf285fba5282df0fe2951760
PKG_SOURCE_DATE:=2025-04-19 PKG_SOURCE_DATE:=2025-05-05
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz #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? #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 fi
if [ "$${PKG_UPGRADE}" = "1" ]; then if [ "$${PKG_UPGRADE}" = "1" ]; then
# stop service if PKG_UPGRADE # 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 fi
if [ ! -f "/opt/zapret/ipset/zapret-hosts-google.txt" ]; then if [ ! -f "/opt/zapret/ipset/zapret-hosts-google.txt" ]; then
if [ -f "/opt/zapret/ipset/zapret-hosts-user.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/fwtype.sh"
. "$${ZAPRET_BASE}/common/nft.sh" . "$${ZAPRET_BASE}/common/nft.sh"
. "$${ZAPRET_BASE}/common/installer.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 disable
/etc/init.d/zapret stop
ps w | grep '/opt/zapret/nfq/nfqws' | grep -v grep | awk '{print $$1}' | xargs -r kill -9 ps w | grep '/opt/zapret/nfq/nfqws' | grep -v grep | awk '{print $$1}' | xargs -r kill -9
remove_openwrt_firewall remove_openwrt_firewall
nft_del_table nft_del_table

View File

@ -21,8 +21,7 @@ CRONTAB_FILE="/etc/crontabs/root"
function adapt_for_sed function adapt_for_sed
{ {
local str=$( ( echo $1|sed -r 's/([\$\.\*\/\[\\^])/\\\1/g'|sed 's/[]]/\\]/g' )>&1 ) echo -n "$1" | tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed -r 's/([\$\.\*\/\[\\^])/\\\1/g' | sed 's/[]]/\\]/g'
echo "$str"
} }
function is_valid_config function is_valid_config
@ -157,3 +156,35 @@ function init_before_start
remove_cron_task_logs remove_cron_task_logs
fi 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
}

View File

@ -136,6 +136,11 @@ DISABLE_IPV4=0
# do not work with ipv6 # do not work with ipv6
DISABLE_IPV6=1 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 # 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 # possible values : get_user.sh get_antizapret.sh get_combined.sh get_reestr.sh get_hostlist.sh
# comment if not required # comment if not required

View File

@ -14,6 +14,7 @@ function set_cfg_default_values
set $cfgname.config.INIT_APPLY_FW='1' set $cfgname.config.INIT_APPLY_FW='1'
set $cfgname.config.DISABLE_IPV4='0' set $cfgname.config.DISABLE_IPV4='0'
set $cfgname.config.DISABLE_IPV6='1' set $cfgname.config.DISABLE_IPV6='1'
set $cfgname.config.FILTER_TTL_EXPIRED_ICMP='1'
set $cfgname.config.MODE_FILTER='hostlist' set $cfgname.config.MODE_FILTER='hostlist'
set $cfgname.config.DISABLE_CUSTOM='0' set $cfgname.config.DISABLE_CUSTOM='0'
set $cfgname.config.WS_USER='daemon' set $cfgname.config.WS_USER='daemon'

View File

@ -25,6 +25,7 @@ is_run_on_boot && IS_RUN_ON_BOOT=1 || IS_RUN_ON_BOOT=0
function enable function enable
{ {
local run_on_boot="" local run_on_boot=""
patch_luci_header_ut
if [ "$IS_RUN_ON_BOOT" = "1" ]; then if [ "$IS_RUN_ON_BOOT" = "1" ]; then
if [ -n "$ZAPRET_CFG_SEC_NAME" ]; then if [ -n "$ZAPRET_CFG_SEC_NAME" ]; then
run_on_boot=$( get_run_on_boot_option ) run_on_boot=$( get_run_on_boot_option )
@ -59,6 +60,7 @@ function enabled
function boot function boot
{ {
local run_on_boot="" local run_on_boot=""
patch_luci_header_ut
if [ "$IS_RUN_ON_BOOT" = "1" ]; then if [ "$IS_RUN_ON_BOOT" = "1" ]; then
if [ -n "$ZAPRET_CFG_SEC_NAME" ]; then if [ -n "$ZAPRET_CFG_SEC_NAME" ]; then
run_on_boot=$( get_run_on_boot_option ) run_on_boot=$( get_run_on_boot_option )

View File

@ -80,6 +80,7 @@ sync_param FLOWOFFLOAD
sync_param INIT_APPLY_FW sync_param INIT_APPLY_FW
sync_param DISABLE_IPV4 sync_param DISABLE_IPV4
sync_param DISABLE_IPV6 sync_param DISABLE_IPV6
sync_param FILTER_TTL_EXPIRED_ICMP
sync_param MODE_FILTER sync_param MODE_FILTER
sync_param DISABLE_CUSTOM sync_param DISABLE_CUSTOM
sync_param WS_USER str sync_param WS_USER str