|
@@ -6,7 +6,7 @@ require "luci.sys"
|
|
|
require "luci.http"
|
|
|
require "luci.model.ipkg"
|
|
|
|
|
|
-local m, s, o, kcp_enable
|
|
|
+local m, s, o
|
|
|
local sid = arg[1]
|
|
|
local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid")
|
|
|
|
|
@@ -47,12 +47,19 @@ local encrypt_methods = {
|
|
|
}
|
|
|
|
|
|
local encrypt_methods_ss = {
|
|
|
+ -- plain
|
|
|
+ "none",
|
|
|
+ "plain",
|
|
|
-- aead
|
|
|
"aes-128-gcm",
|
|
|
"aes-192-gcm",
|
|
|
"aes-256-gcm",
|
|
|
"chacha20-ietf-poly1305",
|
|
|
- "xchacha20-ietf-poly1305"
|
|
|
+ "xchacha20-ietf-poly1305",
|
|
|
+ -- aead 2022
|
|
|
+ "2022-blake3-aes-128-gcm",
|
|
|
+ "2022-blake3-aes-256-gcm",
|
|
|
+ "2022-blake3-chacha20-poly1305"
|
|
|
--[[ stream
|
|
|
"none",
|
|
|
"plain",
|
|
@@ -74,22 +81,6 @@ local encrypt_methods_ss = {
|
|
|
"chacha20-ietf" ]]
|
|
|
}
|
|
|
|
|
|
-local encrypt_methods_v2ray_ss = {
|
|
|
- -- xray_ss
|
|
|
- "none",
|
|
|
- "plain",
|
|
|
- -- aead
|
|
|
- "aes-128-gcm",
|
|
|
- "aes-256-gcm",
|
|
|
- "chacha20-poly1305",
|
|
|
- "chacha20-ietf-poly1305",
|
|
|
- "xchacha20-ietf-poly1305",
|
|
|
- "aead_aes_128_gcm",
|
|
|
- "aead_aes_256_gcm",
|
|
|
- "aead_chacha20_poly1305",
|
|
|
- "aead_xchacha20_poly1305"
|
|
|
-}
|
|
|
-
|
|
|
local protocol = {
|
|
|
-- ssr
|
|
|
"origin",
|
|
@@ -105,7 +96,7 @@ local protocol = {
|
|
|
"auth_chain_f"
|
|
|
}
|
|
|
|
|
|
-obfs = {
|
|
|
+local obfs = {
|
|
|
-- ssr
|
|
|
"plain",
|
|
|
"http_simple",
|
|
@@ -124,7 +115,7 @@ local securitys = {
|
|
|
}
|
|
|
|
|
|
local flows = {
|
|
|
- -- xlts
|
|
|
+ -- xtls
|
|
|
"xtls-rprx-origin",
|
|
|
"xtls-rprx-origin-udp443",
|
|
|
"xtls-rprx-direct",
|
|
@@ -255,13 +246,13 @@ for _, v in ipairs(encrypt_methods_ss) do
|
|
|
end
|
|
|
o.rmempty = true
|
|
|
o:depends("type", "ss")
|
|
|
+o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
|
|
|
|
|
-o = s:option(ListValue, "encrypt_method_v2ray_ss", translate("Encrypt Method"))
|
|
|
-for _, v in ipairs(encrypt_methods_v2ray_ss) do
|
|
|
- o:value(v)
|
|
|
-end
|
|
|
+o = s:option(Flag, "uot", translate("UDP over TCP"))
|
|
|
+o.description = translate("Enable the SUoT protocol, requires server support.")
|
|
|
o.rmempty = true
|
|
|
o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
|
|
+o.default = "0"
|
|
|
|
|
|
o = s:option(Flag, "ivCheck", translate("Bloom Filter"))
|
|
|
o.rmempty = true
|
|
@@ -274,7 +265,7 @@ o:value("none", translate("None"))
|
|
|
if is_finded("obfs-local") then
|
|
|
o:value("obfs-local", translate("obfs-local"))
|
|
|
end
|
|
|
-if is_finded("v2ray-plugin") then
|
|
|
+if is_finded("v2ray-plugin") or is_installed("sagernet-core") then
|
|
|
o:value("v2ray-plugin", translate("v2ray-plugin"))
|
|
|
end
|
|
|
if is_finded("xray-plugin") then
|
|
@@ -282,12 +273,12 @@ if is_finded("xray-plugin") then
|
|
|
end
|
|
|
o.rmempty = true
|
|
|
o:depends("type", "ss")
|
|
|
+o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
|
|
|
|
|
o = s:option(Value, "plugin_opts", translate("Plugin Opts"))
|
|
|
o.rmempty = true
|
|
|
-o:depends({type = "ss", plugin = "obfs-local"})
|
|
|
-o:depends({type = "ss", plugin = "v2ray-plugin"})
|
|
|
-o:depends({type = "ss", plugin = "xray-plugin"})
|
|
|
+o:depends("type", "ss")
|
|
|
+o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
|
|
|
|
|
o = s:option(ListValue, "protocol", translate("Protocol"))
|
|
|
for _, v in ipairs(protocol) do
|
|
@@ -647,11 +638,11 @@ o.default = 1234
|
|
|
o.rmempty = false
|
|
|
|
|
|
if is_finded("kcptun-client") then
|
|
|
- kcp_enable = s:option(Flag, "kcp_enable", translate("KcpTun Enable"))
|
|
|
- kcp_enable.rmempty = true
|
|
|
- kcp_enable.default = "0"
|
|
|
- kcp_enable:depends("type", "ssr")
|
|
|
- kcp_enable:depends("type", "ss")
|
|
|
+ o = s:option(Flag, "kcp_enable", translate("KcpTun Enable"))
|
|
|
+ o.rmempty = true
|
|
|
+ o.default = "0"
|
|
|
+ o:depends("type", "ssr")
|
|
|
+ o:depends("type", "ss")
|
|
|
|
|
|
o = s:option(Value, "kcp_port", translate("KcpTun Port"))
|
|
|
o.datatype = "port"
|