luci-app-passwall: sync with upstream source

This commit is contained in:
CN_SZTL 2020-01-22 20:52:23 +08:00
parent 33f062d700
commit 3fd41be750
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
6 changed files with 52 additions and 3 deletions

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=3.3
PKG_RELEASE:=32-20200121
PKG_RELEASE:=33-20200122
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

View File

@ -105,7 +105,9 @@ else
o = s:option(DummyValue, "type", translate("Type"))
o.cfgvalue = function(t, n)
local v = Value.cfgvalue(t, n)
return translate(v)
if v then
return translate(v)
end
end
---- Address

View File

@ -161,7 +161,7 @@ table td, .table .td {
var address = document.getElementById("cbid.passwall." + cbi_id + ".address").value;
var port = document.getElementById("cbid.passwall." + cbi_id + ".port").value;
<% end %>
if ((address != null && address != "") && (port != null && port != "")) {
if ((address != null && address != "") && (port != null && port != "")) {
ajax.post('<%=dsp.build_url("admin/vpn/passwall/ping_node")%>', {
index: index,
address: address,
@ -211,6 +211,9 @@ table td, .table .td {
auto_ping();
},
);
} else {
index++;
auto_ping();
}
}
else {

View File

@ -302,6 +302,28 @@ gen_start_config() {
else
echolog "找不到V2ray客户端主程序无法启用"
fi
elif [ "$type" == "v2ray_balancing" ]; then
local balancing_node=$(config_n_get $node v2ray_balancing_node)
balancing_node_address=""
for node_id in $balancing_node
do
local address=$(config_n_get $node_id address)
local port=$(config_n_get $node_id port)
local temp=""
if [ -z "$balancing_node_address" ]; then
temp="${address}:${port}"
else
temp="${balancing_node_address}\n${address}:${port}"
fi
balancing_node_address="$temp"
done
lua $API_GEN_V2RAY $node nil nil $local_port >$config_file
v2ray_path=$(config_t_get global_app v2ray_file $(find_bin v2ray))
if [ -f "${v2ray_path}/v2ray" ]; then
${v2ray_path}/v2ray -config=$config_file >/dev/null &
else
echolog "找不到V2ray客户端主程序无法启用"
fi
elif [ "$type" == "trojan" ]; then
lua $API_GEN_TROJAN $node client "0.0.0.0" $local_port >$config_file
trojan_bin=$(find_bin trojan)
@ -366,6 +388,28 @@ gen_start_config() {
else
echolog "找不到V2ray客户端主程序无法启用"
fi
elif [ "$type" == "v2ray_balancing" ]; then
local balancing_node=$(config_n_get $node v2ray_balancing_node)
balancing_node_address=""
for node_id in $balancing_node
do
local address=$(config_n_get $node_id address)
local port=$(config_n_get $node_id port)
local temp=""
if [ -z "$balancing_node_address" ]; then
temp="${address}:${port}"
else
temp="${balancing_node_address}\n${address}:${port}"
fi
balancing_node_address="$temp"
done
lua $API_GEN_V2RAY $node udp $local_port nil >$config_file
v2ray_path=$(config_t_get global_app v2ray_file $(find_bin v2ray))
if [ -f "${v2ray_path}/v2ray" ]; then
${v2ray_path}/v2ray -config=$config_file >/dev/null &
else
echolog "找不到V2ray客户端主程序无法启用"
fi
elif [ "$type" == "trojan" ]; then
SOCKS5_PROXY_PORT4=$(expr $SOCKS5_PROXY_PORT3 + 1)
local_port=$(get_not_exists_port_after $SOCKS5_PROXY_PORT4 tcp)