luci-app-passwall2: sync upstream
This commit is contained in:
parent
bf95a9f9ca
commit
d417673075
@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall2
|
||||
PKG_VERSION:=1.25-1
|
||||
PKG_VERSION:=1.25-3
|
||||
PKG_RELEASE:=
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
@ -237,10 +237,8 @@ o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encryp
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "chacha20-poly1305" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "xchacha20-poly1305" })
|
||||
|
||||
o = s:option(Flag, option_name("uot"), translate("UDP over TCP"), translate("Need Xray-core or sing-box as server side."))
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "2022-blake3-aes-128-gcm" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "2022-blake3-aes-256-gcm" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("x_ss_encrypt_method")] = "2022-blake3-chacha20-poly1305" })
|
||||
o = s:option(Flag, option_name("uot"), translate("UDP over TCP"))
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks" })
|
||||
|
||||
o = s:option(Value, option_name("uuid"), translate("ID"))
|
||||
o.password = true
|
||||
|
@ -231,10 +231,9 @@ if singbox_tags:find("with_shadowsocksr") then
|
||||
o:depends({ [option_name("protocol")] = "shadowsocksr" })
|
||||
end
|
||||
|
||||
o = s:option(Flag, option_name("uot"), translate("UDP over TCP"), translate("Need Xray-core or sing-box as server side."))
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("ss_method")] = "2022-blake3-aes-128-gcm" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("ss_method")] = "2022-blake3-aes-256-gcm" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("ss_method")] = "2022-blake3-chacha20-poly1305" })
|
||||
o = s:option(Flag, option_name("uot"), translate("UDP over TCP"))
|
||||
o:depends({ [option_name("protocol")] = "socks" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks" })
|
||||
|
||||
o = s:option(Value, option_name("uuid"), translate("ID"))
|
||||
o.password = true
|
||||
|
@ -184,7 +184,10 @@ function gen_outbound(flag, node, tag, proxy_table)
|
||||
version = "5",
|
||||
username = (node.username and node.password) and node.username or nil,
|
||||
password = (node.username and node.password) and node.password or nil,
|
||||
udp_over_tcp = false,
|
||||
udp_over_tcp = node.uot == "1" and {
|
||||
enabled = true,
|
||||
version = 2
|
||||
} or nil,
|
||||
}
|
||||
end
|
||||
|
||||
@ -735,6 +738,8 @@ function gen_config(var)
|
||||
local loglevel = var["-loglevel"] or "warn"
|
||||
local logfile = var["-logfile"] or "/dev/null"
|
||||
local node_id = var["-node"]
|
||||
local server_host = var["-server_host"]
|
||||
local server_port = var["-server_port"]
|
||||
local tcp_proxy_way = var["-tcp_proxy_way"]
|
||||
local redir_port = var["-redir_port"]
|
||||
local local_socks_address = var["-local_socks_address"] or "0.0.0.0"
|
||||
@ -862,6 +867,10 @@ function gen_config(var)
|
||||
local default_outTag = nil
|
||||
|
||||
if node then
|
||||
if server_host and server_port then
|
||||
node.address = server_host
|
||||
node.port = server_port
|
||||
end
|
||||
if node.protocol == "_shunt" then
|
||||
local rules = {}
|
||||
|
||||
@ -879,6 +888,7 @@ function gen_config(var)
|
||||
password = parsed1.password,
|
||||
address = parsed1.host,
|
||||
port = parsed1.port,
|
||||
uot = "1",
|
||||
}
|
||||
local preproxy_outbound = gen_outbound(flag, _node, preproxy_tag)
|
||||
if preproxy_outbound then
|
||||
@ -935,6 +945,7 @@ function gen_config(var)
|
||||
password = parsed1.password,
|
||||
address = parsed1.host,
|
||||
port = parsed1.port,
|
||||
uot = "1",
|
||||
}
|
||||
local _outbound = gen_outbound(flag, _node, rule_name)
|
||||
if _outbound then
|
||||
@ -963,10 +974,6 @@ function gen_config(var)
|
||||
local pre_proxy = nil
|
||||
if _node.type ~= "sing-box" then
|
||||
pre_proxy = true
|
||||
else
|
||||
if _node.flow == "xtls-rprx-vision" then
|
||||
pre_proxy = true
|
||||
end
|
||||
end
|
||||
if pre_proxy then
|
||||
new_port = get_new_port()
|
||||
|
@ -507,6 +507,8 @@ function gen_config(var)
|
||||
local flag = var["-flag"]
|
||||
local loglevel = var["-loglevel"] or "warning"
|
||||
local node_id = var["-node"]
|
||||
local server_host = var["-server_host"]
|
||||
local server_port = var["-server_port"]
|
||||
local tcp_proxy_way = var["-tcp_proxy_way"]
|
||||
local redir_port = var["-redir_port"]
|
||||
local local_socks_address = var["-local_socks_address"] or "0.0.0.0"
|
||||
@ -679,6 +681,10 @@ function gen_config(var)
|
||||
end
|
||||
|
||||
for k, v in pairs(nodes) do
|
||||
if server_host and server_port then
|
||||
v.address = server_host
|
||||
v.port = server_port
|
||||
end
|
||||
local node = v
|
||||
if node.protocol == "_shunt" then
|
||||
local rules = {}
|
||||
|
@ -365,25 +365,30 @@ local api = require "luci.passwall2.api"
|
||||
url += url_protocol;
|
||||
url += params;
|
||||
} else if ((v_type === "Hysteria2") || (v_type === "sing-box" && opt.get(dom_prefix + "protocol").value === "hysteria2")) {
|
||||
protocol = "hysteria2";
|
||||
var v_port = opt.get(dom_prefix + "port");
|
||||
var params = "";
|
||||
params += opt.query("sni", dom_prefix + "tls_serverName");
|
||||
params += opt.query("insecure", dom_prefix + "tls_allowInsecure");
|
||||
|
||||
var v_password = null;
|
||||
params += opt.query("obfs", "salamander");
|
||||
if (v_type === "Hysteria2") {
|
||||
v_password = opt.get("hysteria2_auth_password");
|
||||
params += opt.query("obfs-password", "hysteria2_obfs");
|
||||
params += opt.query("auth", "hysteria2_auth_password");
|
||||
params += opt.query("pinSHA256", "hysteria2_tls_pinSHA256");
|
||||
} else {
|
||||
v_password = opt.get(dom_prefix + "hysteria2_auth_password");
|
||||
params += opt.query("obfs-password", dom_prefix + "hysteria2_obfs_password");
|
||||
params += opt.query("auth", dom_prefix + "hysteria2_auth_password");
|
||||
}
|
||||
var url =
|
||||
url =
|
||||
_address + ":" +
|
||||
v_port.value + "?" +
|
||||
params +
|
||||
"#" + encodeURI(v_alias.value);
|
||||
if (v_password) {
|
||||
url = encodeURIComponent(v_password.value) + "@" + url
|
||||
}
|
||||
}
|
||||
if (url) {
|
||||
url = protocol.toLowerCase() + "://" + url;
|
||||
|
@ -1015,9 +1015,6 @@ msgstr "IV 检查"
|
||||
msgid "UDP over TCP"
|
||||
msgstr "TCP 封装 UDP"
|
||||
|
||||
msgid "Need Xray-core or sing-box as server side."
|
||||
msgstr "需要 Xray-core 或者 sing-box 作为服务器端。"
|
||||
|
||||
msgid "Connection Timeout"
|
||||
msgstr "连接超时时间"
|
||||
|
||||
|
@ -518,6 +518,7 @@ run_socks() {
|
||||
config_file=$(echo $config_file | sed "s/SOCKS/HTTP_SOCKS/g")
|
||||
local _extra_param="-local_http_port $http_port"
|
||||
}
|
||||
[ -n "$relay_port" ] && _extra_param="${_extra_param} -server_host $server_host -server_port $port"
|
||||
lua $UTIL_SINGBOX gen_config -flag SOCKS_$flag -node $node -local_socks_port $socks_port ${_extra_param} > $config_file
|
||||
ln_run "$(first_type $(config_t_get global_app singbox_file) sing-box)" "sing-box" $log_file run -c "$config_file"
|
||||
;;
|
||||
@ -527,6 +528,7 @@ run_socks() {
|
||||
config_file=$(echo $config_file | sed "s/SOCKS/HTTP_SOCKS/g")
|
||||
local _extra_param="-local_http_port $http_port"
|
||||
}
|
||||
[ -n "$relay_port" ] && _extra_param="${_extra_param} -server_host $server_host -server_port $port"
|
||||
lua $UTIL_XRAY gen_config -flag SOCKS_$flag -node $node -local_socks_port $socks_port ${_extra_param} > $config_file
|
||||
ln_run "$(first_type $(config_t_get global_app xray_file) xray)" "xray" $log_file run -c "$config_file"
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user