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

It's deprecated by the upstream.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2023-03-21 22:14:35 +08:00 committed by sbwml
parent 63bf036617
commit 29b1660a2a
7 changed files with 10 additions and 88 deletions

View File

@ -8,7 +8,6 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Xray \ 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_ChinaDNS_NG \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_IPT2Socks \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_IPT2Socks \
@ -38,8 +37,6 @@ LUCI_DEPENDS:= \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray-core \ +PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray-core \
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:curl \ +PACKAGE_$(PKG_NAME)_INCLUDE_Xray:curl \
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray-core \ +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_ChinaDNS_NG:chinadns-ng \
+PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria:hysteria \ +PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria:hysteria \
+PACKAGE_$(PKG_NAME)_INCLUDE_IPT2Socks:ipt2socks \ +PACKAGE_$(PKG_NAME)_INCLUDE_IPT2Socks:ipt2socks \
@ -108,9 +105,6 @@ choice
config PACKAGE_$(PKG_NAME)_INCLUDE_Xray config PACKAGE_$(PKG_NAME)_INCLUDE_Xray
bool "Xray-core" bool "Xray-core"
config PACKAGE_$(PKG_NAME)_INCLUDE_SagerNet_Core
bool "SagerNet-core (An enhanced edition of v2ray-core)"
endchoice endchoice
config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG

View File

@ -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: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.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 = s:option(Flag, "netflix_enable", translate("Enable Netflix Mode"))
o.rmempty = false o.rmempty = false

View File

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

View File

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

View File

@ -981,7 +981,6 @@ reset() {
set shadowsocksr.@global[0].switch_time='667' set shadowsocksr.@global[0].switch_time='667'
set shadowsocksr.@global[0].switch_timeout='5' set shadowsocksr.@global[0].switch_timeout='5'
set shadowsocksr.@global[0].switch_try_count='3' 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].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].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' set shadowsocksr.@global[0].nfip_url='https://fastly.jsdelivr.net/gh/QiuSimons/Netflix_IP/NF_only.txt'

View File

@ -26,35 +26,22 @@ function vmess_vless()
} }
} }
} }
}, }
packetEncoding = server.packet_encoding or nil
} }
end end
function trojan_shadowsocks() function trojan_shadowsocks()
outbound_settings = { 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 = { servers = {
{ {
address = server.server, address = server.server,
port = tonumber(server.server_port), port = tonumber(server.server_port),
password = server.password, 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, uot = (server.v2ray_protocol == "shadowsocks") and (server.uot == '1') or nil,
ivCheck = (server.v2ray_protocol == "shadowsocks") and (server.ivCheck == '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 end
function socks_http() function socks_http()
outbound_settings = { outbound_settings = {
@ -108,9 +95,6 @@ function outbound:handleIndex(index)
shadowsocks = function() shadowsocks = function()
trojan_shadowsocks() trojan_shadowsocks()
end, end,
shadowsocksr = function()
trojan_shadowsocks()
end,
socks = function() socks = function()
socks_http() socks_http()
end, end,
@ -224,7 +208,6 @@ local Xray = {
grpcSettings = (server.transport == "grpc") and { grpcSettings = (server.transport == "grpc") and {
-- grpc -- grpc
serviceName = server.serviceName or "", serviceName = server.serviceName or "",
mode = (server.grpc_mode ~= "gun") and server.grpc_mode or nil,
multiMode = (server.grpc_mode == "multi") and true or false, multiMode = (server.grpc_mode == "multi") and true or false,
idle_timeout = tonumber(server.idle_timeout) or nil, idle_timeout = tonumber(server.idle_timeout) or nil,
health_check_timeout = tonumber(server.health_check_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 = (server.mux == "1" and server.transport ~= "grpc") and {
-- mux -- mux
enabled = true, enabled = true,
concurrency = tonumber(server.concurrency), concurrency = tonumber(server.concurrency)
packetEncoding = (server.v2ray_protocol == "vmess" or server.v2ray_protocol == "vless") and server.packet_encoding or nil
} or nil } or nil
} or nil } or nil
} }

View File

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