luci: fix known bugs
This commit is contained in:
parent
3b419bd4ad
commit
2518b3aea5
@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=4.73-1
|
||||
PKG_VERSION:=4.73-2
|
||||
PKG_RELEASE:=
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
@ -734,6 +734,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 tcp_redir_port = var["-tcp_redir_port"]
|
||||
local udp_redir_port = var["-udp_redir_port"]
|
||||
@ -787,6 +789,12 @@ function gen_config(var)
|
||||
local default_outTag = nil
|
||||
if node_id then
|
||||
local node = uci:get_all(appname, node_id)
|
||||
if node then
|
||||
if server_host and server_port then
|
||||
node.address = server_host
|
||||
node.port = server_port
|
||||
end
|
||||
end
|
||||
|
||||
if local_socks_port then
|
||||
local inbound = {
|
||||
@ -964,10 +972,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()
|
||||
|
@ -510,6 +510,8 @@ end
|
||||
function gen_config(var)
|
||||
local flag = var["-flag"]
|
||||
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"] or "redirect"
|
||||
local tcp_redir_port = var["-tcp_redir_port"]
|
||||
local udp_redir_port = var["-udp_redir_port"]
|
||||
@ -545,6 +547,12 @@ function gen_config(var)
|
||||
|
||||
if node_id then
|
||||
local node = uci:get_all(appname, node_id)
|
||||
if node then
|
||||
if server_host and server_port then
|
||||
node.address = server_host
|
||||
node.port = server_port
|
||||
end
|
||||
end
|
||||
if local_socks_port then
|
||||
local inbound = {
|
||||
tag = "socks-in",
|
||||
|
@ -415,25 +415,38 @@ local api = require "luci.passwall.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");
|
||||
|
||||
params += opt.query("obfs", "salamander");
|
||||
var v_password = null;
|
||||
|
||||
if (v_type === "Hysteria2") {
|
||||
params += opt.query("obfs-password", "hysteria2_obfs");
|
||||
params += opt.query("auth", "hysteria2_auth_password");
|
||||
v_password = opt.get("hysteria2_auth_password");
|
||||
params += opt.query("pinSHA256", "hysteria2_tls_pinSHA256");
|
||||
var dom_obfs = opt.get("hysteria2_obfs");
|
||||
if (dom_obfs && dom_obfs.value != "") {
|
||||
params += "&obfs=" + "salamander";
|
||||
params += opt.query("obfs-password", "hysteria2_obfs");
|
||||
}
|
||||
} else {
|
||||
params += opt.query("obfs-password", dom_prefix + "hysteria2_obfs_password");
|
||||
params += opt.query("auth", dom_prefix + "hysteria2_auth_password");
|
||||
v_password = opt.get(dom_prefix + "hysteria2_auth_password");
|
||||
var dom_obfs_type = opt.get(dom_prefix + "hysteria2_obfs_type");
|
||||
if (dom_obfs_type && dom_obfs_type.value != "") {
|
||||
params += opt.query("obfs", dom_prefix + "hysteria2_obfs_type");
|
||||
params += opt.query("obfs-password", dom_prefix + "hysteria2_obfs_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;
|
||||
|
@ -594,6 +594,7 @@ run_socks() {
|
||||
config_file=$(echo $config_file | sed "s/SOCKS/HTTP_SOCKS/g")
|
||||
local _args="http_port=$http_port"
|
||||
}
|
||||
[ -n "$relay_port" ] && _args="${_args} -server_host $server_host -server_port $port"
|
||||
run_singbox flag=$flag node=$node socks_port=$socks_port config_file=$config_file log_file=$log_file ${_args}
|
||||
;;
|
||||
xray)
|
||||
@ -602,6 +603,7 @@ run_socks() {
|
||||
config_file=$(echo $config_file | sed "s/SOCKS/HTTP_SOCKS/g")
|
||||
local _args="http_port=$http_port"
|
||||
}
|
||||
[ -n "$relay_port" ] && _args="${_args} -server_host $server_host -server_port $port"
|
||||
run_xray flag=$flag node=$node socks_port=$socks_port config_file=$config_file log_file=$log_file ${_args}
|
||||
;;
|
||||
trojan-go)
|
||||
|
@ -398,7 +398,12 @@ local function processData(szType, content, add_mode, add_from)
|
||||
result.remarks = info.ps
|
||||
-- result.mux = 1
|
||||
-- result.mux_concurrency = 8
|
||||
|
||||
if not info.net then
|
||||
info.net = "tcp"
|
||||
end
|
||||
info.net = string.lower(info.net)
|
||||
result.transport = info.net
|
||||
if info.net == 'ws' then
|
||||
result.ws_host = info.host
|
||||
result.ws_path = info.path
|
||||
@ -434,7 +439,6 @@ local function processData(szType, content, add_mode, add_from)
|
||||
if info.net == 'grpc' then
|
||||
result.grpc_serviceName = info.path
|
||||
end
|
||||
result.transport = info.net
|
||||
if not info.security then result.security = "auto" end
|
||||
if info.tls == "tls" or info.tls == "1" then
|
||||
result.tls = "1"
|
||||
@ -757,7 +761,11 @@ local function processData(szType, content, add_mode, add_from)
|
||||
result.address = host_port
|
||||
end
|
||||
|
||||
if not params.type then
|
||||
params.type = "tcp"
|
||||
end
|
||||
params.type = string.lower(params.type)
|
||||
result.transport = params.type
|
||||
if params.type == 'ws' then
|
||||
result.ws_host = params.host
|
||||
result.ws_path = params.path
|
||||
@ -793,7 +801,6 @@ local function processData(szType, content, add_mode, add_from)
|
||||
if params.serviceName then result.grpc_serviceName = params.serviceName end
|
||||
result.grpc_mode = params.mode
|
||||
end
|
||||
result.transport = params.type
|
||||
|
||||
result.encryption = params.encryption or "none"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user