update 2022-05-20 16:52:18
This commit is contained in:
parent
2c6ca04c3f
commit
ac393c94b3
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=aliyundrive-fuse
|
||||
PKG_VERSION:=0.1.11
|
||||
PKG_VERSION:=0.1.12
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-aliyundrive-fuse
|
||||
PKG_VERSION:=0.1.11
|
||||
PKG_VERSION:=0.1.12
|
||||
PKG_RELEASE:=1
|
||||
PKG_PO_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||
|
||||
|
|
|
@ -16,13 +16,12 @@ function read_conf(file)
|
|||
local ltable = {}
|
||||
for line in rfile:lines() do
|
||||
local re = string.gsub(line, "\r", "")
|
||||
table.insert(ltable,re)
|
||||
table.insert(ltable, re)
|
||||
end
|
||||
local rtable = next(ltable) ~= nil and ltable or nil
|
||||
return rtable
|
||||
end
|
||||
|
||||
|
||||
local v2ray_flow = ucursor:get_first(name, 'global', 'v2ray_flow', '0')
|
||||
|
||||
local custom_domain = read_conf("/etc/vssr/custom_domain.list")
|
||||
|
@ -120,28 +119,6 @@ local flow_table = {
|
|||
}
|
||||
}
|
||||
|
||||
local bt_rules = {
|
||||
type = 'field',
|
||||
outboundTag = 'bt',
|
||||
protocol = {
|
||||
'bittorrent'
|
||||
}
|
||||
}
|
||||
local bt_rules1 = {
|
||||
type = 'field',
|
||||
outboundTag = 'bt',
|
||||
domain = {
|
||||
'torrent',
|
||||
'peer_id=',
|
||||
'info_hash',
|
||||
'get_peers',
|
||||
'find_node',
|
||||
'BitTorrent',
|
||||
'announce_peer',
|
||||
'announce.php?passkey='
|
||||
}
|
||||
}
|
||||
|
||||
function gen_outbound(server_node, tags, local_ports)
|
||||
local bound = {}
|
||||
if server_node == nil or server_node == 'nil' then
|
||||
|
@ -156,7 +133,7 @@ function gen_outbound(server_node, tags, local_ports)
|
|||
protocol = 'socks',
|
||||
settings = {
|
||||
servers = {
|
||||
{address = '127.0.0.1', port = tonumber(local_ports)}
|
||||
{ address = '127.0.0.1', port = tonumber(local_ports) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -173,7 +150,7 @@ function gen_outbound(server_node, tags, local_ports)
|
|||
{
|
||||
id = server.vmess_id,
|
||||
alterId = server.type == "v2ray" and tonumber(server.alter_id) or nil,
|
||||
security = server.type == "v2ray" and server.security or nil,
|
||||
security = server.type == "v2ray" and server.security or nil,
|
||||
flow = (server.xtls == '1') and (server.vless_flow and server.vless_flow or "xtls-rprx-origin") or nil,
|
||||
encryption = server.type == "vless" and server.vless_encryption or nil
|
||||
}
|
||||
|
@ -185,8 +162,8 @@ function gen_outbound(server_node, tags, local_ports)
|
|||
streamSettings = {
|
||||
network = server.transport,
|
||||
security = (server.tls == '1') and ((server.xtls == '1') and "xtls" or "tls") or "none",
|
||||
tlsSettings = (server.tls == '1' and server.xtls ~= '1') and {allowInsecure = (server.insecure ~= "0") and true or false,serverName=server.tls_host,} or nil,
|
||||
xtlsSettings = (server.xtls == '1') and {allowInsecure = (server.insecure ~= "0") and true or false,serverName=server.tls_host,} or nil,
|
||||
tlsSettings = (server.tls == '1' and server.xtls ~= '1') and { allowInsecure = (server.insecure ~= "0") and true or false, serverName = server.tls_host, } or nil,
|
||||
xtlsSettings = (server.xtls == '1') and { allowInsecure = (server.insecure ~= "0") and true or false, serverName = server.tls_host, } or nil,
|
||||
kcpSettings = (server.transport == 'kcp') and
|
||||
{
|
||||
mtu = tonumber(server.mtu),
|
||||
|
@ -196,21 +173,21 @@ function gen_outbound(server_node, tags, local_ports)
|
|||
congestion = (server.congestion == '1') and true or false,
|
||||
readBufferSize = tonumber(server.read_buffer_size),
|
||||
writeBufferSize = tonumber(server.write_buffer_size),
|
||||
header = {type = server.kcp_guise}
|
||||
header = { type = server.kcp_guise }
|
||||
} or
|
||||
nil,
|
||||
wsSettings = (server.transport == 'ws') and (server.ws_path ~= nil or server.ws_host ~= nil) and
|
||||
{
|
||||
path = server.ws_path,
|
||||
headers = (server.ws_host ~= nil) and {Host = server.ws_host} or nil
|
||||
headers = (server.ws_host ~= nil) and { Host = server.ws_host } or nil
|
||||
} or
|
||||
nil,
|
||||
httpSettings = (server.transport == 'h2') and {path = server.h2_path, host = server.h2_host} or nil,
|
||||
httpSettings = (server.transport == 'h2') and { path = server.h2_path, host = server.h2_host } or nil,
|
||||
quicSettings = (server.transport == 'quic') and
|
||||
{
|
||||
security = server.quic_security,
|
||||
key = server.quic_key,
|
||||
header = {type = server.quic_guise}
|
||||
header = { type = server.quic_guise }
|
||||
} or
|
||||
nil
|
||||
},
|
||||
|
@ -224,41 +201,30 @@ function gen_outbound(server_node, tags, local_ports)
|
|||
return bound
|
||||
end
|
||||
|
||||
function gen_bt_outbounds()
|
||||
local bound = {
|
||||
tag = 'bt',
|
||||
protocol = 'freedom',
|
||||
settings = {
|
||||
a = 1
|
||||
}
|
||||
}
|
||||
return bound
|
||||
end
|
||||
|
||||
if v2ray_flow == '1' then
|
||||
|
||||
table.insert(outbounds_table, gen_outbound(server_section, 'global', 2080))
|
||||
for _, v in pairs(flow_table) do
|
||||
if(v.rules.domain ~= nil or v.rules.ip ~= nil) then
|
||||
if (v.rules.domain ~= nil or v.rules.ip ~= nil) then
|
||||
local server = ucursor:get_first(name, 'global', v.name .. '_server')
|
||||
table.insert(outbounds_table, gen_outbound(server, v.name, v.port))
|
||||
|
||||
if(v.rules.domain ~= nil) then
|
||||
if (v.rules.domain ~= nil) then
|
||||
domain_rules = {
|
||||
type = 'field',
|
||||
domain = v.rules.domain,
|
||||
outboundTag = v.rules.outboundTag
|
||||
}
|
||||
table.insert(rules_table, (server ~= nil and server ~= 'nil' ) and domain_rules or nil)
|
||||
table.insert(rules_table, (server ~= nil and server ~= 'nil') and domain_rules or nil)
|
||||
end
|
||||
|
||||
if(v.rules.ip ~= nil) then
|
||||
if (v.rules.ip ~= nil) then
|
||||
ip_rules = {
|
||||
type = 'field',
|
||||
ip = v.rules.ip,
|
||||
outboundTag = v.rules.outboundTag
|
||||
}
|
||||
table.insert(rules_table, (server ~= nil and server ~= 'nil' ) and ip_rules or nil)
|
||||
table.insert(rules_table, (server ~= nil and server ~= 'nil') and ip_rules or nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -266,10 +232,6 @@ else
|
|||
table.insert(outbounds_table, gen_outbound(server_section, 'main', local_port))
|
||||
end
|
||||
|
||||
table.insert(outbounds_table, gen_bt_outbounds())
|
||||
table.insert(rules_table, bt_rules)
|
||||
table.insert(rules_table, bt_rules1)
|
||||
|
||||
local v2ray = {
|
||||
log = {
|
||||
-- error = "/var/vssrsss.log",
|
||||
|
@ -281,15 +243,15 @@ local v2ray = {
|
|||
{
|
||||
port = tonumber(local_port),
|
||||
protocol = 'dokodemo-door',
|
||||
settings = {network = proto, followRedirect = true},
|
||||
sniffing = {enabled = true, destOverride = {'http', 'tls'}},
|
||||
settings = { network = proto, followRedirect = true },
|
||||
sniffing = { enabled = true, destOverride = { 'http', 'tls' } },
|
||||
streamSettings = {
|
||||
sockopt = {tproxy = (proto == 'tcp') and 'redirect' or 'tproxy'}
|
||||
sockopt = { tproxy = (proto == 'tcp') and 'redirect' or 'tproxy' }
|
||||
}
|
||||
}
|
||||
},
|
||||
-- 传出连接
|
||||
outbounds = outbounds_table,
|
||||
routing = {domainStrategy = 'IPIfNonMatch', rules = rules_table}
|
||||
routing = { domainStrategy = 'IPIfNonMatch', rules = rules_table }
|
||||
}
|
||||
print(json.stringify(v2ray, 1))
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1544,6 +1544,10 @@ tr>th,
|
|||
gap: 2px;
|
||||
}
|
||||
|
||||
.control-group > * {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div>table>tbody>tr:nth-of-type(2n),
|
||||
div>.table>.tr:nth-of-type(2n) {
|
||||
background-color: #f9f9f9;
|
||||
|
@ -1958,7 +1962,10 @@ td>table>tbody>tr>td,
|
|||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.cbi-value-field,
|
||||
.cbi-value-field {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.cbi-value-description {
|
||||
line-height: 1.25;
|
||||
display: table-cell;
|
||||
|
@ -2760,6 +2767,11 @@ td>.ifacebadge,
|
|||
/* config changes */
|
||||
.uci-change-list {
|
||||
font-family: monospace;
|
||||
overflow: scroll;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.uci-change-list ins,
|
||||
|
|
|
@ -3,9 +3,25 @@
|
|||
|
||||
START=95
|
||||
|
||||
disable_gro() {
|
||||
which ethtool || return 0
|
||||
for eth in $(ifconfig | grep "^eth\|^dsa" | awk '{print $1}' | sort | uniq); do
|
||||
ethtool -K "$eth" gro off
|
||||
logger -t natfflow "disable gro for <$eth>"
|
||||
done
|
||||
}
|
||||
|
||||
start() {
|
||||
echo debug=3 >/dev/natflow_ctl
|
||||
echo disabled=0 >/dev/natflow_ctl
|
||||
disable_gro
|
||||
hwnat=$(uci get natflow.main.hwnat 2>/dev/null || echo 1)
|
||||
enabled=$(uci get natflow.main.enabled 2>/dev/null || echo 1)
|
||||
debug=$(uci get natflow.main.debug 2>/dev/null || echo 3)
|
||||
delay_pkts=$(uci get natflow.main.delay_pkts 2>/dev/null || echo 0)
|
||||
|
||||
echo debug=$debug >/dev/natflow_ctl
|
||||
echo disabled=$((!enabled)) >/dev/natflow_ctl
|
||||
echo hwnat=$hwnat >/dev/natflow_ctl
|
||||
echo delay_pkts=$delay_pkts >/dev/natflow_ctl
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
config natflow 'main'
|
||||
option hwnat '1'
|
||||
option enabled '1'
|
||||
option debug '3'
|
||||
option delay_pkts '0'
|
||||
|
||||
config globals 'globals'
|
||||
option redirect_ip '10.10.10.10'
|
||||
option redirect_ip '10.10.10.1'
|
||||
option no_flow_timeout '1800'
|
||||
|
||||
config auth
|
||||
|
|
Loading…
Reference in New Issue