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