From 24d7dba717a3b5b8edb9b2c472287e2386e5cf65 Mon Sep 17 00:00:00 2001 From: "github-action[bot]" Date: Mon, 30 Dec 2024 19:34:15 +0100 Subject: [PATCH] Update On Mon Dec 30 19:34:14 CET 2024 --- .github/update.log | 1 + clash-meta/go.mod | 2 +- clash-meta/go.sum | 4 +- clash-nyanpasu/frontend/nyanpasu/package.json | 2 +- clash-nyanpasu/frontend/ui/package.json | 2 +- clash-nyanpasu/pnpm-lock.yaml | 14 +- hysteria/app/cmd/server.go | 21 +++ hysteria/app/cmd/server_test.go | 1 + hysteria/app/cmd/server_test.yaml | 1 + hysteria/core/go.sum | 1 + lede/package/utils/busybox/Makefile | 2 +- mihomo/go.mod | 2 +- mihomo/go.sum | 4 +- .../model/cbi/passwall/client/acl_config.lua | 20 +-- .../model/cbi/passwall/client/global.lua | 18 +- .../model/cbi/passwall/client/haproxy.lua | 3 +- .../model/cbi/passwall/client/rule_list.lua | 6 +- .../cbi/passwall/client/socks_config.lua | 5 +- .../model/cbi/passwall/client/type/ray.lua | 7 +- .../cbi/passwall/client/type/sing-box.lua | 5 +- .../luasrc/passwall/util_xray.lua | 4 +- .../passwall/node_list/link_share_man.htm | 12 +- .../root/usr/share/passwall/subscribe.lua | 9 +- .../luasrc/model/cbi/passwall2/client/acl.lua | 1 - .../model/cbi/passwall2/client/acl_config.lua | 16 +- .../model/cbi/passwall2/client/global.lua | 10 +- .../model/cbi/passwall2/client/haproxy.lua | 3 +- .../cbi/passwall2/client/node_config.lua | 14 +- .../model/cbi/passwall2/client/node_list.lua | 2 +- .../model/cbi/passwall2/client/other.lua | 1 - .../cbi/passwall2/client/socks_config.lua | 5 +- .../model/cbi/passwall2/client/type/ray.lua | 13 +- .../cbi/passwall2/client/type/sing-box.lua | 5 +- .../luasrc/passwall2/util_xray.lua | 4 +- .../passwall2/node_list/link_share_man.htm | 98 +++++++---- .../root/usr/share/passwall2/subscribe.lua | 11 +- .../model/cbi/passwall/client/acl_config.lua | 20 +-- .../model/cbi/passwall/client/global.lua | 18 +- .../model/cbi/passwall/client/haproxy.lua | 3 +- .../model/cbi/passwall/client/rule_list.lua | 6 +- .../cbi/passwall/client/socks_config.lua | 5 +- .../model/cbi/passwall/client/type/ray.lua | 7 +- .../cbi/passwall/client/type/sing-box.lua | 5 +- .../luasrc/passwall/util_xray.lua | 4 +- .../passwall/node_list/link_share_man.htm | 12 +- .../root/usr/share/passwall/subscribe.lua | 9 +- .../luasrc/model/cbi/passwall2/client/acl.lua | 1 - .../model/cbi/passwall2/client/acl_config.lua | 13 +- .../model/cbi/passwall2/client/global.lua | 12 +- .../model/cbi/passwall2/client/haproxy.lua | 3 +- .../cbi/passwall2/client/node_config.lua | 14 +- .../model/cbi/passwall2/client/node_list.lua | 2 +- .../model/cbi/passwall2/client/other.lua | 1 - .../cbi/passwall2/client/socks_config.lua | 5 +- .../model/cbi/passwall2/client/type/ray.lua | 11 +- .../cbi/passwall2/client/type/sing-box.lua | 5 +- .../passwall2/node_list/link_share_man.htm | 87 ++++++---- .../root/usr/share/passwall2/subscribe.lua | 2 +- .../luasrc/controller/shadowsocksr.lua | 35 +++- .../model/cbi/shadowsocksr/client-config.lua | 4 +- .../luasrc/model/cbi/shadowsocksr/log.lua | 110 +++++++++++-- .../luasrc/model/cbi/shadowsocksr/status.lua | 16 +- .../view/shadowsocksr/backup_restore.htm | 154 ++++++++++++++++++ .../luasrc/view/shadowsocksr/log.htm | 37 +++++ .../luasrc/view/shadowsocksr/ssrurl.htm | 67 +++++++- .../luci-app-ssr-plus/po/zh_Hans/ssr-plus.po | 50 ++++++ .../usr/share/shadowsocksr/gen_config.lua | 11 +- .../root/usr/share/shadowsocksr/subscribe.lua | 74 ++++++++- small/v2ray-geodata/Makefile | 4 +- v2rayn/.github/workflows/build-linux.yml | 2 + v2rayn/.github/workflows/build-osx.yml | 19 +++ v2rayn/.github/workflows/build-windows.yml | 4 + v2rayn/package-debian.sh | 2 + v2rayn/package-osx.sh | 65 ++++++++ v2rayn/v2rayN/AmazTool/AmazTool.csproj | 2 +- v2rayn/v2rayN/AmazTool/UpgradeApp.cs | 4 +- v2rayn/v2rayN/ServiceLib/Common/Utils.cs | 11 +- v2rayn/v2rayN/ServiceLib/ServiceLib.csproj | 4 +- .../ViewModels/MainWindowViewModel.cs | 7 +- .../v2rayN.Desktop/Views/MainWindow.axaml.cs | 2 +- .../Views/ProfilesView.axaml.cs | 2 +- .../Views/RoutingRuleSettingWindow.axaml.cs | 2 +- .../Views/RoutingSettingWindow.axaml.cs | 2 +- 83 files changed, 954 insertions(+), 310 deletions(-) create mode 100644 small/luci-app-ssr-plus/luasrc/view/shadowsocksr/backup_restore.htm create mode 100644 small/luci-app-ssr-plus/luasrc/view/shadowsocksr/log.htm create mode 100755 v2rayn/package-osx.sh diff --git a/.github/update.log b/.github/update.log index 893f6d952b..68e48acf86 100644 --- a/.github/update.log +++ b/.github/update.log @@ -867,3 +867,4 @@ Update On Thu Dec 26 19:33:24 CET 2024 Update On Fri Dec 27 19:34:25 CET 2024 Update On Sat Dec 28 19:30:54 CET 2024 Update On Sun Dec 29 19:30:34 CET 2024 +Update On Mon Dec 30 19:34:06 CET 2024 diff --git a/clash-meta/go.mod b/clash-meta/go.mod index 4d21fbb025..76b9b754a9 100644 --- a/clash-meta/go.mod +++ b/clash-meta/go.mod @@ -29,7 +29,7 @@ require ( github.com/metacubex/sing-tun v0.4.5 github.com/metacubex/sing-vmess v0.1.9-0.20240719134745-1df6fb20bbf9 github.com/metacubex/sing-wireguard v0.0.0-20241126021510-0827d417b589 - github.com/metacubex/tfo-go v0.0.0-20241006021335-daedaf0ca7aa + github.com/metacubex/tfo-go v0.0.0-20240830120620-c5e019b67785 github.com/metacubex/utls v1.6.6 github.com/metacubex/wireguard-go v0.0.0-20240922131502-c182e7471181 github.com/miekg/dns v1.1.62 diff --git a/clash-meta/go.sum b/clash-meta/go.sum index 1d874f38c8..35a809209f 100644 --- a/clash-meta/go.sum +++ b/clash-meta/go.sum @@ -126,8 +126,8 @@ github.com/metacubex/sing-vmess v0.1.9-0.20240719134745-1df6fb20bbf9 h1:OAXiCosq github.com/metacubex/sing-vmess v0.1.9-0.20240719134745-1df6fb20bbf9/go.mod h1:olVkD4FChQ5gKMHG4ZzuD7+fMkJY1G8vwOKpRehjrmY= github.com/metacubex/sing-wireguard v0.0.0-20241126021510-0827d417b589 h1:Z6bNy0HLTjx6BKIkV48sV/yia/GP8Bnyb5JQuGgSGzg= github.com/metacubex/sing-wireguard v0.0.0-20241126021510-0827d417b589/go.mod h1:4NclTLIZuk+QkHVCGrP87rHi/y8YjgPytxTgApJNMhc= -github.com/metacubex/tfo-go v0.0.0-20241006021335-daedaf0ca7aa h1:9mcjV+RGZVC3reJBNDjjNPyS8PmFG97zq56X7WNaFO4= -github.com/metacubex/tfo-go v0.0.0-20241006021335-daedaf0ca7aa/go.mod h1:4tLB5c8U0CxpkFM+AJJB77jEaVDbLH5XQvy42vAGsWw= +github.com/metacubex/tfo-go v0.0.0-20240830120620-c5e019b67785 h1:NNmI+ZV0DzNuqaAInRQuZFLHlWVuyHeow8jYpdKjHjo= +github.com/metacubex/tfo-go v0.0.0-20240830120620-c5e019b67785/go.mod h1:c7bVFM9f5+VzeZ/6Kg77T/jrg1Xp8QpqlSHvG/aXVts= github.com/metacubex/utls v1.6.6 h1:3D12YKHTf2Z41UPhQU2dWerNWJ5TVQD9gKoQ+H+iLC8= github.com/metacubex/utls v1.6.6/go.mod h1:+WLFUnXjcpdxXCnyX25nggw8C6YonZ8zOK2Zm/oRvdo= github.com/metacubex/wireguard-go v0.0.0-20240922131502-c182e7471181 h1:hJLQviGySBuaynlCwf/oYgIxbVbGRUIKZCxdya9YrbQ= diff --git a/clash-nyanpasu/frontend/nyanpasu/package.json b/clash-nyanpasu/frontend/nyanpasu/package.json index d9e47cc758..1d5ed38a33 100644 --- a/clash-nyanpasu/frontend/nyanpasu/package.json +++ b/clash-nyanpasu/frontend/nyanpasu/package.json @@ -40,7 +40,7 @@ "react-error-boundary": "5.0.0", "react-fast-marquee": "1.6.5", "react-hook-form-mui": "7.4.1", - "react-i18next": "15.3.0", + "react-i18next": "15.4.0", "react-markdown": "9.0.1", "react-split-grid": "1.0.4", "react-use": "17.6.0", diff --git a/clash-nyanpasu/frontend/ui/package.json b/clash-nyanpasu/frontend/ui/package.json index d29488d4d0..5971512800 100644 --- a/clash-nyanpasu/frontend/ui/package.json +++ b/clash-nyanpasu/frontend/ui/package.json @@ -32,7 +32,7 @@ "react": "19.0.0", "react-dom": "19.0.0", "react-error-boundary": "5.0.0", - "react-i18next": "15.3.0", + "react-i18next": "15.4.0", "react-use": "17.6.0", "vite": "6.0.6", "vite-tsconfig-paths": "5.1.4" diff --git a/clash-nyanpasu/pnpm-lock.yaml b/clash-nyanpasu/pnpm-lock.yaml index f5ffe12b4a..605667d914 100644 --- a/clash-nyanpasu/pnpm-lock.yaml +++ b/clash-nyanpasu/pnpm-lock.yaml @@ -284,8 +284,8 @@ importers: specifier: 7.4.1 version: 7.4.1(ezstqsbb2r4zi3rernt3lablby) react-i18next: - specifier: 15.3.0 - version: 15.3.0(i18next@24.2.0(typescript@5.7.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + specifier: 15.4.0 + version: 15.4.0(i18next@24.2.0(typescript@5.7.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react-markdown: specifier: 9.0.1 version: 9.0.1(@types/react@19.0.2)(react@19.0.0) @@ -483,8 +483,8 @@ importers: specifier: 5.0.0 version: 5.0.0(react@19.0.0) react-i18next: - specifier: 15.3.0 - version: 15.3.0(i18next@24.2.0(typescript@5.7.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + specifier: 15.4.0 + version: 15.4.0(i18next@24.2.0(typescript@5.7.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react-use: specifier: 17.6.0 version: 17.6.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -6701,8 +6701,8 @@ packages: peerDependencies: react: ^16.8.0 || ^17 || ^18 || ^19 - react-i18next@15.3.0: - resolution: {integrity: sha512-rEsdTx1L6a/XmqFHreDz4arGqjWtoGWg9IxZbScRBK5aXkTLK3rzRElifhNo/SuNIEsjLDwnhvblnlYZGckrIg==} + react-i18next@15.4.0: + resolution: {integrity: sha512-Py6UkX3zV08RTvL6ZANRoBh9sL/ne6rQq79XlkHEdd82cZr2H9usbWpUNVadJntIZP2pu3M2rL1CN+5rQYfYFw==} peerDependencies: i18next: '>= 23.2.3' react: '>= 16.8.0' @@ -14948,7 +14948,7 @@ snapshots: dependencies: react: 19.0.0 - react-i18next@15.3.0(i18next@24.2.0(typescript@5.7.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0): + react-i18next@15.4.0(i18next@24.2.0(typescript@5.7.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0): dependencies: '@babel/runtime': 7.26.0 html-parse-stringify: 3.0.1 diff --git a/hysteria/app/cmd/server.go b/hysteria/app/cmd/server.go index 1384dd8a10..5f2d56272a 100644 --- a/hysteria/app/cmd/server.go +++ b/hysteria/app/cmd/server.go @@ -238,6 +238,7 @@ type serverConfigMasqueradeFile struct { type serverConfigMasqueradeProxy struct { URL string `mapstructure:"url"` RewriteHost bool `mapstructure:"rewriteHost"` + Insecure bool `mapstructure:"insecure"` } type serverConfigMasqueradeString struct { @@ -810,6 +811,25 @@ func (c *serverConfig) fillMasqHandler(hyConfig *server.Config) error { if u.Scheme != "http" && u.Scheme != "https" { return configError{Field: "masquerade.proxy.url", Err: fmt.Errorf("unsupported protocol scheme \"%s\"", u.Scheme)} } + transport := http.DefaultTransport + if c.Masquerade.Proxy.Insecure { + transport = &http.Transport{ + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: true, + }, + // use default configs from http.DefaultTransport + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).DialContext, + ForceAttemptHTTP2: true, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + } + } handler = &httputil.ReverseProxy{ Rewrite: func(r *httputil.ProxyRequest) { r.SetURL(u) @@ -819,6 +839,7 @@ func (c *serverConfig) fillMasqHandler(hyConfig *server.Config) error { r.Out.Host = r.In.Host } }, + Transport: transport, ErrorHandler: func(w http.ResponseWriter, r *http.Request, err error) { logger.Error("HTTP reverse proxy error", zap.Error(err)) w.WriteHeader(http.StatusBadGateway) diff --git a/hysteria/app/cmd/server_test.go b/hysteria/app/cmd/server_test.go index bcf61c3526..5849a38cfc 100644 --- a/hysteria/app/cmd/server_test.go +++ b/hysteria/app/cmd/server_test.go @@ -171,6 +171,7 @@ func TestServerConfig(t *testing.T) { Proxy: serverConfigMasqueradeProxy{ URL: "https://some.site.net", RewriteHost: true, + Insecure: true, }, String: serverConfigMasqueradeString{ Content: "aint nothin here", diff --git a/hysteria/app/cmd/server_test.yaml b/hysteria/app/cmd/server_test.yaml index dda6d984ed..b989b97003 100644 --- a/hysteria/app/cmd/server_test.yaml +++ b/hysteria/app/cmd/server_test.yaml @@ -132,6 +132,7 @@ masquerade: proxy: url: https://some.site.net rewriteHost: true + insecure: true string: content: aint nothin here headers: diff --git a/hysteria/core/go.sum b/hysteria/core/go.sum index fdb5c639f9..3caf57a66c 100644 --- a/hysteria/core/go.sum +++ b/hysteria/core/go.sum @@ -59,6 +59,7 @@ golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= diff --git a/lede/package/utils/busybox/Makefile b/lede/package/utils/busybox/Makefile index 63da28be88..3724899fee 100644 --- a/lede/package/utils/busybox/Makefile +++ b/lede/package/utils/busybox/Makefile @@ -11,7 +11,7 @@ PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.busybox.net/downloads \ - http://sources.buildroot.net + https://sources.buildroot.net/$(PKG_NAME) PKG_HASH:=542750c8af7cb2630e201780b4f99f3dcceeb06f505b479ec68241c1e6af61a5 PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam diff --git a/mihomo/go.mod b/mihomo/go.mod index 4d21fbb025..76b9b754a9 100644 --- a/mihomo/go.mod +++ b/mihomo/go.mod @@ -29,7 +29,7 @@ require ( github.com/metacubex/sing-tun v0.4.5 github.com/metacubex/sing-vmess v0.1.9-0.20240719134745-1df6fb20bbf9 github.com/metacubex/sing-wireguard v0.0.0-20241126021510-0827d417b589 - github.com/metacubex/tfo-go v0.0.0-20241006021335-daedaf0ca7aa + github.com/metacubex/tfo-go v0.0.0-20240830120620-c5e019b67785 github.com/metacubex/utls v1.6.6 github.com/metacubex/wireguard-go v0.0.0-20240922131502-c182e7471181 github.com/miekg/dns v1.1.62 diff --git a/mihomo/go.sum b/mihomo/go.sum index 1d874f38c8..35a809209f 100644 --- a/mihomo/go.sum +++ b/mihomo/go.sum @@ -126,8 +126,8 @@ github.com/metacubex/sing-vmess v0.1.9-0.20240719134745-1df6fb20bbf9 h1:OAXiCosq github.com/metacubex/sing-vmess v0.1.9-0.20240719134745-1df6fb20bbf9/go.mod h1:olVkD4FChQ5gKMHG4ZzuD7+fMkJY1G8vwOKpRehjrmY= github.com/metacubex/sing-wireguard v0.0.0-20241126021510-0827d417b589 h1:Z6bNy0HLTjx6BKIkV48sV/yia/GP8Bnyb5JQuGgSGzg= github.com/metacubex/sing-wireguard v0.0.0-20241126021510-0827d417b589/go.mod h1:4NclTLIZuk+QkHVCGrP87rHi/y8YjgPytxTgApJNMhc= -github.com/metacubex/tfo-go v0.0.0-20241006021335-daedaf0ca7aa h1:9mcjV+RGZVC3reJBNDjjNPyS8PmFG97zq56X7WNaFO4= -github.com/metacubex/tfo-go v0.0.0-20241006021335-daedaf0ca7aa/go.mod h1:4tLB5c8U0CxpkFM+AJJB77jEaVDbLH5XQvy42vAGsWw= +github.com/metacubex/tfo-go v0.0.0-20240830120620-c5e019b67785 h1:NNmI+ZV0DzNuqaAInRQuZFLHlWVuyHeow8jYpdKjHjo= +github.com/metacubex/tfo-go v0.0.0-20240830120620-c5e019b67785/go.mod h1:c7bVFM9f5+VzeZ/6Kg77T/jrg1Xp8QpqlSHvG/aXVts= github.com/metacubex/utls v1.6.6 h1:3D12YKHTf2Z41UPhQU2dWerNWJ5TVQD9gKoQ+H+iLC8= github.com/metacubex/utls v1.6.6/go.mod h1:+WLFUnXjcpdxXCnyX25nggw8C6YonZ8zOK2Zm/oRvdo= github.com/metacubex/wireguard-go v0.0.0-20240922131502-c182e7471181 h1:hJLQviGySBuaynlCwf/oYgIxbVbGRUIKZCxdya9YrbQ= diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua index 5bc2531082..b185a4dbd7 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua @@ -1,12 +1,12 @@ local api = require "luci.passwall.api" local appname = "passwall" -local uci = api.libuci +local fs = api.fs local sys = api.sys local has_singbox = api.finded_com("singbox") local has_xray = api.finded_com("xray") -local has_gfwlist = api.fs.access("/usr/share/passwall/rules/gfwlist") -local has_chnlist = api.fs.access("/usr/share/passwall/rules/chnlist") -local has_chnroute = api.fs.access("/usr/share/passwall/rules/chnroute") +local has_gfwlist = fs.access("/usr/share/passwall/rules/gfwlist") +local has_chnlist = fs.access("/usr/share/passwall/rules/chnlist") +local has_chnroute = fs.access("/usr/share/passwall/rules/chnroute") local port_validate = function(self, value, t) return value:gsub("-", ":") @@ -146,7 +146,7 @@ end sources.write = dynamicList_write ---- TCP No Redir Ports -local TCP_NO_REDIR_PORTS = uci:get(appname, "@global_forwarding[0]", "tcp_no_redir_ports") +local TCP_NO_REDIR_PORTS = m.uci:get(appname, "@global_forwarding[0]", "tcp_no_redir_ports") o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports")) o:value("", translate("Use global config") .. "(" .. TCP_NO_REDIR_PORTS .. ")") o:value("disable", translate("No patterns are used")) @@ -154,7 +154,7 @@ o:value("1:65535", translate("All")) o.validate = port_validate ---- UDP No Redir Ports -local UDP_NO_REDIR_PORTS = uci:get(appname, "@global_forwarding[0]", "udp_no_redir_ports") +local UDP_NO_REDIR_PORTS = m.uci:get(appname, "@global_forwarding[0]", "udp_no_redir_ports") o = s:option(Value, "udp_no_redir_ports", translate("UDP No Redir Ports"), "" .. translate("Fill in the ports you don't want to be forwarded by the agent, with the highest priority.") .. @@ -203,7 +203,7 @@ o.value = "1" o:depends({ udp_node = "", ['!reverse'] = true }) ---- TCP Proxy Drop Ports -local TCP_PROXY_DROP_PORTS = uci:get(appname, "@global_forwarding[0]", "tcp_proxy_drop_ports") +local TCP_PROXY_DROP_PORTS = m.uci:get(appname, "@global_forwarding[0]", "tcp_proxy_drop_ports") o = s:option(Value, "tcp_proxy_drop_ports", translate("TCP Proxy Drop Ports")) o:value("", translate("Use global config") .. "(" .. TCP_PROXY_DROP_PORTS .. ")") o:value("disable", translate("No patterns are used")) @@ -212,7 +212,7 @@ o:depends({ use_global_config = true }) o:depends({ _tcp_node_bool = "1" }) ---- UDP Proxy Drop Ports -local UDP_PROXY_DROP_PORTS = uci:get(appname, "@global_forwarding[0]", "udp_proxy_drop_ports") +local UDP_PROXY_DROP_PORTS = m.uci:get(appname, "@global_forwarding[0]", "udp_proxy_drop_ports") o = s:option(Value, "udp_proxy_drop_ports", translate("UDP Proxy Drop Ports")) o:value("", translate("Use global config") .. "(" .. UDP_PROXY_DROP_PORTS .. ")") o:value("disable", translate("No patterns are used")) @@ -222,7 +222,7 @@ o:depends({ use_global_config = true }) o:depends({ _tcp_node_bool = "1" }) ---- TCP Redir Ports -local TCP_REDIR_PORTS = uci:get(appname, "@global_forwarding[0]", "tcp_redir_ports") +local TCP_REDIR_PORTS = m.uci:get(appname, "@global_forwarding[0]", "tcp_redir_ports") o = s:option(Value, "tcp_redir_ports", translate("TCP Redir Ports"), translatef("Only work with using the %s node.", "TCP")) o:value("", translate("Use global config") .. "(" .. TCP_REDIR_PORTS .. ")") o:value("1:65535", translate("All")) @@ -234,7 +234,7 @@ o:depends({ use_global_config = true }) o:depends({ _tcp_node_bool = "1" }) ---- UDP Redir Ports -local UDP_REDIR_PORTS = uci:get(appname, "@global_forwarding[0]", "udp_redir_ports") +local UDP_REDIR_PORTS = m.uci:get(appname, "@global_forwarding[0]", "udp_redir_ports") o = s:option(Value, "udp_redir_ports", translate("UDP Redir Ports"), translatef("Only work with using the %s node.", "UDP")) o:value("", translate("Use global config") .. "(" .. UDP_REDIR_PORTS .. ")") o:value("1:65535", translate("All")) diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua index d8719bb47e..4168039c24 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -1,12 +1,12 @@ local api = require "luci.passwall.api" local appname = "passwall" -local uci = api.libuci local datatypes = api.datatypes +local fs = api.fs local has_singbox = api.finded_com("singbox") local has_xray = api.finded_com("xray") -local has_gfwlist = api.fs.access("/usr/share/passwall/rules/gfwlist") -local has_chnlist = api.fs.access("/usr/share/passwall/rules/chnlist") -local has_chnroute = api.fs.access("/usr/share/passwall/rules/chnroute") +local has_gfwlist = fs.access("/usr/share/passwall/rules/gfwlist") +local has_chnlist = fs.access("/usr/share/passwall/rules/chnlist") +local has_chnroute = fs.access("/usr/share/passwall/rules/chnroute") local chinadns_tls = os.execute("chinadns-ng -V | grep -i wolfssl >/dev/null") m = Map(appname) @@ -37,13 +37,13 @@ end local socks_list = {} -local tcp_socks_server = "127.0.0.1" .. ":" .. (uci:get(appname, "@global[0]", "tcp_node_socks_port") or "1070") +local tcp_socks_server = "127.0.0.1" .. ":" .. (m.uci:get(appname, "@global[0]", "tcp_node_socks_port") or "1070") local socks_table = {} socks_table[#socks_table + 1] = { id = tcp_socks_server, remark = tcp_socks_server .. " - " .. translate("TCP Node") } -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s.enabled == "1" and s.node then local id, remark for k, n in pairs(nodes_table) do @@ -199,7 +199,7 @@ if (has_singbox or has_xray) and #nodes_table > 0 then type:depends("tcp_node", "__hide") --不存在的依赖,即始终隐藏 end - uci:foreach(appname, "shunt_rules", function(e) + m.uci:foreach(appname, "shunt_rules", function(e) local id = e[".name"] local node_option = vid .. "-" .. id .. "_node" if id and e.remarks then @@ -594,7 +594,7 @@ o = s:taboption("DNS", Flag, "dns_redirect", translate("DNS Redirect"), translat o.default = "1" o.rmempty = false -if (uci:get(appname, "@global_forwarding[0]", "use_nft") or "0") == "1" then +if (m.uci:get(appname, "@global_forwarding[0]", "use_nft") or "0") == "1" then o = s:taboption("DNS", Button, "clear_ipset", translate("Clear NFTSET"), translate("Try this feature if the rule modification does not take effect.")) else o = s:taboption("DNS", Button, "clear_ipset", translate("Clear IPSET"), translate("Try this feature if the rule modification does not take effect.")) @@ -729,7 +729,7 @@ o.rmempty = false o = s2:option(ListValue, "node", translate("Socks Node")) local n = 1 -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s[".name"] == section then return false end diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua index effc8fa2d3..40a77bf848 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua @@ -1,8 +1,7 @@ local api = require "luci.passwall.api" local appname = "passwall" -local sys = api.sys -local net = require "luci.model.network".init() local datatypes = api.datatypes +local net = require "luci.model.network".init() local nodes_table = {} for k, e in ipairs(api.get_valid_nodes()) do diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua index 5c9abb15b5..094b1dfd2e 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua @@ -271,7 +271,7 @@ o.remove = function(self, section, value) fs.writefile(hosts, "") end -if api.fs.access(gfwlist_path) then +if fs.access(gfwlist_path) then s:tab("gfw_list", translate("GFW List")) o = s:taboption("gfw_list", DummyValue, "_gfw_fieldset") o.rawhtml = true @@ -284,7 +284,7 @@ if api.fs.access(gfwlist_path) then ]], translate("Read List")) end -if api.fs.access(chnlist_path) then +if fs.access(chnlist_path) then s:tab("chn_list", translate("China List") .. "(" .. translate("Domain") .. ")") o = s:taboption("chn_list", DummyValue, "_chn_fieldset") o.rawhtml = true @@ -297,7 +297,7 @@ if api.fs.access(chnlist_path) then ]], translate("Read List")) end -if api.fs.access(chnroute_path) then +if fs.access(chnroute_path) then s:tab("chnroute_list", translate("China List") .. "(IP)") o = s:taboption("chnroute_list", DummyValue, "_chnroute_fieldset") o.rawhtml = true diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua index b7afc57f16..187beaaa3b 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua @@ -1,6 +1,5 @@ local api = require "luci.passwall.api" local appname = "passwall" -local uci = api.libuci local has_singbox = api.finded_com("singbox") local has_xray = api.finded_com("xray") @@ -23,7 +22,7 @@ o.rmempty = false local auto_switch_tip local current_node = api.get_cache_var("socks_" .. arg[1]) if current_node then - local n = uci:get_all(appname, current_node) + local n = m.uci:get_all(appname, current_node) if n then if tonumber(m:get(arg[1], "enable_autoswitch") or 0) == 1 then if n then @@ -44,7 +43,7 @@ o = s:option(Flag, "bind_local", translate("Bind Local"), translate("When select o.default = "0" local n = 1 -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s[".name"] == section then return false end diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua index ddc998a3c0..7cb119bb9c 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua @@ -8,7 +8,6 @@ end local appname = "passwall" local jsonc = api.jsonc -local uci = api.libuci local type_name = "Xray" @@ -19,7 +18,7 @@ local function _n(name) end local ss_method_list = { - "aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "xchacha20-poly1305", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" + "aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" } local security_list = { "none", "auto", "aes-128-gcm", "chacha20-poly1305", "zero" } @@ -86,7 +85,7 @@ for k, e in ipairs(api.get_valid_nodes()) do end local socks_list = {} -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s.enabled == "1" and s.node then socks_list[#socks_list + 1] = { id = "Socks_" .. s[".name"], @@ -181,7 +180,7 @@ if #nodes_table > 0 then o:value(v.id, v.remark) end end -uci:foreach(appname, "shunt_rules", function(e) +m.uci:foreach(appname, "shunt_rules", function(e) if e[".name"] and e.remarks then o = s:option(ListValue, _n(e[".name"]), string.format('* %s', api.url("shunt_rules", e[".name"]), e.remarks)) o:value("", translate("Close")) diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua index 40eb13ce4f..7e5ee34a65 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua @@ -11,7 +11,6 @@ end local singbox_tags = luci.sys.exec(singbox_bin .. " version | grep 'Tags:' | awk '{print $2}'") local appname = "passwall" -local uci = api.libuci local type_name = "sing-box" @@ -83,7 +82,7 @@ for k, e in ipairs(api.get_valid_nodes()) do end local socks_list = {} -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s.enabled == "1" and s.node then socks_list[#socks_list + 1] = { id = "Socks_" .. s[".name"], @@ -109,7 +108,7 @@ if #nodes_table > 0 then o:value(v.id, v.remark) end end -uci:foreach(appname, "shunt_rules", function(e) +m.uci:foreach(appname, "shunt_rules", function(e) if e[".name"] and e.remarks then o = s:option(ListValue, _n(e[".name"]), string.format('* %s', api.url("shunt_rules", e[".name"]), e.remarks)) o:value("", translate("Close")) diff --git a/openwrt-passwall/luci-app-passwall/luasrc/passwall/util_xray.lua b/openwrt-passwall/luci-app-passwall/luasrc/passwall/util_xray.lua index d26ac1b123..bd8ff36c42 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -246,7 +246,9 @@ function gen_outbound(flag, node, tag, proxy_table) { address = node.address, port = tonumber(node.port), - method = node.method or nil, + method = (node.method == "chacha20-ietf-poly1305" and "chacha20-poly1305") or + (node.method == "xchacha20-ietf-poly1305" and "xchacha20-poly1305") or + (node.method ~= "" and node.method) or nil, ivCheck = (node.protocol == "shadowsocks") and node.iv_check == "1" or nil, uot = (node.protocol == "shadowsocks") and node.uot == "1" or nil, password = node.password or "", diff --git a/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm b/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm index d34003a99b..5177cf8f7a 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm +++ b/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm @@ -2,7 +2,7 @@ <% local api = require "luci.passwall.api" local appname = 'passwall' -local uci = api.libuci +local uci = self.map.uci local ss_type = uci:get(appname, "@global_subscribe[0]", "ss_type") or "xray" local trojan_type = uci:get(appname, "@global_subscribe[0]", "trojan_type") or "xray" local vmess_type = uci:get(appname, "@global_subscribe[0]", "vmess_type") or "xray" @@ -766,17 +766,19 @@ local hysteria2_type = uci:get(appname, "@global_subscribe[0]", "hysteria2_type" dom_prefix = "xray_" opt.set('type', "Xray"); opt.set(dom_prefix + 'protocol', "shadowsocks"); - method = method.toLowerCase() === "chacha20-ietf-poly1305" ? "chacha20-poly1305" : method; } else { if (["2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305"].includes(method)) { dom_prefix = "ssrust_" opt.set('type', "SS-Rust"); - method = method.toLowerCase() === "chacha20-poly1305" ? "chacha20-ietf-poly1305" : method; } else { dom_prefix = "ss_" opt.set('type', "SS"); } } + if (ss_type !== "xray") { + method = method.toLowerCase() === "chacha20-poly1305" ? "chacha20-ietf-poly1305" : method; + method = method.toLowerCase() === "xchacha20-poly1305" ? "xchacha20-ietf-poly1305" : method; + } opt.set(dom_prefix + 'address', server); opt.set(dom_prefix + 'port', port); opt.set(dom_prefix + 'password', password || ""); @@ -903,6 +905,10 @@ local hysteria2_type = uci:get(appname, "@global_subscribe[0]", "hysteria2_type" dom_prefix = "ss_" opt.set('type', "SS"); } + if (ss_type !== "xray") { + method = method.toLowerCase() === "chacha20-poly1305" ? "chacha20-ietf-poly1305" : method; + method = method.toLowerCase() === "xchacha20-poly1305" ? "xchacha20-ietf-poly1305" : method; + } var sstr = b64decsafe(url0); var team = sstr.split('@'); var part1 = team[0].split(':'); diff --git a/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/subscribe.lua index 3058877108..a0232d6075 100755 --- a/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -639,12 +639,9 @@ local function processData(szType, content, add_mode, add_from) result.protocol = 'shadowsocks' end - if result.type == "SS-Rust" and method:lower() == "chacha20-poly1305" then - result.method = "chacha20-ietf-poly1305" - end - - if result.type == "Xray" and method:lower() == "chacha20-ietf-poly1305" then - result.method = "chacha20-poly1305" + if result.type ~= "Xray" then + result.method = (method:lower() == "chacha20-poly1305" and "chacha20-ietf-poly1305") or + (method:lower() == "xchacha20-poly1305" and "xchacha20-ietf-poly1305") or method end if result.plugin then diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl.lua index 1eb1ac5425..3df0c9f755 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl.lua @@ -1,7 +1,6 @@ local api = require "luci.passwall2.api" local appname = api.appname local sys = api.sys -local has_chnlist = api.fs.access("/usr/share/passwall2/rules/chnlist") m = Map(appname) api.set_apply_on_parse(m) diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua index 1cf892a5df..b4064555f5 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua @@ -1,6 +1,5 @@ local api = require "luci.passwall2.api" local appname = api.appname -local uci = api.uci local sys = api.sys local port_validate = function(self, value, t) @@ -163,7 +162,7 @@ end sources.write = dynamicList_write ---- TCP No Redir Ports -local TCP_NO_REDIR_PORTS = uci:get(appname, "@global_forwarding[0]", "tcp_no_redir_ports") +local TCP_NO_REDIR_PORTS = m:get("@global_forwarding[0]", "tcp_no_redir_ports") o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports")) o:value("", translate("Use global config") .. "(" .. TCP_NO_REDIR_PORTS .. ")") o:value("disable", translate("No patterns are used")) @@ -171,7 +170,7 @@ o:value("1:65535", translate("All")) o.validate = port_validate ---- UDP No Redir Ports -local UDP_NO_REDIR_PORTS = uci:get(appname, "@global_forwarding[0]", "udp_no_redir_ports") +local UDP_NO_REDIR_PORTS = m:get("@global_forwarding[0]", "udp_no_redir_ports") o = s:option(Value, "udp_no_redir_ports", translate("UDP No Redir Ports"), "" .. translate("If you don't want to let the device in the list to go proxy, please choose all.") .. @@ -189,8 +188,8 @@ if TCP_NO_REDIR_PORTS == "1:65535" and UDP_NO_REDIR_PORTS == "1:65535" then o:depends({ tcp_no_redir_ports = "", udp_no_redir_ports = "" }) end -local GLOBAL_ENABLED = uci:get(appname, "@global[0]", "enabled") -local NODE = uci:get(appname, "@global[0]", "node") +local GLOBAL_ENABLED = m:get("@global[0]", "enabled") +local NODE = m:get("@global[0]", "node") o = s:option(ListValue, "node", "" .. translate("Node") .. "") if GLOBAL_ENABLED == "1" and NODE then o:value("", translate("Use global config") .. "(" .. api.get_node_name(NODE) .. ")") @@ -211,7 +210,7 @@ o.value = "1" o:depends({ __hide = true }) ---- TCP Redir Ports -local TCP_REDIR_PORTS = uci:get(appname, "@global_forwarding[0]", "tcp_redir_ports") +local TCP_REDIR_PORTS = m:get("@global_forwarding[0]", "tcp_redir_ports") o = s:option(Value, "tcp_redir_ports", translate("TCP Redir Ports")) o:value("", translate("Use global config") .. "(" .. TCP_REDIR_PORTS .. ")") o:value("1:65535", translate("All")) @@ -221,7 +220,7 @@ o.validate = port_validate o:depends({ _hide_node_option = "1", ['!reverse'] = true }) ---- UDP Redir Ports -local UDP_REDIR_PORTS = uci:get(appname, "@global_forwarding[0]", "udp_redir_ports") +local UDP_REDIR_PORTS = m:get("@global_forwarding[0]", "udp_redir_ports") o = s:option(Value, "udp_redir_ports", translate("UDP Redir Ports")) o:value("", translate("Use global config") .. "(" .. UDP_REDIR_PORTS .. ")") o:value("1:65535", translate("All")) @@ -280,6 +279,9 @@ o = s:option(Value, "remote_dns_client_ip", translate("Remote DNS EDNS Client Su o.description = translate("Notify the DNS server when the DNS query is notified, the location of the client (cannot be a private IP address).") .. "
" .. translate("This feature requires the DNS server to support the Edns Client Subnet (RFC7871).") o.datatype = "ipaddr" +o:depends("remote_dns_protocol", "tcp") +o:depends("remote_dns_protocol", "doh") +o:depends("remote_dns_protocol", "udp") o = s:option(ListValue, "remote_dns_detour", translate("Remote DNS Outbound")) o.default = "remote" diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua index 6db24429a1..a8937fe72f 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua @@ -1,6 +1,5 @@ local api = require "luci.passwall2.api" local appname = api.appname -local uci = api.uci local datatypes = api.datatypes local has_singbox = api.finded_com("singbox") local has_xray = api.finded_com("xray") @@ -33,7 +32,7 @@ for k, v in pairs(nodes_table) do end local socks_list = {} -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s.enabled == "1" and s.node then socks_list[#socks_list + 1] = { id = "Socks_" .. s[".name"], @@ -66,8 +65,7 @@ end m:append(Template(appname .. "/global/status")) -local global_cfgid = uci:get_all(appname, "@global[0]")[".name"] - +local global_cfgid = m:get("@global[0]")[".name"] s = m:section(TypedSection, "global") s.anonymous = true s.addremove = false @@ -150,7 +148,7 @@ if (has_singbox or has_xray) and #nodes_table > 0 then type:depends({ __hide = true }) --不存在的依赖,即始终隐藏 end - uci:foreach(appname, "shunt_rules", function(e) + m.uci:foreach(appname, "shunt_rules", function(e) local id = e[".name"] local node_option = vid .. "-" .. id .. "_node" if id and e.remarks then @@ -400,7 +398,7 @@ o.rmempty = false o = s2:option(ListValue, "node", translate("Socks Node")) local n = 1 -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s[".name"] == section then return false end diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/haproxy.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/haproxy.lua index 1fc9806c30..b0c8b04ee7 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/haproxy.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/haproxy.lua @@ -1,8 +1,7 @@ local api = require "luci.passwall2.api" local appname = api.appname -local sys = api.sys -local net = require "luci.model.network".init() local datatypes = api.datatypes +local net = require "luci.model.network".init() local nodes_table = {} for k, e in ipairs(api.get_valid_nodes()) do diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_config.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_config.lua index 611765bc50..0486f526bb 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_config.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_config.lua @@ -1,17 +1,14 @@ local api = require "luci.passwall2.api" local appname = api.appname -local uci = api.uci -local fs = require "nixio.fs" -local types_dir = "/usr/lib/lua/luci/model/cbi/passwall2/client/type/" - -if not arg[1] or not uci:get(appname, arg[1]) then - luci.http.redirect(api.url("node_list")) -end m = Map(appname, translate("Node Config")) m.redirect = api.url() api.set_apply_on_parse(m) +if not arg[1] or not m:get(arg[1]) then + luci.http.redirect(api.url("node_list")) +end + s = m:section(NamedSection, arg[1], "nodes", "") s.addremove = false s.dynamic = false @@ -25,6 +22,9 @@ o = s:option(Value, "remarks", translate("Node Remarks")) o.default = translate("Remarks") o.rmempty = false +local fs = require "nixio.fs" +local types_dir = "/usr/lib/lua/luci/model/cbi/passwall2/client/type/" + o = s:option(ListValue, "type", translate("Type")) local type_table = {} diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_list.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_list.lua index 90ffb47bbc..75bac734a8 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_list.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_list.lua @@ -1,7 +1,7 @@ local api = require "luci.passwall2.api" local appname = api.appname -local sys = api.sys local datatypes = api.datatypes +local sys = api.sys m = Map(appname) api.set_apply_on_parse(m) diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/other.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/other.lua index 7bbe82378b..2f66f7616c 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/other.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/other.lua @@ -1,7 +1,6 @@ local api = require "luci.passwall2.api" local appname = api.appname local fs = api.fs -local uci = api.uci local has_singbox = api.finded_com("singbox") local has_xray = api.finded_com("xray") local has_fw3 = api.is_finded("fw3") diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/socks_config.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/socks_config.lua index d47cea1e8e..e5bc0ca9de 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/socks_config.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/socks_config.lua @@ -1,6 +1,5 @@ local api = require "luci.passwall2.api" local appname = api.appname -local uci = api.uci local has_singbox = api.finded_com("singbox") local has_xray = api.finded_com("xray") @@ -24,7 +23,7 @@ o.rmempty = false local auto_switch_tip local current_node = api.get_cache_var("socks_" .. arg[1]) if current_node then - local n = uci:get_all(appname, current_node) + local n = m:get(current_node) if n then if tonumber(m:get(arg[1], "enable_autoswitch") or 0) == 1 then if n then @@ -45,7 +44,7 @@ o = s:option(Flag, "bind_local", translate("Bind Local"), translate("When select o.default = "0" local n = 1 -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s[".name"] == section then return false end diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/ray.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/ray.lua index b2e2b61a70..b10af78282 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/ray.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/ray.lua @@ -8,7 +8,6 @@ end local appname = api.appname local jsonc = api.jsonc -local uci = api.uci local type_name = "Xray" @@ -19,7 +18,7 @@ local function _n(name) end local ss_method_list = { - "aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "xchacha20-poly1305", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" + "aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" } local security_list = { "none", "auto", "aes-128-gcm", "chacha20-poly1305", "zero" } @@ -86,7 +85,7 @@ for k, e in ipairs(api.get_valid_nodes()) do end local socks_list = {} -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s.enabled == "1" and s.node then socks_list[#socks_list + 1] = { id = "Socks_" .. s[".name"], @@ -184,7 +183,7 @@ if #nodes_table > 0 then o.default = o.keylist[1] end end -uci:foreach(appname, "shunt_rules", function(e) +m.uci:foreach(appname, "shunt_rules", function(e) if e[".name"] and e.remarks then o = s:option(ListValue, _n(e[".name"]), string.format('* %s', api.url("shunt_rules", e[".name"]), e.remarks)) o:value("", translate("Close")) @@ -336,8 +335,10 @@ o:depends({ [_n("protocol")] = "shadowsocks" }) o = s:option(Flag, _n("reality"), translate("REALITY")) o.default = 0 o:depends({ [_n("tls")] = true, [_n("transport")] = "raw" }) -o:depends({ [_n("tls")] = true, [_n("transport")] = "h2" }) +o:depends({ [_n("tls")] = true, [_n("transport")] = "ws" }) +o:depends({ [_n("tls")] = true, [_n("transport")] = "quic" }) o:depends({ [_n("tls")] = true, [_n("transport")] = "grpc" }) +o:depends({ [_n("tls")] = true, [_n("transport")] = "httpupgrade" }) o:depends({ [_n("tls")] = true, [_n("transport")] = "xhttp" }) o = s:option(ListValue, _n("alpn"), translate("alpn")) @@ -349,7 +350,7 @@ o:value("h3,h2") o:value("http/1.1") o:value("h2,http/1.1") o:value("h3,h2,http/1.1") -o:depends({ [_n("tls")] = true, [_n("reality")] = false }) +o:depends({ [_n("tls")] = true }) -- o = s:option(Value, _n("minversion"), translate("minversion")) -- o.default = "1.3" diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua index f3f3232b7e..db866d78a8 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua @@ -11,7 +11,6 @@ end local singbox_tags = luci.sys.exec(singbox_bin .. " version | grep 'Tags:' | awk '{print $2}'") local appname = api.appname -local uci = api.uci local type_name = "sing-box" @@ -83,7 +82,7 @@ for k, e in ipairs(api.get_valid_nodes()) do end local socks_list = {} -uci:foreach(appname, "socks", function(s) +m.uci:foreach(appname, "socks", function(s) if s.enabled == "1" and s.node then socks_list[#socks_list + 1] = { id = "Socks_" .. s[".name"], @@ -112,7 +111,7 @@ if #nodes_table > 0 then o.default = o.keylist[1] end end -uci:foreach(appname, "shunt_rules", function(e) +m.uci:foreach(appname, "shunt_rules", function(e) if e[".name"] and e.remarks then o = s:option(ListValue, _n(e[".name"]), string.format('* %s', api.url("shunt_rules", e[".name"]), e.remarks)) o:value("", translate("Close")) diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/passwall2/util_xray.lua b/openwrt-passwall2/luci-app-passwall2/luasrc/passwall2/util_xray.lua index 028dc7c7b2..68cc72ff40 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/passwall2/util_xray.lua +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/passwall2/util_xray.lua @@ -243,7 +243,9 @@ function gen_outbound(flag, node, tag, proxy_table) { address = node.address, port = tonumber(node.port), - method = node.method or nil, + method = (node.method == "chacha20-ietf-poly1305" and "chacha20-poly1305") or + (node.method == "xchacha20-ietf-poly1305" and "xchacha20-poly1305") or + (node.method ~= "" and node.method) or nil, ivCheck = (node.protocol == "shadowsocks") and node.iv_check == "1" or nil, uot = (node.protocol == "shadowsocks") and node.uot == "1" or nil, password = node.password or "", diff --git a/openwrt-passwall2/luci-app-passwall2/luasrc/view/passwall2/node_list/link_share_man.htm b/openwrt-passwall2/luci-app-passwall2/luasrc/view/passwall2/node_list/link_share_man.htm index 1f72fa3b6f..2cd22fb76c 100644 --- a/openwrt-passwall2/luci-app-passwall2/luasrc/view/passwall2/node_list/link_share_man.htm +++ b/openwrt-passwall2/luci-app-passwall2/luasrc/view/passwall2/node_list/link_share_man.htm @@ -1,13 +1,24 @@ <%+cbi/valueheader%> <% local api = require "luci.passwall2.api" +local map = self.map +local ss_type = map:get("@global_subscribe[0]", "ss_type") or "shadowsocks-libev" +local trojan_type = map:get("@global_subscribe[0]", "trojan_type") or "xray" +local vmess_type = map:get("@global_subscribe[0]", "vmess_type") or "xray" +local vless_type = map:get("@global_subscribe[0]", "vless_type") or "xray" +local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sing-box" -%> +<%+cbi/valuefooter%> diff --git a/small/luci-app-ssr-plus/luasrc/view/shadowsocksr/log.htm b/small/luci-app-ssr-plus/luasrc/view/shadowsocksr/log.htm new file mode 100644 index 0000000000..251f14b22b --- /dev/null +++ b/small/luci-app-ssr-plus/luasrc/view/shadowsocksr/log.htm @@ -0,0 +1,37 @@ +<% +local dsp = require "luci.dispatcher" +-%> + +
+ + +
diff --git a/small/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/small/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm index f3d9f15ae7..2607fb7084 100644 --- a/small/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm +++ b/small/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm @@ -217,8 +217,9 @@ function import_ssr_url(btn, urlname, sid) { case "trojan": try { var url = new URL("http://" + ssu[1]); + var params = url.searchParams; } catch(e) { - alert(e) + alert(e); return false; } @@ -232,7 +233,65 @@ function import_ssr_url(btn, urlname, sid) { document.getElementsByName('cbid.shadowsocksr.' + sid + '.password')[0].value = decodeURIComponent(url.username); document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].checked = true; document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].dispatchEvent(event); - document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = url.searchParams.get("sni"); + document.getElementsByName('cbid.shadowsocksr.' + sid + '.fingerprint')[0].value = params.get("fp") || ""; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = params.get("sni"); + if (params.get("allowInsecure") === "1") { + document.getElementsByName('cbid.shadowsocksr.' + sid + '.insecure')[0].checked = true; // 设置 insecure 为 true + document.getElementsByName('cbid.shadowsocksr.' + sid + '.insecure')[0].dispatchEvent(event); // 触发事件 + } + document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value = + params.get("type") == "http" ? "h2" : + (["tcp", "raw"].includes(params.get("type")) ? "raw" : + (params.get("type") || "raw")); + document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].dispatchEvent(event); + switch (params.get("type")) { + case "ws": + if (params.get("security") !== "tls") { + setElementValue('cbid.shadowsocksr.' + sid + '.ws_host', params.get("host") ? decodeURIComponent(params.get("host")) : ""); + } + setElementValue('cbid.shadowsocksr.' + sid + '.ws_path', params.get("path") ? decodeURIComponent(params.get("path")) : "/"); + break; + case "httpupgrade": + if (params.get("security") !== "tls") { + document.getElementsByName('cbid.shadowsocksr.' + sid + '.httpupgrade_host')[0].value = params.get("host") ? decodeURIComponent(params.get("host")) : ""; + } + document.getElementsByName('cbid.shadowsocksr.' + sid + '.httpupgrade_path')[0].value = params.get("path") ? decodeURIComponent(params.get("path")) : "/"; + break; + case "splithttp": + if (params.get("security") !== "tls") { + document.getElementsByName('cbid.shadowsocksr.' + sid + '.splithttp_host')[0].value = params.get("host") ? decodeURIComponent(params.get("host")) : ""; + } + document.getElementsByName('cbid.shadowsocksr.' + sid + '.splithttp_path')[0].value = params.get("path") ? decodeURIComponent(params.get("path")) : "/"; + break; + case "kcp": + document.getElementsByName('cbid.shadowsocksr.' + sid + '.kcp_guise')[0].value = params.get("headerType") || "none"; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.seed')[0].value = params.get("seed") || ""; + break; + case "http": + /* this is non-standard, bullshit */ + case "h2": + document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_host')[0].value = params.get("host") ? decodeURIComponent(params.get("host")) : ""; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_path')[0].value = params.get("path") ? decodeURIComponent(params.get("path")) : ""; + break; + case "quic": + document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_guise')[0].value = params.get("headerType") || "none"; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_security')[0].value = params.get("quicSecurity") || "none"; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_key')[0].value = params.get("key") || ""; + break; + case "grpc": + document.getElementsByName('cbid.shadowsocksr.' + sid + '.serviceName')[0].value = params.get("serviceName") || ""; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.grpc_mode')[0].value = params.get("mode") || "gun"; + break; + case "raw": + case "tcp": + document.getElementsByName('cbid.shadowsocksr.' + sid + '.tcp_guise')[0].value = params.get("headerType") || "none"; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.tcp_guise')[0].dispatchEvent(event); + if (params.get("headerType") === "http") { + document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_host')[0].value = params.get("host") ? decodeURIComponent(params.get("host")) : ""; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_path')[0].value = params.get("path") ? decodeURIComponent(params.get("path")) : ""; + } + break; + } s.innerHTML = "<%:Import configuration information successfully.%>"; return false; @@ -306,7 +365,7 @@ function import_ssr_url(btn, urlname, sid) { var url = new URL("http://" + ssu[1]); var params = url.searchParams; } catch(e) { - alert(e) + alert(e); return false; } // Check if the elements exist before trying to modify them @@ -336,7 +395,7 @@ function import_ssr_url(btn, urlname, sid) { setElementValue('cbid.shadowsocksr.' + sid + '.vmess_id', url.username); setElementValue('cbid.shadowsocksr.' + sid + '.transport', params.get("type") === "http" ? "h2" : - (["tcp", "raw"].includes(params.get("type")) ? "raw" : + (["tcp", "raw"].includes(params.get("type")) ? "raw" : (params.get("type") || "tcp")) ); dispatchEventIfExists('cbid.shadowsocksr.' + sid + '.transport', event); diff --git a/small/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po b/small/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po index 69dae19585..bc8f672420 100644 --- a/small/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po +++ b/small/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po @@ -91,6 +91,8 @@ msgstr "TLS 主机名" msgid "allowInsecure" msgstr "允许不安全连接" +msgid "Enabling MPTCP Requires Server Support." +msgstr "启用 MPTCP 需服务端支持。" msgid "concurrency" msgstr "TCP 最大并发连接数" @@ -377,6 +379,12 @@ msgstr "强制走代理" msgid "UDP Relay" msgstr "UDP 中继" +msgid "Restart ShadowSocksR Plus+" +msgstr "重启 ShadowSocksR Plus+" + +msgid "Restart Service" +msgstr "重启服务" + msgid "Google Connectivity" msgstr "【谷歌】连通性检查" @@ -1168,3 +1176,45 @@ msgstr "socks5 服务器可以从外部接收的最大数据包大小(单位 msgid "Disable ChinaDNS-NG" msgstr "直通模式(禁用 ChinaDNS-NG)" + +msgid "Clear logs" +msgstr "清空日志" + +msgid "Backup and Restore" +msgstr "备份还原" + +msgid "Backup or Restore Client and Server Configurations." +msgstr "备份或还原客户端及服务端配置。" + +msgid "Note: Restoring configurations across different versions may cause compatibility issues." +msgstr "注意:不同版本间的配置恢复可能会导致兼容性问题。" + +msgid "Create Backup File" +msgstr "创建备份文件" + +msgid "Restore Backup File" +msgstr "恢复备份文件" + +msgid "DL Backup" +msgstr "下载备份" + +msgid "RST Backup" +msgstr "恢复备份" + +msgid "UL Restore" +msgstr "上传恢复" + +msgid "CLOSE WIN" +msgstr "关闭窗口" + +msgid "Restore to default configuration" +msgstr "恢复默认配置" + +msgid "Do Reset" +msgstr "执行重置" + +msgid "Do you want to restore the client to default settings?" +msgstr "是否要恢复客户端默认配置?" + +msgid "Are you sure you want to restore the client to default settings?" +msgstr "是否真的要恢复客户端默认配置?" diff --git a/small/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua b/small/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua index d80aac1525..1a35c92ad6 100755 --- a/small/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua +++ b/small/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua @@ -283,8 +283,9 @@ end initial_windows_size = tonumber(server.initial_windows_size) or nil } or nil, sockopt = { - tcpMptcp = (server.mptcp == "1") and true or false, -- MPTCP - tcpNoDelay = (server.mptcp == "1") and true or false, -- MPTCP + mark = 250, + tcpMptcp = (server.mptcp == "1") and true or nil, -- MPTCP + tcpNoDelay = (server.mptcp == "1") and true or nil, -- MPTCP tcpcongestion = server.custom_tcpcongestion, -- 连接服务器节点的 TCP 拥塞控制算法 dialerProxy = (xray_fragment.fragment == "1" or xray_fragment.noise == "1") and "dialerproxy" or nil } @@ -321,8 +322,10 @@ if xray_fragment.fragment ~= "0" or (xray_fragment.noise ~= "0" and xray_noise.e }, streamSettings = { sockopt = { - tcpMptcp = (server.mptcp == "1") and true or false, -- MPTCP - tcpNoDelay = (server.mptcp == "1") and true or false -- MPTCP + mark = 250, + tcpMptcp = (server.mptcp == "1") and true or nil, -- MPTCP + tcpNoDelay = (server.mptcp == "1") and true or nil, -- MPTCP + tcpcongestion = server.custom_tcpcongestion -- 连接服务器节点的 TCP 拥塞控制算法 } } }) diff --git a/small/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua b/small/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua index 0404be540b..777923a18b 100755 --- a/small/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua +++ b/small/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua @@ -319,6 +319,7 @@ local function processData(szType, content) result.server = nil end elseif szType == "trojan" then + local params = {} local idx_sp = 0 local alias = "" if content:find("#") then @@ -327,20 +328,27 @@ local function processData(szType, content) end local info = content:sub(1, idx_sp - 1) local hostInfo = split(info, "@") - local host = split(hostInfo[2], ":") local userinfo = hostInfo[1] local password = userinfo + + -- 分离服务器地址和端口 + local host = split(hostInfo[2], ":") + local server = host[1] + local port = host[2] + result.alias = UrlDecode(alias) result.type = v2_tj result.v2ray_protocol = "trojan" - result.server = host[1] + result.server = server + result.password = password + -- 按照官方的建议 默认验证ssl证书 result.insecure = "0" result.tls = "1" - if host[2]:find("?") then - local query = split(host[2], "?") + + if port:find("?") then + local query = split(port, "?") result.server_port = query[1] - local params = {} for _, v in pairs(split(query[2], '&')) do local t = split(v, '=') params[t[1]] = t[2] @@ -349,10 +357,62 @@ local function processData(szType, content) -- 未指定peer(sni)默认使用remote addr result.tls_host = params.sni end + + if params.allowInsecure then + -- 处理 insecure 参数 + result.insecure = params.allowInsecure + end else - result.server_port = host[2] + result.server_port = port + end + + if v2_tj ~= "trojan" then + if params.fp then + -- 处理 fingerprint 参数 + result.fingerprint = params.fp + end + -- 处理传输协议 + result.transport = params.type or "tcp" -- 默认传输协议为 tcp + if result.transport == "tcp" then + result.transport = "raw" + end + if result.transport == "ws" then + result.ws_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil + result.ws_path = params.path and UrlDecode(params.path) or "/" + elseif result.transport == "httpupgrade" then + result.httpupgrade_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil + result.httpupgrade_path = params.path and UrlDecode(params.path) or "/" + elseif result.transport == "splithttp" then + result.splithttp_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil + result.splithttp_path = params.path and UrlDecode(params.path) or "/" + elseif result.transport == "http" or result.transport == "h2" then + result.transport = "h2" + result.h2_host = params.host and UrlDecode(params.host) or nil + result.h2_path = params.path and UrlDecode(params.path) or nil + elseif result.transport == "kcp" then + result.kcp_guise = params.headerType or "none" + result.seed = params.seed + result.mtu = 1350 + result.tti = 50 + result.uplink_capacity = 5 + result.downlink_capacity = 20 + result.read_buffer_size = 2 + result.write_buffer_size = 2 + elseif result.transport == "quic" then + result.quic_guise = params.headerType or "none" + result.quic_security = params.quicSecurity or "none" + result.quic_key = params.key + elseif result.transport == "grpc" then + result.serviceName = params.serviceName + result.grpc_mode = params.mode or "gun" + elseif result.transport == "tcp" or result.transport == "raw" then + result.tcp_guise = params.headerType and params.headerType ~= "" and params.headerType or "none" + if result.tcp_guise == "http" then + result.tcp_host = params.host and UrlDecode(params.host) or nil + result.tcp_path = params.path and UrlDecode(params.path) or nil + end + end end - result.password = password elseif szType == "vless" then local url = URL.parse("http://" .. content) local params = url.query diff --git a/small/v2ray-geodata/Makefile b/small/v2ray-geodata/Makefile index ddf6ffda1d..7f4e019419 100644 --- a/small/v2ray-geodata/Makefile +++ b/small/v2ray-geodata/Makefile @@ -30,13 +30,13 @@ define Download/geosite HASH:=aa65cee72dd6afbf9dd4c474b4ff28ceb063f6abf99249a084091adb4f282f09 endef -GEOSITE_IRAN_VER:=202412230035 +GEOSITE_IRAN_VER:=202412300035 GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER) define Download/geosite-ir URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/ URL_FILE:=iran.dat FILE:=$(GEOSITE_IRAN_FILE) - HASH:=fcf072abdad21399b442ff5474a60802efb264bfc8aa3f90048c343fd296dc89 + HASH:=a2c0b714f8d30bfeabb8933b4a322a9cbe7b9fe1a8c3ee36b9afbcced0a4e19f endef define Package/v2ray-geodata/template diff --git a/v2rayn/.github/workflows/build-linux.yml b/v2rayn/.github/workflows/build-linux.yml index d0383ebece..88b89d2a2d 100644 --- a/v2rayn/.github/workflows/build-linux.yml +++ b/v2rayn/.github/workflows/build-linux.yml @@ -33,6 +33,8 @@ jobs: cd v2rayN dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64 dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64 + dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPath64 + dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPathArm64 - name: Upload build artifacts uses: actions/upload-artifact@v4 diff --git a/v2rayn/.github/workflows/build-osx.yml b/v2rayn/.github/workflows/build-osx.yml index 35f58baedb..369faabeeb 100644 --- a/v2rayn/.github/workflows/build-osx.yml +++ b/v2rayn/.github/workflows/build-osx.yml @@ -33,6 +33,8 @@ jobs: cd v2rayN dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64 dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64 + dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPath64 + dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPathArm64 - name: Upload build artifacts uses: actions/upload-artifact@v4 @@ -41,6 +43,23 @@ jobs: path: | ${{ github.workspace }}/v2rayN/Release/macos* + # release osx package + - name: Package osx + if: github.event.inputs.release_tag != '' + run: | + brew install create-dmg + chmod 755 package-osx.sh + ./package-osx.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }} + ./package-osx.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }} + + - name: Upload dmg to release + uses: svenstaro/upload-release-action@v2 + if: github.event.inputs.release_tag != '' + with: + file: ${{ github.workspace }}/v2rayN*.dmg + tag: ${{ github.event.inputs.release_tag }} + file_glob: true + # release zip archive - name: Package release zip archive if: github.event.inputs.release_tag != '' diff --git a/v2rayn/.github/workflows/build-windows.yml b/v2rayn/.github/workflows/build-windows.yml index 0baa8939df..2b19e6461b 100644 --- a/v2rayn/.github/workflows/build-windows.yml +++ b/v2rayn/.github/workflows/build-windows.yml @@ -35,6 +35,10 @@ jobs: dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64 dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-arm64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64 dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64Sc + dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64 + dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64 + dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:EnableWindowsTargeting=true -o $OutputPath64Sc + - name: Upload build artifacts uses: actions/upload-artifact@v4 diff --git a/v2rayn/package-debian.sh b/v2rayn/package-debian.sh index 0e7eab8ecb..98afec989a 100644 --- a/v2rayn/package-debian.sh +++ b/v2rayn/package-debian.sh @@ -8,6 +8,7 @@ PackagePath="v2rayN-Package-${Arch}" mkdir -p "${PackagePath}/DEBIAN" mkdir -p "${PackagePath}/opt" cp -rf $OutputPath "${PackagePath}/opt/v2rayN" +echo "When this file exists, app will not store configs under this folder" > "${PackagePath}/opt/v2rayN/NotStoreConfigHere.txt" if [ $Arch = "linux-64" ]; then Arch2="amd64" @@ -44,6 +45,7 @@ EOF sudo chmod 0755 "${PackagePath}/DEBIAN/postinst" sudo chmod 0755 "${PackagePath}/opt/v2rayN/v2rayN" +sudo chmod 0755 "${PackagePath}/opt/v2rayN/AmazTool" # desktop && PATH diff --git a/v2rayn/package-osx.sh b/v2rayn/package-osx.sh new file mode 100755 index 0000000000..cfbd83598d --- /dev/null +++ b/v2rayn/package-osx.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +Arch="$1" +OutputPath="$2" +Version="$3" + +PackagePath="v2rayN-Package-${Arch}" +mkdir -p "$PackagePath/v2rayN.app/Contents/Resources" +cp -rf "$OutputPath" "$PackagePath/v2rayN.app/Contents/MacOS" +echo "When this file exists, app will not store configs under this folder" > "$PackagePath/v2rayN.app/Contents/MacOS/NotStoreConfigHere.txt" +chmod +x "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN" + +mkdir -p "$PackagePath/icons.iconset" +sips -z 16 16 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_16x16.png" +sips -z 32 32 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_16x16@2x.png" +sips -z 32 32 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_32x32.png" +sips -z 64 64 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_32x32@2x.png" +sips -z 128 128 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_128x128.png" +sips -z 256 256 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_128x128@2x.png" +sips -z 256 256 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_256x256.png" +sips -z 512 512 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_256x256@2x.png" +sips -z 512 512 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_512x512.png" +sips -z 1024 1024 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_512x512@2x.png" +iconutil -c icns "$PackagePath/icons.iconset" -o "$PackagePath/v2rayN.app/Contents/Resources/AppIcon.icns" + +cat >"$PackagePath/v2rayN.app/Contents/Info.plist" <<-EOF + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + v2rayN + CFBundleExecutable + v2rayN + CFBundleIconFile + AppIcon + CFBundleIconName + AppIcon + CFBundleIdentifier + 2dust.v2rayN + CFBundleName + v2rayN + CFBundlePackageType + APPL + CFBundleShortVersionString + ${Version} + CSResourcesFileMapped + + NSHighResolutionCapable + + + +EOF + +create-dmg \ + --volname "v2rayN Installer" \ + --window-size 700 420 \ + --icon-size 100 \ + --icon "v2rayN.app" 160 185 \ + --hide-extension "v2rayN.app" \ + --app-drop-link 500 185 \ + "v2rayN-${Arch}.dmg" \ + "$PackagePath/v2rayN.app" \ No newline at end of file diff --git a/v2rayn/v2rayN/AmazTool/AmazTool.csproj b/v2rayn/v2rayN/AmazTool/AmazTool.csproj index 74fbff7f1d..2491a06dbf 100644 --- a/v2rayn/v2rayN/AmazTool/AmazTool.csproj +++ b/v2rayn/v2rayN/AmazTool/AmazTool.csproj @@ -6,7 +6,7 @@ enable enable Copyright © 2017-2024 (GPLv3) - 1.3.0 + 1.3.1 diff --git a/v2rayn/v2rayN/AmazTool/UpgradeApp.cs b/v2rayn/v2rayN/AmazTool/UpgradeApp.cs index dc517ee928..9554f923de 100644 --- a/v2rayn/v2rayN/AmazTool/UpgradeApp.cs +++ b/v2rayn/v2rayN/AmazTool/UpgradeApp.cs @@ -10,7 +10,7 @@ namespace AmazTool { Console.WriteLine($"{Resx.Resource.StartUnzipping}\n{fileName}"); - Waiting(9); + Waiting(8); if (!File.Exists(fileName)) { @@ -91,7 +91,7 @@ namespace AmazTool } Console.WriteLine(Resx.Resource.Restartv2rayN); - Waiting(9); + Waiting(3); Process process = new() { StartInfo = new() diff --git a/v2rayn/v2rayN/ServiceLib/Common/Utils.cs b/v2rayn/v2rayN/ServiceLib/Common/Utils.cs index 585951bb90..4d4665eabc 100644 --- a/v2rayn/v2rayN/ServiceLib/Common/Utils.cs +++ b/v2rayn/v2rayN/ServiceLib/Common/Utils.cs @@ -517,7 +517,7 @@ namespace ServiceLib.Common public static bool UpgradeAppExists(out string fileName) { - fileName = Path.Combine(Utils.StartupPath(), GetExeName("AmazTool")); + fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetExeName("AmazTool")); return File.Exists(fileName); } @@ -593,6 +593,9 @@ namespace ServiceLib.Common return; } + if (fileName.Contains(' ')) fileName = fileName.AppendQuotes(); + if (arguments.Contains(' ')) arguments = arguments.AppendQuotes(); + Process.Start(new ProcessStartInfo(fileName, arguments) { UseShellExecute = true }); } catch (Exception ex) @@ -675,6 +678,12 @@ namespace ServiceLib.Common { try { + //When this file exists, it is equivalent to having no permission to read and write + if (File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "NotStoreConfigHere.txt"))) + { + return false; + } + var tempPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "guiTemps"); if (!Directory.Exists(tempPath)) { diff --git a/v2rayn/v2rayN/ServiceLib/ServiceLib.csproj b/v2rayn/v2rayN/ServiceLib/ServiceLib.csproj index b4154c8221..df6a5d5ad5 100644 --- a/v2rayn/v2rayN/ServiceLib/ServiceLib.csproj +++ b/v2rayn/v2rayN/ServiceLib/ServiceLib.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 7.4.2 + 7.5.0 @@ -14,7 +14,7 @@ - + diff --git a/v2rayn/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayn/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 2de9b453fc..c5216f86da 100644 --- a/v2rayn/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayn/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -528,17 +528,18 @@ namespace ServiceLib.ViewModels private async Task OpenTheFileLocation() { + var path = Utils.StartupPath(); if (Utils.IsWindows()) { - Utils.ProcessStart("Explorer", $"/select,{Utils.GetConfigPath()}"); + Utils.ProcessStart(path); } else if (Utils.IsLinux()) { - Utils.ProcessStart("nautilus", Utils.GetConfigPath()); + Utils.ProcessStart("nautilus", path); } else if (Utils.IsOSX()) { - Utils.ProcessStart("open", Utils.GetConfigPath()); + Utils.ProcessStart("open", path); } } diff --git a/v2rayn/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayn/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index 279b606330..0d1566e996 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayn/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -304,7 +304,7 @@ namespace v2rayN.Desktop.Views private async void MainWindow_KeyDown(object? sender, KeyEventArgs e) { - if (e.KeyModifiers == KeyModifiers.Control) + if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta) { switch (e.Key) { diff --git a/v2rayn/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs b/v2rayn/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs index fb5cba0782..4ddfa2c250 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs +++ b/v2rayn/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs @@ -233,7 +233,7 @@ namespace v2rayN.Desktop.Views private void LstProfiles_KeyDown(object? sender, KeyEventArgs e) { - if (e.KeyModifiers == KeyModifiers.Control) + if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta) { switch (e.Key) { diff --git a/v2rayn/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs b/v2rayn/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs index db233fc1ee..5be3c7937d 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs +++ b/v2rayn/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs @@ -128,7 +128,7 @@ namespace v2rayN.Desktop.Views private void RoutingRuleSettingWindow_KeyDown(object? sender, KeyEventArgs e) { - if (e.KeyModifiers == KeyModifiers.Control) + if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta) { if (e.Key == Key.A) { diff --git a/v2rayn/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs b/v2rayn/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs index ed54a823a3..de74c39e52 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs +++ b/v2rayn/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs @@ -83,7 +83,7 @@ namespace v2rayN.Desktop.Views private void RoutingSettingWindow_KeyDown(object? sender, KeyEventArgs e) { - if (e.KeyModifiers == KeyModifiers.Control) + if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta) { if (e.Key == Key.A) {