Ver código fonte

luci-app-ssr-plus: remove support for sagerner-core

It's deprecated by the upstream.

Signed-off-by: Tianling Shen <[email protected]>
Tianling Shen 2 anos atrás
pai
commit
39702e985d

+ 0 - 6
luci-app-ssr-plus/Makefile

@@ -8,7 +8,6 @@ PKG_CONFIG_DEPENDS:= \
 	CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY \
 	CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
 	CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Xray \
-	CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_SagerNet_Core \
 	CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG \
 	CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria \
 	CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_IPT2Socks \
@@ -38,8 +37,6 @@ LUCI_DEPENDS:= \
 	+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray-core \
 	+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:curl \
 	+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray-core \
-	+PACKAGE_$(PKG_NAME)_INCLUDE_SagerNet_Core:curl \
-	+PACKAGE_$(PKG_NAME)_INCLUDE_SagerNet_Core:sagernet-core \
 	+PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG:chinadns-ng \
 	+PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria:hysteria \
 	+PACKAGE_$(PKG_NAME)_INCLUDE_IPT2Socks:ipt2socks \
@@ -109,9 +106,6 @@ choice
 
 	config PACKAGE_$(PKG_NAME)_INCLUDE_Xray
 	bool "Xray-core"
-
-	config PACKAGE_$(PKG_NAME)_INCLUDE_SagerNet_Core
-	bool "SagerNet-core (An enhanced edition of v2ray-core)"
 endchoice
 
 config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG

+ 0 - 6
luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua

@@ -57,12 +57,6 @@ o:value("https://ispip.clang.cn/all_cn_cidr.txt", translate("Clang.CN.CIDR"))
 o:value("https://fastly.jsdelivr.net/gh/gaoyifan/china-operator-ip@ip-lists/china.txt", translate("china-operator-ip"))
 o.default = "https://ispip.clang.cn/all_cn.txt"
 
-o = s:option(ListValue, "default_packet_encoding", translate("Default Packet Encoding"))
-o:value("none", translate("none"))
-o:value("packet", translate("packet (v2ray-core v5+)"))
-o:value("xudp", translate("xudp (Xray-core)"))
-o.default = "xudp"
-
 o = s:option(Flag, "netflix_enable", translate("Enable Netflix Mode"))
 o.rmempty = false
 

+ 6 - 39
luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua

@@ -184,9 +184,6 @@ o:value("vless", translate("VLESS"))
 o:value("vmess", translate("VMess"))
 o:value("trojan", translate("Trojan"))
 o:value("shadowsocks", translate("Shadowsocks"))
-if is_installed("sagernet-core") then
-	o:value("shadowsocksr", translate("ShadowsocksR"))
-end
 if is_finded("xray") then
 	o:value("wireguard", translate("WireGuard"))
 end
@@ -244,7 +241,6 @@ o:depends({type = "socks5", auth_enable = true})
 o:depends({type = "v2ray", v2ray_protocol = "http", auth_enable = true})
 o:depends({type = "v2ray", v2ray_protocol = "socks", socks_ver = "5", auth_enable = true})
 o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
-o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
 o:depends({type = "v2ray", v2ray_protocol = "trojan"})
 
 o = s:option(ListValue, "encrypt_method", translate("Encrypt Method"))
@@ -253,7 +249,6 @@ for _, v in ipairs(encrypt_methods) do
 end
 o.rmempty = true
 o:depends("type", "ssr")
-o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
 
 o = s:option(ListValue, "encrypt_method_ss", translate("Encrypt Method"))
 for _, v in ipairs(encrypt_methods_ss) do
@@ -277,10 +272,10 @@ o.default = "1"
 -- Shadowsocks Plugin
 o = s:option(Value, "plugin", translate("Obfs"))
 o:value("none", translate("None"))
-if is_finded("obfs-local") or is_installed("sagernet-core") then
+if is_finded("obfs-local") then
 	o:value("obfs-local", translate("obfs-local"))
 end
-if is_finded("v2ray-plugin") or is_installed("sagernet-core") then
+if is_finded("v2ray-plugin") then
 	o:value("v2ray-plugin", translate("v2ray-plugin"))
 end
 if is_finded("xray-plugin") then
@@ -288,16 +283,10 @@ if is_finded("xray-plugin") then
 end
 o.rmempty = true
 o:depends("type", "ss")
-if is_installed("sagernet-core") then
-	o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
-end
 
 o = s:option(Value, "plugin_opts", translate("Plugin Opts"))
 o.rmempty = true
 o:depends("type", "ss")
-if is_installed("sagernet-core") then
-	o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
-end
 
 o = s:option(ListValue, "protocol", translate("Protocol"))
 for _, v in ipairs(protocol) do
@@ -305,11 +294,9 @@ for _, v in ipairs(protocol) do
 end
 o.rmempty = true
 o:depends("type", "ssr")
-o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
 
 o = s:option(Value, "protocol_param", translate("Protocol param (optional)"))
 o:depends("type", "ssr")
-o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
 
 o = s:option(ListValue, "obfs", translate("Obfs"))
 for _, v in ipairs(obfs) do
