From 07928362703a05e063a8d08af1ea0abd6cbcc059 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 28 Feb 2024 21:09:03 +0800
Subject: [PATCH] update 2024-02-28 21:09:03
---
luci-app-natmap/README.md | 4 +-
luci-app-passwall/Makefile | 2 +-
.../model/cbi/passwall/client/global.lua | 26 +++++-----
.../root/usr/share/passwall/app.sh | 4 +-
.../0001-fix-go-1.21-build-error.patch | 47 ++++++++++++-------
5 files changed, 50 insertions(+), 33 deletions(-)
diff --git a/luci-app-natmap/README.md b/luci-app-natmap/README.md
index bc0699d78..b3e5bda6e 100644
--- a/luci-app-natmap/README.md
+++ b/luci-app-natmap/README.md
@@ -1,6 +1,8 @@
## 介绍
-#### 本脚本为基于 openwrt master 分支的 natmap 插件
+#### 基于 openwrt master 分支的 natmap 插件
+
+注意:自 openwrt23.0 之后,使用golang>= 1.20,luci2(js实现网页),部分插件不兼容。
## 基本功能
diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile
index 7f8da6392..ef7e3bbca 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.75-2
+PKG_VERSION:=4.75-3
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 fa9a931fa..77dd44440 100644
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
@@ -370,22 +370,20 @@ o.rmempty = false
if api.is_finded("chinadns-ng") then
o = s:taboption("DNS", Flag, "chinadns_ng", translate("ChinaDNS-NG"), translate("The effect is better, but will increase the memory."))
o.default = "0"
- chinadns_ng_default_tag = s:taboption("DNS", ListValue, "chinadns_ng_default_tag", translate("ChinaDNS-NG Domain Default Tag"))
- chinadns_ng_default_tag.default = "smart"
- chinadns_ng_default_tag:value("smart", translate("Smart DNS"))
- chinadns_ng_default_tag:value("gfw", translate("Remote DNS"))
- chinadns_ng_default_tag:value("chn", translate("Direct DNS"))
- chinadns_ng_default_tag.description = "
"
+ o:depends({remote_fakedns = false, use_gfw_list = true})
+ o:depends({remote_fakedns = false, chn_list = "direct"})
+
+ o = s:taboption("DNS", ListValue, "chinadns_ng_default_tag", translate("ChinaDNS-NG Domain Default Tag"))
+ o.default = "smart"
+ o:value("smart", translate("Smart DNS"))
+ o:value("gfw", translate("Remote DNS"))
+ o:value("chn", translate("Direct DNS"))
+ o.description = ""
.. "- " .. translate("Forward to both remote and direct DNS, if the direct DNS resolution result is a mainland China ip, then use the direct result, otherwise use the remote result") .. "
"
.. "- " .. translate("Remote DNS can avoid more DNS leaks, but some domestic domain names maybe to proxy!") .. "
"
.. "- " .. translate("Direct DNS Internet experience may be better, but DNS will be leaked!") .. "
"
.. "
"
- chinadns_ng_default_tag:depends("chinadns_ng", true)
- o:depends({dns_mode = "dns2socks"})
- o:depends({dns_mode = "dns2tcp"})
- o:depends({dns_mode = "sing-box", remote_fakedns = false})
- o:depends({dns_mode = "xray"})
- o:depends({dns_mode = "udp"})
+ o:depends("chinadns_ng", true)
end
o = s:taboption("DNS", ListValue, "use_default_dns", translate("Default DNS"))
@@ -397,9 +395,11 @@ o.description = translate("The default DNS used when not in the domain name rule
.. "- " .. translate("Remote DNS can avoid more DNS leaks, but some domestic domain names maybe to proxy!") .. "
"
.. "- " .. translate("Direct DNS Internet experience may be better, but DNS will be leaked!") .. "
"
.. "
"
+local _depends = {tcp_proxy_mode = "proxy"}
if api.is_finded("chinadns-ng") then
- o:depends("chinadns_ng", false)
+ _depends["chinadns_ng"] = false
end
+o:depends(_depends)
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"
diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh
index 396527ffe..779698838 100755
--- a/luci-app-passwall/root/usr/share/passwall/app.sh
+++ b/luci-app-passwall/root/usr/share/passwall/app.sh
@@ -1691,10 +1691,10 @@ UDP_PROXY_MODE=$(config_t_get global udp_proxy_mode proxy)
[ "${UDP_PROXY_MODE}" != "disable" ] && UDP_PROXY_MODE="proxy"
LOCALHOST_TCP_PROXY_MODE=$(config_t_get global localhost_tcp_proxy_mode default)
LOCALHOST_UDP_PROXY_MODE=$(config_t_get global localhost_udp_proxy_mode default)
+[ "${LOCALHOST_TCP_PROXY_MODE}" == "default" ] && LOCALHOST_TCP_PROXY_MODE=$TCP_PROXY_MODE
+[ "${LOCALHOST_UDP_PROXY_MODE}" == "default" ] && LOCALHOST_UDP_PROXY_MODE=$UDP_PROXY_MODE
[ "${LOCALHOST_TCP_PROXY_MODE}" != "disable" ] && LOCALHOST_TCP_PROXY_MODE="proxy"
[ "${LOCALHOST_UDP_PROXY_MODE}" != "disable" ] && LOCALHOST_UDP_PROXY_MODE="proxy"
-[ "$LOCALHOST_TCP_PROXY_MODE" == "default" ] && LOCALHOST_TCP_PROXY_MODE=$TCP_PROXY_MODE
-[ "$LOCALHOST_UDP_PROXY_MODE" == "default" ] && LOCALHOST_UDP_PROXY_MODE=$UDP_PROXY_MODE
DNS_SHUNT="dnsmasq"
DNS_MODE=$(config_t_get global dns_mode dns2tcp)
DNS_CACHE=$(config_t_get global dns_cache 0)
diff --git a/xray-plugin/patches/0001-fix-go-1.21-build-error.patch b/xray-plugin/patches/0001-fix-go-1.21-build-error.patch
index d214f0089..0118772f7 100644
--- a/xray-plugin/patches/0001-fix-go-1.21-build-error.patch
+++ b/xray-plugin/patches/0001-fix-go-1.21-build-error.patch
@@ -1,24 +1,39 @@
-From 45368856980e030ddd95221289304c33e2749aa6 Mon Sep 17 00:00:00 2001
-From: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com>
-Date: Mon, 26 Feb 2024 15:45:35 +0000
-Subject: [PATCH] fix go 1.21 build error
-
----
- go.mod | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/go.mod b/go.mod
-index 71a9a02..077ac79 100644
--- a/go.mod
+++ b/go.mod
-@@ -1,6 +1,6 @@
+@@ -1,12 +1,14 @@
module github.com/teddysun/xray-plugin
-
+
-go 1.22
+go 1.21.5
-
+
require (
github.com/xtls/xray-core v1.8.8
---
-2.34.1
+ google.golang.org/protobuf v1.32.0
+ )
+
++replace github.com/xtls/xray-core v1.8.8 => github.com/sbwml/xray-core v1.8.9-0.20240227052524-c11c9e4bc77e
++
+ require (
+ github.com/andybalholm/brotli v1.1.0 // indirect
+ github.com/cloudflare/circl v1.3.7 // indirect
+--- a/go.sum
++++ b/go.sum
+@@ -116,6 +116,8 @@ github.com/sagernet/sing v0.3.2 h1:CwWcxUBPkMvwgfe2/zUgY5oHG9qOL8Aob/evIFYK9jo=
+ github.com/sagernet/sing v0.3.2/go.mod h1:qHySJ7u8po9DABtMYEkNBcOumx7ZZJf/fbv2sfTkNHE=
+ github.com/sagernet/sing-shadowsocks v0.2.6 h1:xr7ylAS/q1cQYS8oxKKajhuQcchd5VJJ4K4UZrrpp0s=
+ github.com/sagernet/sing-shadowsocks v0.2.6/go.mod h1:j2YZBIpWIuElPFL/5sJAj470bcn/3QQ5lxZUNKLDNAM=
++github.com/sbwml/xray-core v1.8.9-0.20240227052524-c11c9e4bc77e h1:Mk0WrWhfHYoCBTs5iVZe84Hkf3R8cGU4ydjmSxcTxJ4=
++github.com/sbwml/xray-core v1.8.9-0.20240227052524-c11c9e4bc77e/go.mod h1:+tmaOCDyGjPcZawmhAirDiZzeQcrz46T2Z6BjAdKsaI=
+ github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb h1:XfLJSPIOUX+osiMraVgIrMR27uMXnRJWGm1+GL8/63U=
+ github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg=
+ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
+@@ -159,8 +161,6 @@ github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1Y
+ github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
+ github.com/xtls/reality v0.0.0-20231112171332-de1173cf2b19 h1:capMfFYRgH9BCLd6A3Er/cH3A9Nz3CU2KwxwOQZIePI=
+ github.com/xtls/reality v0.0.0-20231112171332-de1173cf2b19/go.mod h1:dm4y/1QwzjGaK17ofi0Vs6NpKAHegZky8qk6J2JJZAE=
+-github.com/xtls/xray-core v1.8.8 h1:6ApBa5pNkPZ+I7jyJDZod3v5sadizS/BZr0pW7zcs8o=
+-github.com/xtls/xray-core v1.8.8/go.mod h1:Zp33A8cxnhP5Kt6nguQrMgNH4A/tgq7LE8cBedeNje8=
+ go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
+ go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
+ go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=