mirror of
https://github.com/roacn/openwrt-packages.git
synced 2025-01-08 11:57:31 +08:00
💐 Sync 2023-03-22 20:39
This commit is contained in:
parent
b9c4c194f6
commit
7093a9dc90
@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=brook
|
||||
PKG_VERSION:=20230122
|
||||
PKG_VERSION:=20230401
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/txthinking/brook/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=52643df51144b4b1afbacb51156f92ba61adbcff77dd8f76e3278ce70644f237
|
||||
PKG_HASH:=332069845b9c205070c0edbddc9e0204187499b97d4d1bda593535d775f556a3
|
||||
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
|
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=4.60
|
||||
PKG_RELEASE:=4
|
||||
PKG_RELEASE:=5
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \
|
||||
|
@ -1476,14 +1476,18 @@ acl_app() {
|
||||
|
||||
local type=$(echo $(config_n_get $tcp_node type) | tr 'A-Z' 'a-z')
|
||||
if [ -n "${type}" ] && ([ "${type}" = "v2ray" ] || [ "${type}" = "xray" ]); then
|
||||
config_file=$(echo $config_file | sed "s/SOCKS/TCP_UDP_SOCKS/g")
|
||||
config_file=$(echo $config_file | sed "s/SOCKS/TCP_SOCKS/g")
|
||||
_extra_param="socks_address=127.0.0.1 socks_port=$socks_port"
|
||||
if [ "$dns_mode" = "v2ray" -o "$dns_mode" = "xray" ]; then
|
||||
config_file=$(echo $config_file | sed "s/SOCKS_${socks_port}/DNS/g")
|
||||
config_file=$(echo $config_file | sed "s/TCP_/DNS_TCP_/g")
|
||||
dns_port=$(get_new_port $(expr $dns_port + 1))
|
||||
_dns_port=$dns_port
|
||||
_extra_param="dns_listen_port=${_dns_port} remote_dns_protocol=${v2ray_dns_mode} remote_dns_tcp_server=${remote_dns} remote_dns_doh=${remote_dns} dns_client_ip=${dns_client_ip} dns_query_strategy=${DNS_QUERY_STRATEGY}"
|
||||
fi
|
||||
[ "$udp_node" != "nil" ] && [ "$udp_node" = "tcp" ] && {
|
||||
config_file=$(echo $config_file | sed "s/TCP_/TCP_UDP_/g")
|
||||
_extra_param="${_extra_param} udp_redir_port=$redir_port"
|
||||
}
|
||||
config_file="$TMP_PATH/$config_file"
|
||||
run_v2ray flag=$tcp_node node=$tcp_node tcp_redir_port=$redir_port ${_extra_param} config_file=$config_file
|
||||
else
|
||||
@ -1503,9 +1507,16 @@ acl_app() {
|
||||
[ "$udp_node" != "nil" ] && {
|
||||
[ "$udp_node" = "tcp" ] && udp_node=$tcp_node
|
||||
if [ "$udp_node" = "default" ]; then
|
||||
udp_node=$UDP_NODE
|
||||
[ "$TCP_UDP" = "1" ] && [ "$udp_node" = "nil" ] && udp_node=$TCP_NODE
|
||||
udp_port=$UDP_REDIR_PORT
|
||||
if [ "$TCP_UDP" = "0" ] && [ "$UDP_NODE" = "nil" ]; then
|
||||
udp_node="nil"
|
||||
unset udp_port
|
||||
elif [ "$TCP_UDP" = "1" ] && [ "$udp_node" = "nil" ]; then
|
||||
udp_node=$TCP_NODE
|
||||
udp_port=$TCP_REDIR_PORT
|
||||
else
|
||||
udp_node=$UDP_NODE
|
||||
udp_port=$UDP_REDIR_PORT
|
||||
fi
|
||||
else
|
||||
[ "$(config_get_type $udp_node nil)" = "nodes" ] && {
|
||||
if [ "$udp_node" = "$UDP_NODE" ]; then
|
||||
|
@ -8,7 +8,6 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Xray \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_SagerNet_Core \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_IPT2Socks \
|
||||
@ -38,8 +37,6 @@ LUCI_DEPENDS:= \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray-core \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:curl \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray-core \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_SagerNet_Core:curl \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_SagerNet_Core:sagernet-core \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG:chinadns-ng \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria:hysteria \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_IPT2Socks:ipt2socks \
|
||||
@ -109,9 +106,6 @@ choice
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Xray
|
||||
bool "Xray-core"
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_SagerNet_Core
|
||||
bool "SagerNet-core (An enhanced edition of v2ray-core)"
|
||||
endchoice
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG
|
||||
|
@ -57,12 +57,6 @@ o:value("https://ispip.clang.cn/all_cn_cidr.txt", translate("Clang.CN.CIDR"))
|
||||
o:value("https://fastly.jsdelivr.net/gh/gaoyifan/china-operator-ip@ip-lists/china.txt", translate("china-operator-ip"))
|
||||
o.default = "https://ispip.clang.cn/all_cn.txt"
|
||||
|
||||
o = s:option(ListValue, "default_packet_encoding", translate("Default Packet Encoding"))
|
||||
o:value("none", translate("none"))
|
||||
o:value("packet", translate("packet (v2ray-core v5+)"))
|
||||
o:value("xudp", translate("xudp (Xray-core)"))
|
||||
o.default = "xudp"
|
||||
|
||||
o = s:option(Flag, "netflix_enable", translate("Enable Netflix Mode"))
|
||||
o.rmempty = false
|
||||
|
||||
|
@ -184,9 +184,6 @@ o:value("vless", translate("VLESS"))
|
||||
o:value("vmess", translate("VMess"))
|
||||
o:value("trojan", translate("Trojan"))
|
||||
o:value("shadowsocks", translate("Shadowsocks"))
|
||||
if is_installed("sagernet-core") then
|
||||
o:value("shadowsocksr", translate("ShadowsocksR"))
|
||||
end
|
||||
if is_finded("xray") then
|
||||
o:value("wireguard", translate("WireGuard"))
|
||||
end
|
||||
@ -244,7 +241,6 @@ o:depends({type = "socks5", auth_enable = true})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "http", auth_enable = true})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "socks", socks_ver = "5", auth_enable = true})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "trojan"})
|
||||
|
||||
o = s:option(ListValue, "encrypt_method", translate("Encrypt Method"))
|
||||
@ -253,7 +249,6 @@ for _, v in ipairs(encrypt_methods) do
|
||||
end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
|
||||
o = s:option(ListValue, "encrypt_method_ss", translate("Encrypt Method"))
|
||||
for _, v in ipairs(encrypt_methods_ss) do
|
||||
@ -277,10 +272,10 @@ o.default = "1"
|
||||
-- Shadowsocks Plugin
|
||||
o = s:option(Value, "plugin", translate("Obfs"))
|
||||
o:value("none", translate("None"))
|
||||
if is_finded("obfs-local") or is_installed("sagernet-core") then
|
||||
if is_finded("obfs-local") then
|
||||
o:value("obfs-local", translate("obfs-local"))
|
||||
end
|
||||
if is_finded("v2ray-plugin") or is_installed("sagernet-core") then
|
||||
if is_finded("v2ray-plugin") then
|
||||
o:value("v2ray-plugin", translate("v2ray-plugin"))
|
||||
end
|
||||
if is_finded("xray-plugin") then
|
||||
@ -288,16 +283,10 @@ if is_finded("xray-plugin") then
|
||||
end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ss")
|
||||
if is_installed("sagernet-core") then
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
||||
end
|
||||
|
||||
o = s:option(Value, "plugin_opts", translate("Plugin Opts"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "ss")
|
||||
if is_installed("sagernet-core") then
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "protocol", translate("Protocol"))
|
||||
for _, v in ipairs(protocol) do
|
||||
@ -305,11 +294,9 @@ for _, v in ipairs(protocol) do
|
||||
end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
|
||||
o = s:option(Value, "protocol_param", translate("Protocol param (optional)"))
|
||||
o:depends("type", "ssr")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
|
||||
o = s:option(ListValue, "obfs", translate("Obfs"))
|
||||
for _, v in ipairs(obfs) do
|
||||
@ -317,11 +304,9 @@ for _, v in ipairs(obfs) do
|
||||
end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
|
||||
o = s:option(Value, "obfs_param", translate("Obfs param (optional)"))
|
||||
o:depends("type", "ssr")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
|
||||
-- [[ Hysteria ]]--
|
||||
o = s:option(ListValue, "hysteria_protocol", translate("Protocol"))
|
||||
@ -478,21 +463,17 @@ o:depends("transport", "ws")
|
||||
o.rmempty = true
|
||||
|
||||
if is_finded("v2ray") then
|
||||
-- 启用WS前置数据
|
||||
o = s:option(Flag, "ws_ed_enable", translate("Enable early data"))
|
||||
o:depends("transport", "ws")
|
||||
|
||||
-- WS前置数据
|
||||
o = s:option(Value, "ws_ed", translate("Max Early Data"))
|
||||
o:depends("ws_ed_enable", true)
|
||||
o.datatype = "uinteger"
|
||||
o.default = 2048
|
||||
o.value("2048")
|
||||
o.rmempty = true
|
||||
|
||||
-- WS前置数据标头
|
||||
o = s:option(Value, "ws_ed_header", translate("Early Data Header Name"))
|
||||
o:depends("ws_ed_enable", true)
|
||||
o.default = "Sec-WebSocket-Protocol"
|
||||
o.value("Sec-WebSocket-Protocol")
|
||||
o.rmempty = true
|
||||
end
|
||||
|
||||
@ -513,19 +494,16 @@ o = s:option(Value, "serviceName", translate("gRPC Service Name"))
|
||||
o:depends("transport", "grpc")
|
||||
o.rmempty = true
|
||||
|
||||
if is_finded("xray") or is_installed("sagernet-core") then
|
||||
if is_finded("xray") then
|
||||
-- gPRC模式
|
||||
o = s:option(ListValue, "grpc_mode", translate("gRPC Mode"))
|
||||
o:depends("transport", "grpc")
|
||||
o:value("gun", translate("Gun"))
|
||||
o:value("multi", translate("Multi"))
|
||||
if is_installed("sagernet-core") then
|
||||
o:value("raw", translate("Raw"))
|
||||
end
|
||||
o.rmempty = true
|
||||
end
|
||||
|
||||
if is_finded("xray") or is_installed("sagernet-core") then
|
||||
if is_finded("xray") then
|
||||
-- gRPC初始窗口
|
||||
o = s:option(Value, "initial_windows_size", translate("Initial Windows Size"))
|
||||
o.datatype = "uinteger"
|
||||
@ -824,17 +802,6 @@ o:depends("type", "ss")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
if is_installed("sagernet-core") then
|
||||
o = s:option(ListValue, "packet_encoding", translate("Packet Encoding"))
|
||||
o:value("none", translate("none"))
|
||||
o:value("packet", translate("packet (v2ray-core v5+)"))
|
||||
o:value("xudp", translate("xudp (Xray-core)"))
|
||||
o.default = "xudp"
|
||||
o.rmempty = true
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vless"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vmess"})
|
||||
end
|
||||
|
||||
o = s:option(Flag, "switch_enable", translate("Enable Auto Switch"))
|
||||
o.rmempty = false
|
||||
o.default = "1"
|
||||
|
@ -742,9 +742,6 @@ msgstr "WebSocket 主机名"
|
||||
msgid "WebSocket Path"
|
||||
msgstr "WebSocket 路径"
|
||||
|
||||
msgid "Enable early data"
|
||||
msgstr "启用前置数据"
|
||||
|
||||
msgid "Max Early Data"
|
||||
msgstr "最大前置数据"
|
||||
|
||||
@ -829,9 +826,6 @@ msgstr "节点公钥"
|
||||
msgid "Pre-shared key"
|
||||
msgstr "预共享密钥"
|
||||
|
||||
msgid "Packet Encoding"
|
||||
msgstr "数据包编码"
|
||||
|
||||
msgid "Network interface to use"
|
||||
msgstr "使用的网络接口"
|
||||
|
||||
@ -856,8 +850,5 @@ msgstr "重新应用"
|
||||
msgid "Apply"
|
||||
msgstr "应用"
|
||||
|
||||
msgid "Default Packet Encoding"
|
||||
msgstr "默认数据包编码"
|
||||
|
||||
msgid "Enable Netflix Mode"
|
||||
msgstr "启用 Netflix 分流模式"
|
||||
|
@ -981,7 +981,6 @@ reset() {
|
||||
set shadowsocksr.@global[0].switch_time='667'
|
||||
set shadowsocksr.@global[0].switch_timeout='5'
|
||||
set shadowsocksr.@global[0].switch_try_count='3'
|
||||
set shadowsocksr.@global[0].default_packet_encoding='xudp'
|
||||
set shadowsocksr.@global[0].gfwlist_url='https://fastly.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt'
|
||||
set shadowsocksr.@global[0].chnroute_url='https://ispip.clang.cn/all_cn.txt'
|
||||
set shadowsocksr.@global[0].nfip_url='https://fastly.jsdelivr.net/gh/QiuSimons/Netflix_IP/NF_only.txt'
|
||||
|
@ -26,35 +26,22 @@ function vmess_vless()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
packetEncoding = server.packet_encoding or nil
|
||||
}
|
||||
}
|
||||
end
|
||||
function trojan_shadowsocks()
|
||||
outbound_settings = {
|
||||
plugin = ((server.v2ray_protocol == "shadowsocks") and server.plugin ~= "none" and server.plugin) or (server.v2ray_protocol == "shadowsocksr" and "shadowsocksr") or nil,
|
||||
pluginOpts = (server.v2ray_protocol == "shadowsocks") and server.plugin_opts or nil,
|
||||
pluginArgs = (server.v2ray_protocol == "shadowsocksr") and {
|
||||
"--protocol=" .. server.protocol,
|
||||
"--protocol-param=" .. (server.protocol_param or ""),
|
||||
"--obfs=" .. server.obfs,
|
||||
"--obfs-param=" .. (server.obfs_param or "")
|
||||
} or nil,
|
||||
servers = {
|
||||
{
|
||||
address = server.server,
|
||||
port = tonumber(server.server_port),
|
||||
password = server.password,
|
||||
method = ((server.v2ray_protocol == "shadowsocks") and server.encrypt_method_ss) or ((server.v2ray_protocol == "shadowsocksr") and server.encrypt_method) or nil,
|
||||
method = ((server.v2ray_protocol == "shadowsocks") and server.encrypt_method_ss) or nil,
|
||||
uot = (server.v2ray_protocol == "shadowsocks") and (server.uot == '1') or nil,
|
||||
ivCheck = (server.v2ray_protocol == "shadowsocks") and (server.ivCheck == '1') or nil,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if server.v2ray_protocol == "shadowsocksr" then
|
||||
server.v2ray_protocol = "shadowsocks"
|
||||
end
|
||||
end
|
||||
function socks_http()
|
||||
outbound_settings = {
|
||||
@ -108,9 +95,6 @@ function outbound:handleIndex(index)
|
||||
shadowsocks = function()
|
||||
trojan_shadowsocks()
|
||||
end,
|
||||
shadowsocksr = function()
|
||||
trojan_shadowsocks()
|
||||
end,
|
||||
socks = function()
|
||||
socks_http()
|
||||
end,
|
||||
@ -224,7 +208,6 @@ local Xray = {
|
||||
grpcSettings = (server.transport == "grpc") and {
|
||||
-- grpc
|
||||
serviceName = server.serviceName or "",
|
||||
mode = (server.grpc_mode ~= "gun") and server.grpc_mode or nil,
|
||||
multiMode = (server.grpc_mode == "multi") and true or false,
|
||||
idle_timeout = tonumber(server.idle_timeout) or nil,
|
||||
health_check_timeout = tonumber(server.health_check_timeout) or nil,
|
||||
@ -235,8 +218,7 @@ local Xray = {
|
||||
mux = (server.mux == "1" and server.transport ~= "grpc") and {
|
||||
-- mux
|
||||
enabled = true,
|
||||
concurrency = tonumber(server.concurrency),
|
||||
packetEncoding = (server.v2ray_protocol == "vmess" or server.v2ray_protocol == "vless") and server.packet_encoding or nil
|
||||
concurrency = tonumber(server.concurrency)
|
||||
} or nil
|
||||
} or nil
|
||||
}
|
||||
|
@ -27,9 +27,7 @@ local switch = ucic:get_first(name, 'server_subscribe', 'switch', '1')
|
||||
local subscribe_url = ucic:get_first(name, 'server_subscribe', 'subscribe_url', {})
|
||||
local filter_words = ucic:get_first(name, 'server_subscribe', 'filter_words', '过期时间/剩余流量')
|
||||
local save_words = ucic:get_first(name, 'server_subscribe', 'save_words', '')
|
||||
local packet_encoding = luci.model.ipkg.installed("sagernet-core") and ucic:get_first(name, 'global', 'default_packet_encoding', 'xudp') or nil
|
||||
local v2_ss = luci.sys.exec('type -t -p ss-redir sslocal') ~= "" and "ss" or "v2ray"
|
||||
local v2_ssr = luci.sys.exec('type -t -p ssr-redir') ~= "" and "ssr" or "v2ray"
|
||||
local v2_tj = luci.sys.exec('type -t -p trojan') ~= "" and "trojan" or "v2ray"
|
||||
local log = function(...)
|
||||
print(os.date("%Y-%m-%d %H:%M:%S ") .. table.concat({...}, " "))
|
||||
@ -149,8 +147,7 @@ local function processData(szType, content)
|
||||
if szType == 'ssr' then
|
||||
local dat = split(content, "/%?")
|
||||
local hostInfo = split(dat[1], ':')
|
||||
result.type = v2_ssr
|
||||
result.v2ray_protocol = (v2_ssr == "v2ray") and "shadowsocksr" or nil
|
||||
result.type = 'ssr'
|
||||
result.server = hostInfo[1]
|
||||
result.server_port = hostInfo[2]
|
||||
result.protocol = hostInfo[3]
|
||||
@ -178,7 +175,6 @@ local function processData(szType, content)
|
||||
result.transport = info.net
|
||||
result.vmess_id = info.id
|
||||
result.alias = info.ps
|
||||
result.packet_encoding = packet_encoding
|
||||
-- result.mux = 1
|
||||
-- result.concurrency = 8
|
||||
if info.net == 'ws' then
|
||||
@ -361,7 +357,6 @@ local function processData(szType, content)
|
||||
result.vmess_id = url.user
|
||||
result.vless_encryption = params.encryption or "none"
|
||||
result.transport = params.type or "tcp"
|
||||
result.packet_encoding = packet_encoding
|
||||
result.tls = (params.security == "tls" or params.security == "xtls") and "1" or "0"
|
||||
result.tls_host = params.sni
|
||||
result.tls_flow = (params.security == "tls") and params.flow or nil
|
||||
|
Loading…
Reference in New Issue
Block a user