From 23d7257629170694a10345b2fa9688834802f2b4 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Wed, 7 Oct 2020 03:09:56 +0800 Subject: [PATCH] luci-app-passwall: bump to 3.9-68 --- package/lienol/luci-app-passwall/Makefile | 4 ++-- .../model/cbi/passwall/api/gen_naiveproxy.lua | 10 +++------- .../model/cbi/passwall/api/gen_shadowsocks.lua | 11 ++++++----- .../luasrc/model/cbi/passwall/api/gen_trojan.lua | 11 ++++------- .../luasrc/model/cbi/passwall/api/gen_v2ray.lua | 2 +- .../model/cbi/passwall/client/node_config.lua | 14 ++++++++------ .../root/usr/share/passwall/app.sh | 15 +++++++-------- 7 files changed, 31 insertions(+), 36 deletions(-) diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile index 444634704b..38c25c4a83 100644 --- a/package/lienol/luci-app-passwall/Makefile +++ b/package/lienol/luci-app-passwall/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=3.9 -PKG_RELEASE:=66 -PKG_DATE:=20201004 +PKG_RELEASE:=68 +PKG_DATE:=20201006 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_naiveproxy.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_naiveproxy.lua index f45ca60cb9..c6650b41c4 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_naiveproxy.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_naiveproxy.lua @@ -4,17 +4,13 @@ local node_section = arg[1] local run_type = arg[2] local local_addr = arg[3] local local_port = arg[4] -local relay_port = arg[5] +local server_host = arg[5] +local server_port = arg[6] local node = ucursor:get_all("passwall", node_section) -if relay_port and relay_port ~= "nil" then - node.address = "127.0.0.1" - node.port = tonumber(relay_port) -end - local config = { listen = run_type .. "://" .. local_addr .. ":" .. local_port, - proxy = node.protocol .. "://" .. node.username .. ":" .. node.password .. "@" .. node.address .. ":" .. node.port + proxy = node.protocol .. "://" .. node.username .. ":" .. node.password .. "@" .. (server_host or node.address) .. ":" .. (server_port or node.port) } print(jsonc.stringify(config, 1)) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_shadowsocks.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_shadowsocks.lua index d783b28423..7ab2b32ac2 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_shadowsocks.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_shadowsocks.lua @@ -1,15 +1,16 @@ local ucursor = require "luci.model.uci".cursor() local jsonc = require "luci.jsonc" local node_section = arg[1] -local local_port = arg[2] -local server_host = arg[3] -local server_port = arg[4] +local local_addr = arg[2] +local local_port = arg[3] +local server_host = arg[4] +local server_port = arg[5] local node = ucursor:get_all("passwall", node_section) local config = { server = server_host or node.address, - server_port = server_port or tonumber(node.port), - local_address = "0.0.0.0", + server_port = tonumber(server_port) or tonumber(node.port), + local_address = local_addr, local_port = tonumber(local_port), password = node.password, method = node.method, diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_trojan.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_trojan.lua index a8e75f5dd8..6940ce8af3 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_trojan.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_trojan.lua @@ -4,7 +4,8 @@ local node_section = arg[1] local run_type = arg[2] local local_addr = arg[3] local local_port = arg[4] -local relay_port = arg[5] +local server_host = arg[5] +local server_port = arg[6] local node = ucursor:get_all("passwall", node_section) local cipher = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA" @@ -13,8 +14,8 @@ local trojan = { run_type = run_type, local_addr = local_addr, local_port = tonumber(local_port), - remote_addr = node.address, - remote_port = tonumber(node.port), + remote_addr = server_host or node.address, + remote_port = tonumber(server_port) or tonumber(node.port), password = {node.password}, log_level = 1, ssl = { @@ -68,8 +69,4 @@ if node.type == "Trojan-Go" then password = node.ss_aead_pwd or "" } or nil end -if relay_port and relay_port ~= "nil" then - trojan.remote_addr = "127.0.0.1" - trojan.remote_port = tonumber(relay_port) -end print(json.stringify(trojan, 1)) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua index 52495f2fc3..0872e77402 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua @@ -127,7 +127,7 @@ local function gen_outbound(node, tag, relay_port) level = node.level and tonumber(node.level) or 0, security = (node.protocol == "vmess") and node.security or nil, encryption = node.encryption or "none", - flow = (node.stream_security == "xtls") and node.flow or nil + flow = node.flow or nil } } } diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua index 18e620a89d..a7029be285 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua @@ -374,6 +374,14 @@ level:depends({ type = "V2ray", protocol = "vmess" }) level:depends({ type = "V2ray", protocol = "vless" }) level:depends({ type = "V2ray", protocol = "trojan" }) +flow = s:option(Value, "flow", translate("flow")) +flow.placeholder = "xtls-rprx-origin" +--flow:value("xtls-rprx-origin") +--flow:value("xtls-rprx-origin-udp443") +--flow:value("xtls-rprx-direct") +--flow:value("xtls-rprx-direct-udp443") +flow:depends({ type = "V2ray", protocol = "vless" }) + stream_security = s:option(ListValue, "stream_security", translate("Transport Layer Encryption"), translate('Whether or not transport layer encryption is enabled, "none" for unencrypted, "tls" for using TLS, "xtls" for using XTLS.')) stream_security:value("none", "none") stream_security:value("tls", "tls") @@ -394,12 +402,6 @@ stream_security.validate = function(self, value) return value end -flow = s:option(Value, "flow", translate("flow")) -flow.default = "xtls-rprx-origin" -flow:value("xtls-rprx-origin") -flow:value("xtls-rprx-origin-udp443") -flow:depends("stream_security", "xtls") - -- [[ TLS部分 ]] -- tls_sessionTicket = s:option(Flag, "tls_sessionTicket", translate("Session Ticket")) tls_sessionTicket.default = "0" diff --git a/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh b/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh index 22005f34fa..635c651223 100755 --- a/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh @@ -318,7 +318,6 @@ run_socks() { [ -n "$relay_port" ] && { server_host="127.0.0.1" port=$relay_port - echo $relay_port } local msg tmp @@ -353,15 +352,15 @@ run_socks() { ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray -config="$config_file" ;; trojan-go) - lua $API_GEN_TROJAN $node client $bind $local_port $port > $config_file + lua $API_GEN_TROJAN $node client $bind $local_port $server_host $port > $config_file ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go -config "$config_file" ;; trojan*) - lua $API_GEN_TROJAN $node client $bind $local_port $port > $config_file + lua $API_GEN_TROJAN $node client $bind $local_port $server_host $port > $config_file ln_start_bin "$(first_type ${type})" "${type}" -c "$config_file" ;; naiveproxy) - lua $API_GEN_NAIVE $node socks $bind $local_port $port > $config_file + lua $API_GEN_NAIVE $node socks $bind $local_port $server_host $port > $config_file ln_start_bin "$(first_type naive)" naive "$config_file" ;; brook) @@ -373,7 +372,7 @@ run_socks() { ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_SOCKS_$5" "$protocol" --socks5 "$bind:$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)" ;; ss|ssr) - lua $API_GEN_SS $node $local_port $server_host $port > $config_file + lua $API_GEN_SS $node "0.0.0.0" $local_port $server_host $port > $config_file ln_start_bin "$(first_type ${type}-local)" "${type}-local" -c "$config_file" -b "$bind" -u ;; esac @@ -438,7 +437,7 @@ run_redir() { fi ;; ss|ssr) - lua $API_GEN_SS $node $local_port > $config_file + lua $API_GEN_SS $node "0.0.0.0" $local_port > $config_file ln_start_bin "$(first_type ${type}-redir)" "${type}-redir" -c "$config_file" -U ;; esac @@ -514,11 +513,11 @@ run_redir() { ;; ss|ssr) if [ "$kcptun_use" == "1" ]; then - lua $API_GEN_SS $node $local_port 127.0.0.1 $KCPTUN_REDIR_PORT > $config_file + lua $API_GEN_SS $node "0.0.0.0" $local_port "127.0.0.1" $KCPTUN_REDIR_PORT > $config_file process=1 [ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && echolog "Kcptun不支持UDP转发!" else - lua $API_GEN_SS $node $local_port > $config_file + lua $API_GEN_SS $node "0.0.0.0" $local_port > $config_file [ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param="-u" fi for k in $(seq 1 $process); do