From 5382acf6a25f9c3360d6ca0073a1d5518dbc8dc5 Mon Sep 17 00:00:00 2001 From: xiaorouji <60100640+xiaorouji@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:34:07 +0800 Subject: [PATCH] luci: update UoT depends --- luci-app-passwall/Makefile | 2 +- .../luasrc/model/cbi/passwall/client/type/ray.lua | 6 ++---- .../luasrc/model/cbi/passwall/client/type/sing-box.lua | 7 +++---- luci-app-passwall/luasrc/passwall/util_sing-box.lua | 7 ++++++- luci-app-passwall/po/zh-cn/passwall.po | 3 --- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index c15465bbe..a59776914 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.73-2 +PKG_VERSION:=4.73-3 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua index 45dc8f9b2..a99027b60 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua @@ -237,10 +237,8 @@ o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encryp o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "chacha20-poly1305" }) o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "xchacha20-poly1305" }) -o = s:option(Flag, option_name("uot"), translate("UDP over TCP"), translate("Need Xray-core or sing-box as server side.")) -o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "2022-blake3-aes-128-gcm" }) -o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "2022-blake3-aes-256-gcm" }) -o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "2022-blake3-chacha20-poly1305" }) +o = s:option(Flag, option_name("uot"), translate("UDP over TCP")) +o:depends({ [option_name("protocol")] = "shadowsocks" }) o = s:option(Value, option_name("uuid"), translate("ID")) o.password = true diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua index 9f93e733a..1f484a638 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua @@ -231,10 +231,9 @@ if singbox_tags:find("with_shadowsocksr") then o:depends({ [option_name("protocol")] = "shadowsocksr" }) end -o = s:option(Flag, option_name("uot"), translate("UDP over TCP"), translate("Need Xray-core or sing-box as server side.")) -o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("ss_method")] = "2022-blake3-aes-128-gcm" }) -o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("ss_method")] = "2022-blake3-aes-256-gcm" }) -o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("ss_method")] = "2022-blake3-chacha20-poly1305" }) +o = s:option(Flag, option_name("uot"), translate("UDP over TCP")) +o:depends({ [option_name("protocol")] = "socks" }) +o:depends({ [option_name("protocol")] = "shadowsocks" }) o = s:option(Value, option_name("uuid"), translate("ID")) o.password = true diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index a60f6dda0..5a961cf80 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -183,7 +183,10 @@ function gen_outbound(flag, node, tag, proxy_table) version = "5", username = (node.username and node.password) and node.username or nil, password = (node.username and node.password) and node.password or nil, - udp_over_tcp = false, + udp_over_tcp = node.uot == "1" and { + enabled = true, + version = 2 + } or nil, } end @@ -888,6 +891,7 @@ function gen_config(var) password = parsed1.password, address = parsed1.host, port = parsed1.port, + uot = "1", } local preproxy_outbound = gen_outbound(flag, _node, preproxy_tag) if preproxy_outbound then @@ -944,6 +948,7 @@ function gen_config(var) password = parsed1.password, address = parsed1.host, port = parsed1.port, + uot = "1", } local _outbound = gen_outbound(flag, _node, rule_name) if _outbound then diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index 2fa8fa21a..6ef2aa8b2 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1078,9 +1078,6 @@ msgstr "IV 检查" msgid "UDP over TCP" msgstr "TCP 封装 UDP" -msgid "Need Xray-core or sing-box as server side." -msgstr "需要 Xray-core 或者 sing-box 作为服务器端。" - msgid "Connection Timeout" msgstr "连接超时时间"