🔥 Sync 2026-05-23 20:23:16

This commit is contained in:
github-actions[bot] committed 2026-05-23 20:23:16 +08:00
1 parent 252b818cc5
commit b77bf4e6e9
49 files changed
+2005 -1916

No files matched your search

@@ -1,7 +1,5 @@
local m, s = ...
local api = require "luci.passwall.api"
if not api.finded_com("hysteria") then
return
end
@@ -10,21 +8,24 @@ local fs = api.fs
local type_name = "Hysteria2"
-- [[ Hysteria2 ]]
s.fields["type"]:value(type_name, "Hysteria2")
if s.val["type"] and s.val["type"] ~= type_name then
return
end
local option_prefix = "hysteria2_"
local function _n(name)
return option_prefix .. name
end
-- [[ Hysteria2 ]]
s.fields["type"]:value(type_name, "Hysteria2")
o = s:option(Flag, _n("custom"), translate("Use Custom Config"))
o = s:option(Value, _n("port"), translate("Listen Port"))
o.datatype = "port"
o.rmempty = false
o:depends({ [_n("custom")] = false })
o = s:option(Flag, _n("realms"), translate("Realms"))
@@ -1,15 +1,22 @@
local m, s = ...
local api = require "luci.passwall.api"
if not api.finded_com("xray") then
return
end
local fs = api.fs
local type_name = "Xray"
-- [[ Xray ]]
s.fields["type"]:value(type_name, "Xray")
if not s.fields["type"].default then
s.fields["type"].default = type_name
end
if s.val["type"] and s.val["type"] ~= type_name then
return
end
local option_prefix = "xray_"
local function _n(name)
@@ -24,10 +31,6 @@ local header_type_list = {
"none", "srtp", "utp", "wechat-video", "dtls", "wireguard", "dns"
}
-- [[ Xray ]]
s.fields["type"]:value(type_name, "Xray")
o = s:option(Flag, _n("custom"), translate("Use Custom Config"))
o = s:option(ListValue, _n("protocol"), translate("Protocol"))
@@ -1,34 +1,37 @@
local m, s = ...
local api = require "luci.passwall.api"
local singbox_bin = api.finded_com("sing-box")
if not singbox_bin then
return
end
local fs = api.fs
local singbox_tags = luci.sys.exec(singbox_bin .. " version | grep 'Tags:' | awk '{print $2}'")
local type_name = "sing-box"
-- [[ Sing-Box ]]
s.fields["type"]:value(type_name, "Sing-Box")
if not s.fields["type"].default then
s.fields["type"].default = type_name
end
if s.val["type"] and s.val["type"] ~= type_name then
return
end
local option_prefix = "singbox_"
local function _n(name)
return option_prefix .. name
end
local singbox_tags = luci.sys.exec(singbox_bin .. " version | grep 'Tags:' | awk '{print $2}'")
local ss_method_list = {
"none", "aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305",
"2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305"
}
-- [[ Sing-Box ]]
s.fields["type"]:value(type_name, "Sing-Box")
o = s:option(Flag, _n("custom"), translate("Use Custom Config"))
o = s:option(ListValue, _n("protocol"), translate("Protocol"))
@@ -55,7 +58,6 @@ o:depends({ [_n("custom")] = false })
o = s:option(Value, _n("port"), translate("Listen Port"))
o.datatype = "port"
o.rmempty = false
o:depends({ [_n("custom")] = false })
o = s:option(Flag, _n("auth"), translate("Auth"))
@@ -1,7 +1,5 @@
local m, s = ...
local api = require "luci.passwall.api"
if not api.is_finded("microsocks") then
return
end
@@ -17,6 +15,13 @@ end
-- [[ microsocks ]]
s.fields["type"]:value(type_name, "Socks")
if not s.fields["type"].default then
s.fields["type"].default = type_name
end
if s.val["type"] and s.val["type"] ~= type_name then
return
end
o = s:option(Value, _n("port"), translate("Listen Port"))
o.datatype = "port"
@@ -1,13 +1,19 @@
local m, s = ...
local api = require "luci.passwall.api"
if not api.is_finded("ssserver") then
return
end
local type_name = "SS-Rust"
-- [[ Shadowsocks Rust ]]
s.fields["type"]:value(type_name, translate("Shadowsocks Rust"))
if s.val["type"] and s.val["type"] ~= type_name then
return
end
local option_prefix = "ssrust_"
local function _n(name)
@@ -20,10 +26,6 @@ local ssrust_encrypt_method_list = {
"2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305"
}
-- [[ Shadowsocks Rust ]]
s.fields["type"]:value(type_name, translate("Shadowsocks Rust"))
o = s:option(Flag, _n("custom"), translate("Use Custom Config"))
o = s:option(Value, _n("port"), translate("Listen Port"))
@@ -1,13 +1,19 @@
local m, s = ...
local api = require "luci.passwall.api"
if not api.is_finded("ssr-server") then
return
end
local type_name = "SSR"
-- [[ ShadowsocksR ]]
s.fields["type"]:value(type_name, translate("ShadowsocksR"))
if s.val["type"] and s.val["type"] ~= type_name then
return
end
local option_prefix = "ssr_"
local function _n(name)
@@ -33,10 +39,6 @@ local ssr_obfs_list = {
"tls1.0_session_auth", "tls1.2_ticket_auth"
}
-- [[ ShadowsocksR ]]
s.fields["type"]:value(type_name, translate("ShadowsocksR"))
o = s:option(Flag, _n("custom"), translate("Use Custom Config"))
o = s:option(Value, _n("port"), translate("Listen Port"))
@@ -1,7 +1,6 @@
local api = require "luci.passwall.api"
local appname = api.appname
local fs = api.fs
local types_dir = "/usr/lib/lua/luci/model/cbi/" .. appname .. "/server/type/"
api = require "luci.passwall.api"
appname = api.appname
fs = api.fs
m = Map("passwall_server", translate("Server Config"))
m.redirect = api.url("server")
@@ -11,12 +10,21 @@ if not arg[1] or not m:get(arg[1]) then
luci.http.redirect(m.redirect)
end
local header = Template(appname .. "/server/config_header")
header.api = api
header.config = m.config
header.section = arg[1]
m:append(header)
m:append(Template(appname .. "/cbi/nodes_listvalue_com"))
s = m:section(NamedSection, arg[1], "user", "")
s.addremove = false
s.dynamic = false
local types_dir = "/usr/lib/lua/luci/model/cbi/" .. appname .. "/server/type/"
s.val = m:get(arg[1]) or {}
o = s:option(Flag, "enable", translate("Enable"))
o.default = "1"
o.rmempty = false
@@ -32,9 +40,9 @@ for filename in fs.dir(types_dir) do
table.insert(type_table, filename)
end
table.sort(type_table, function(a, b)
if a == "socks.lua" then return true end
if b == "socks.lua" then return false end
return a < b
if a == "socks.lua" then return true end
if b == "socks.lua" then return false end
return a < b
end)
for index, value in ipairs(type_table) do
@@ -42,4 +50,10 @@ for index, value in ipairs(type_table) do
setfenv(p_func, getfenv(1))(m, s)
end
local footer = Template(appname .. "/server/config_footer")
footer.api = api
footer.config = m.config
footer.section = arg[1]
m:append(footer)
return m