diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index b664b0e64..6038b8a80 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall -PKG_VERSION:=4.65-1 +PKG_VERSION:=4.65-2 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua index 0fde5ea83..c3babb3ca 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -400,7 +400,7 @@ end o = s:taboption("DNS", Button, "clear_ipset", translate("Clear IPSET"), translate("Try this feature if the rule modification does not take effect.")) o.inputstyle = "remove" function o.write(e, e) - luci.sys.call("[ -n \"$(nft list sets 2>/dev/null | grep \"gfwlist\")\" ] && /usr/share/" .. appname .. "/nftables.sh flush_nftset || /usr/share/" .. appname .. "/iptables.sh flush_ipset > /dev/null 2>&1 &") + luci.sys.call("[ -n \"$(nft list sets 2>/dev/null | grep \"gfwlist\")\" ] && sh /usr/share/" .. appname .. "/nftables.sh flush_nftset || sh /usr/share/" .. appname .. "/iptables.sh flush_ipset > /dev/null 2>&1 &") luci.http.redirect(api.url("log")) end diff --git a/luci-app-passwall/root/etc/uci-defaults/luci-passwall b/luci-app-passwall/root/etc/uci-defaults/luci-passwall index cc39c00a2..340003d4e 100755 --- a/luci-app-passwall/root/etc/uci-defaults/luci-passwall +++ b/luci-app-passwall/root/etc/uci-defaults/luci-passwall @@ -29,6 +29,15 @@ EOF [ ! -s "/etc/config/passwall" ] && cp -f /usr/share/passwall/0_default_config /etc/config/passwall touch /etc/config/passwall_show >/dev/null 2>&1 + +[ "$(opkg list-installed | grep "firewall4")" ] && [ "$(opkg list-installed | grep "nftables")" ] && { + [ "$(opkg list-installed | grep "kmod\-nft\-socket")" ] && [ "$(opkg list-installed | grep "kmod\-nft\-tproxy")" ] && [ "$(opkg list-installed | grep "kmod\-nft\-nat")" ] && { + uci -q set passwall.@global_forwarding[0].use_nft=1 + uci -q commit passwall + sed -i "s#use_nft '0'#use_nft '1'#g" /usr/share/passwall/0_default_config + } +} + rm -f /tmp/luci-indexcache rm -rf /tmp/luci-modulecache/ killall -HUP rpcd 2>/dev/null diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index cace8e0d9..9ad28bfbf 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -416,14 +416,22 @@ run_chinadns_ng() { [ -s "${RULES_PATH}/chnlist" ] && { local _chnlist_file="${TMP_PATH}/chinadns_chnlist" cp -a "${RULES_PATH}/chnlist" "${_chnlist_file}" - _extra_param="${_extra_param} -m ${_chnlist_file} -M -a" + local chnroute4_set="chnroute" + local chnroute6_set="chnroute6" + [ "$nftflag" = "1" ] && { + chnroute4_set="inet@fw4@chnroute" + chnroute6_set="inet@fw4@chnroute6" + } + _extra_param="${_extra_param} -4 ${chnroute4_set} -6 ${chnroute6_set} -m ${_chnlist_file} -M -a" } } ([ -n "$_chnlist" ] || [ -n "$_gfwlist" ]) && [ -s "${RULES_PATH}/gfwlist" ] && { local _gfwlist_file="${TMP_PATH}/chinadns_gfwlist" cp -a "${RULES_PATH}/gfwlist" "${_gfwlist_file}" - _extra_param="${_extra_param} -g ${_gfwlist_file} -A gfwlist,gfwlist6" + local gfwlist_set="gfwlist,gfwlist6" + [ "$nftflag" = "1" ] && gfwlist_set="inet@fw4@gfwlist,inet@fw4@gfwlist6" + _extra_param="${_extra_param} -g ${_gfwlist_file} -A ${gfwlist_set}" #当只有使用gfwlist模式时设置默认DNS为本地直连 [ -n "$_gfwlist" ] && [ -z "$_chnlist" ] && _default_tag="chn" } diff --git a/natflow/Makefile b/natflow/Makefile index 280768352..b31fb3b4e 100644 --- a/natflow/Makefile +++ b/natflow/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=natflow -PKG_VERSION:=20230422 +PKG_VERSION:=20230423 PKG_SOURCE_URL:=https://codeload.github.com/ptpt52/natflow/tar.gz/$(PKG_VERSION)? -PKG_HASH:=89bee9ec3b6265d1c3bcbfa44872d703c8af7ab319c95657935e8e4261c74dc9 +PKG_HASH:=ddf011339e00b8056c493e3ee957635d104aab7d636fda3230cfc919accc4da6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_MAINTAINER:=Chen Minqiang