From 22efbbc6b83cb68cf35bc2b1f7c2e05863331e6b Mon Sep 17 00:00:00 2001 From: SunBK201 Date: Thu, 30 Oct 2025 22:48:45 +0800 Subject: [PATCH] fix: remove kmod-nft-tproxy dependency --- ipkg/CONTROL/control | 4 ++-- ipkg/CONTROL/control-e | 4 ++-- openwrt/Makefile | 2 +- openwrt/files/ua3f.init | 10 ++++++++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ipkg/CONTROL/control b/ipkg/CONTROL/control index 3158336..ff05679 100644 --- a/ipkg/CONTROL/control +++ b/ipkg/CONTROL/control @@ -1,11 +1,11 @@ Package: ua3f Version: 1.0.0-1 -Depends: luci-compat, ipset, iptables, kmod-nft-tproxy, iptables-mod-tproxy, iptables-mod-extra, iptables-mod-nat-extra, kmod-ipt-conntrack +Depends: luci-compat, ipset, iptables, iptables-mod-tproxy, iptables-mod-extra, iptables-mod-nat-extra, kmod-ipt-conntrack Source: /feed/openwrt SourceName: UA3F License: GPL-3.0-only Section: net SourceDateEpoch: 1711267200 Architecture: all -Installed-Size: 3573760 +Installed-Size: 4362240 Description: Advanced HTTP User-Agent Rewriting Tool. diff --git a/ipkg/CONTROL/control-e b/ipkg/CONTROL/control-e index d3c0af1..ff05679 100644 --- a/ipkg/CONTROL/control-e +++ b/ipkg/CONTROL/control-e @@ -1,11 +1,11 @@ Package: ua3f Version: 1.0.0-1 -Depends: luci-compat, ipset, iptables, kmod-nft-tproxy, iptables-mod-tproxy, iptables-mod-extra, iptables-mod-nat-extra, kmod-ipt-conntrack +Depends: luci-compat, ipset, iptables, iptables-mod-tproxy, iptables-mod-extra, iptables-mod-nat-extra, kmod-ipt-conntrack Source: /feed/openwrt SourceName: UA3F License: GPL-3.0-only Section: net SourceDateEpoch: 1711267200 Architecture: all -Installed-Size: 3706880 +Installed-Size: 4362240 Description: Advanced HTTP User-Agent Rewriting Tool. diff --git a/openwrt/Makefile b/openwrt/Makefile index e2caf4a..1296046 100644 --- a/openwrt/Makefile +++ b/openwrt/Makefile @@ -28,7 +28,7 @@ define Package/ua3f SUBMENU:=Web Servers/Proxies TITLE:=A SOCKS5 Server for User-Agent Rewriting URL:=https://github.com/SunBK201/UA3F - DEPENDS:=$(GO_ARCH_DEPENDS) +luci-compat +ipset +iptables +kmod-nft-tproxy +iptables-mod-tproxy +iptables-mod-extra +iptables-mod-nat-extra +kmod-ipt-conntrack + DEPENDS:=$(GO_ARCH_DEPENDS) +luci-compat +ipset +iptables +iptables-mod-tproxy +iptables-mod-extra +iptables-mod-nat-extra +kmod-ipt-conntrack endef define Package/ua3f/description diff --git a/openwrt/files/ua3f.init b/openwrt/files/ua3f.init index 55efecb..4ccfe9d 100755 --- a/openwrt/files/ua3f.init +++ b/openwrt/files/ua3f.init @@ -30,7 +30,17 @@ try_modprobe() { command -v modprobe >/dev/null 2>&1 && modprobe "$1" 2>/dev/nul nft_available() { command -v nft >/dev/null 2>&1; } ipt_available() { command -v iptables >/dev/null 2>&1; } +opkg_available() { command -v opkg >/dev/null 2>&1; } detect_backend() { + if opkg_available; then + if opkg list-installed kmod-nft-tproxy | grep -q 'kmod-nft-tproxy'; then + FW_BACKEND="nft" + return 0 + else + FW_BACKEND="ipt" + return 0 + fi + fi if nft_available; then FW_BACKEND="nft" return 0