@@ -317,11 +304,9 @@ for _, v in ipairs(obfs) do
 end
 o.rmempty = true
 o:depends("type", "ssr")
-o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
 
 o = s:option(Value, "obfs_param", translate("Obfs param (optional)"))
 o:depends("type", "ssr")
-o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
 
 -- [[ Hysteria ]]--
 o = s:option(ListValue, "hysteria_protocol", translate("Protocol"))
@@ -478,21 +463,17 @@ o:depends("transport", "ws")
 o.rmempty = true
 
 if is_finded("v2ray") then
-	-- 启用WS前置数据
-	o = s:option(Flag, "ws_ed_enable", translate("Enable early data"))
-	o:depends("transport", "ws")
-
 	-- WS前置数据
 	o = s:option(Value, "ws_ed", translate("Max Early Data"))
 	o:depends("ws_ed_enable", true)
 	o.datatype = "uinteger"
-	o.default = 2048
+	o.value("2048")
 	o.rmempty = true
 
 	-- WS前置数据标头
 	o = s:option(Value, "ws_ed_header", translate("Early Data Header Name"))
 	o:depends("ws_ed_enable", true)
-	o.default = "Sec-WebSocket-Protocol"
+	o.value("Sec-WebSocket-Protocol")
 	o.rmempty = true
 end
 
@@ -513,19 +494,16 @@ o = s:option(Value, "serviceName", translate("gRPC Service Name"))
 o:depends("transport", "grpc")
 o.rmempty = true
 
-if is_finded("xray") or is_installed("sagernet-core") then
+if is_finded("xray") then
 	-- gPRC模式
 	o = s:option(ListValue, "grpc_mode", translate("gRPC Mode"))
 	o:depends("transport", "grpc")
 	o:value("gun", translate("Gun"))
 	o:value("multi", translate("Multi"))
-	if is_installed("sagernet-core") then
-		o:value("raw", translate("Raw"))
-	end
 	o.rmempty = true
 end
 
-if is_finded("xray") or is_installed("sagernet-core") then
+if is_finded("xray") then
 	-- gRPC初始窗口
 	o = s:option(Value, "initial_windows_size", translate("Initial Windows Size"))
 	o.datatype = "uinteger"
@@ -824,17 +802,6 @@ o:depends("type", "ss")
 o:depends("type", "trojan")
 o:depends("type", "hysteria")
 
-if is_installed("sagernet-core") then
-	o = s:option(ListValue, "packet_encoding", translate("Packet Encoding"))
-	o:value("none", translate("none"))
-	o:value("packet", translate("packet (v2ray-core v5+)"))
-	o:value("xudp", translate("xudp (Xray-core)"))
-	o.default = "xudp"
-	o.rmempty = true
-	o:depends({type = "v2ray", v2ray_protocol = "vless"})
-	o:depends({type = "v2ray", v2ray_protocol = "vmess"})
-end
-
 o = s:option(Flag, "switch_enable", translate("Enable Auto Switch"))
 o.rmempty = false
 o.default = "1"

+ 0 - 9
luci-app-ssr-plus/po/zh-cn/ssr-plus.po

@@ -742,9 +742,6 @@ msgstr "WebSocket 主机名"
 msgid "WebSocket Path"
 msgstr "WebSocket 路径"
 
-msgid "Enable early data"
-msgstr "启用前置数据"
-
 msgid "Max Early Data"
 msgstr "最大前置数据"
 
@@ -829,9 +826,6 @@ msgstr "节点公钥"
 msgid "Pre-shared key"
 msgstr "预共享密钥"
 
-msgid "Packet Encoding"
-msgstr "数据包编码"
-
 msgid "Network interface to use"
 msgstr "使用的网络接口"
 
@@ -856,8 +850,5 @@ msgstr "重新应用"
 msgid "Apply"
 msgstr "应用"
 
-msgid "Default Packet Encoding"
-msgstr "默认数据包编码"
-
 msgid "Enable Netflix Mode"
 msgstr "启用 Netflix 分流模式"

+ 0 - 1
luci-app-ssr-plus/root/etc/init.d/shadowsocksr

@@ -981,7 +981,6 @@ reset() {
 		set shadowsocksr.@global[0].switch_time='667'
 		set shadowsocksr.@global[0].switch_timeout='5'
 		set shadowsocksr.@global[0].switch_try_count='3'
-		set shadowsocksr.@global[0].default_packet_encoding='xudp'
 		set shadowsocksr.@global[0].gfwlist_url='https://fastly.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt'
 		set shadowsocksr.@global[0].chnroute_url='https://ispip.clang.cn/all_cn.txt'
 		set shadowsocksr.@global[0].nfip_url='https://fastly.jsdelivr.net/gh/QiuSimons/Netflix_IP/NF_only.txt'

+ 3 - 21
luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua

@@ -26,35 +26,22 @@ function vmess_vless()
 					}
 				}
 			}
-		},
-		packetEncoding = server.packet_encoding or nil
+		}
 	}
 end
 function trojan_shadowsocks()
 	outbound_settings = {
-		plugin = ((server.v2ray_protocol == "shadowsocks") and server.plugin ~= "none" and server.plugin) or (server.v2ray_protocol == "shadowsocksr" and "shadowsocksr") or nil,
-		pluginOpts = (server.v2ray_protocol == "shadowsocks") and server.plugin_opts or nil,
-		pluginArgs = (server.v2ray_protocol == "shadowsocksr") and {
-			"--protocol=" .. server.protocol,
-			"--protocol-param=" .. (server.protocol_param or ""),
-			"--obfs=" .. server.obfs,
-			"--obfs-param=" .. (server.obfs_param or "")
-		} or nil,
 		servers = {
 			{
 				address = server.server,
 				port = tonumber(server.server_port),
 				password = server.password,
-				method = ((server.v2ray_protocol == "shadowsocks") and server.encrypt_method_ss) or ((server.v2ray_protocol == "shadowsocksr") and server.encrypt_method) or nil,
+				method = ((server.v2ray_protocol == "shadowsocks") and server.encrypt_method_ss) or nil,
 				uot = (server.v2ray_protocol == "shadowsocks") and (server.uot == '1') or nil,
 				ivCheck = (server.v2ray_protocol == "shadowsocks") and (server.ivCheck == '1') or nil,
 			}
 		}
 	}
-
-	if server.v2ray_protocol == "shadowsocksr" then
-		server.v2ray_protocol = "shadowsocks"
-	end
 end
 function socks_http()
 	outbound_settings = {
@@ -108,9 +95,6 @@ function outbound:handleIndex(index)
 		shadowsocks = function()
 			trojan_shadowsocks()
 		end,
-		shadowsocksr = function()
-			trojan_shadowsocks()
-		end,
 		socks = function()
 			socks_http()
 		end,
@@ -224,7 +208,6 @@ local Xray = {
 			grpcSettings = (server.transport == "grpc") and {
 				-- grpc
 				serviceName = server.serviceName or "",
-				mode = (server.grpc_mode ~= "gun") and server.grpc_mode or nil,
 				multiMode = (server.grpc_mode == "multi") and true or false,
 				idle_timeout = tonumber(server.idle_timeout) or nil,
 				health_check_timeout = tonumber(server.health_check_timeout) or nil,
@@ -235,8 +218,7 @@ local Xray = {
 		mux = (server.mux == "1" and server.transport ~= "grpc") and {
 			-- mux
 			enabled = true,
-			concurrency = tonumber(server.concurrency),
-			packetEncoding = (server.v2ray_protocol == "vmess" or server.v2ray_protocol == "vless") and server.packet_encoding or nil
+			concurrency = tonumber(server.concurrency)
 		} or nil
 	} or nil
 }

+ 1 - 6
luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua

@@ -27,9 +27,7 @@ local switch = ucic:get_first(name, 'server_subscribe', 'switch', '1')
 local subscribe_url = ucic:get_first(name, 'server_subscribe', 'subscribe_url', {})
 local filter_words = ucic:get_first(name, 'server_subscribe', 'filter_words', '过期时间/剩余流量')
 local save_words = ucic:get_first(name, 'server_subscribe', 'save_words', '')
-local packet_encoding = luci.model.ipkg.installed("sagernet-core") and ucic:get_first(name, 'global', 'default_packet_encoding', 'xudp') or nil
 local v2_ss = luci.sys.exec('type -t -p ss-redir sslocal') ~= "" and "ss" or "v2ray"
-local v2_ssr = luci.sys.exec('type -t -p ssr-redir') ~= "" and "ssr" or "v2ray"
 local v2_tj = luci.sys.exec('type -t -p trojan') ~= "" and "trojan" or "v2ray"
 local log = function(...)
 	print(os.date("%Y-%m-%d %H:%M:%S ") .. table.concat({...}, " "))
@@ -149,8 +147,7 @@ local function processData(szType, content)
 	if szType == 'ssr' then
 		local dat = split(content, "/%?")
 		local hostInfo = split(dat[1], ':')
-		result.type = v2_ssr
-		result.v2ray_protocol = (v2_ssr == "v2ray") and "shadowsocksr" or nil
+		result.type = 'ssr'
 		result.server = hostInfo[1]
 		result.server_port = hostInfo[2]
 		result.protocol = hostInfo[3]
@@ -178,7 +175,6 @@ local function processData(szType, content)
 		result.transport = info.net
 		result.vmess_id = info.id
 		result.alias = info.ps
-		result.packet_encoding = packet_encoding
 		-- result.mux = 1
 		-- result.concurrency = 8
 		if info.net == 'ws' then
@@ -361,7 +357,6 @@ local function processData(szType, content)
 		result.vmess_id = url.user
 		result.vless_encryption = params.encryption or "none"
 		result.transport = params.type or "tcp"
-		result.packet_encoding = packet_encoding
 		result.tls = (params.security == "tls" or params.security == "xtls") and "1" or "0"
 		result.tls_host = params.sni
 		result.tls_flow = (params.security == "tls") and params.flow or nil