mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-04 15:53:56 +08:00
🛸 Sync 2026-10-20 02:16:58
This commit is contained in:
1 parent
64729a26c6
commit
590565b35a
25 files changed
+887
-408
No files matched your search
@@ -58,6 +58,26 @@ end
|
||||
|
||||
local IP_BIN = "/sbin/ip"
|
||||
|
||||
-- The VPS to trace to: the master server of the openmptcprouter config,
|
||||
-- else the server of the proxy in use. shadowsocks-libev's sss0 alone was
|
||||
-- read before, a stale or placeholder address with shadowsocks-rust or any
|
||||
-- other proxy.
|
||||
local function trace_server()
|
||||
local server
|
||||
uci:foreach("openmptcprouter", "server", function(s)
|
||||
if server or s.disabled == "1" or s.master ~= "1" then return end
|
||||
local ip = s.ip
|
||||
if type(ip) == "table" then ip = ip[1] end
|
||||
if ip and ip ~= "" then server = ip end
|
||||
end)
|
||||
if server then return server end
|
||||
local proxy = uci:get("openmptcprouter", "settings", "proxy") or ""
|
||||
if proxy:match("^shadowsocks%-rust") then
|
||||
return uci:get("shadowsocks-rust", "sss0", "server") or ""
|
||||
end
|
||||
return uci:get("shadowsocks-libev", "sss0", "server") or ""
|
||||
end
|
||||
|
||||
local function trim(s)
|
||||
return (tostring(s or ""):gsub("^%s+", ""):gsub("%s+$", ""))
|
||||
end
|
||||
@@ -159,7 +179,7 @@ function parse_counters(raw)
|
||||
end
|
||||
|
||||
-- Where to read the MPTcpExt* counters from for Diagnostics. Deliberately
|
||||
-- NOT "multipath -m" here: that wraps "nstat -z", and nstat (without -a)
|
||||
-- NOT "multipath -m" here: that wrapped "nstat -z", and nstat (without -a)
|
||||
-- reports the delta since the *previous* nstat invocation by anyone on the
|
||||
-- box (it keeps a shared per-uid history file) -- confirmed live: two
|
||||
-- consecutive calls a couple seconds apart came back ~0, while "nstat -a -z"
|
||||
@@ -896,6 +916,18 @@ local methods = {
|
||||
end
|
||||
},
|
||||
|
||||
-- Whether mqvpn is enabled and which scheduler it runs, for the DSCP /
|
||||
-- Weight Routing page: these two values only, the page's ACL does not
|
||||
-- grant the mqvpn config itself (it holds the PSK).
|
||||
mqvpn_state = {
|
||||
call = function()
|
||||
return {
|
||||
enabled = uci:get("mqvpn", "settings", "enable") == "1",
|
||||
scheduler = uci:get("mqvpn", "multipath", "scheduler") or ""
|
||||
}
|
||||
end
|
||||
},
|
||||
|
||||
-- Runs "multipath -f" and returns its output.
|
||||
mptcp_fullmesh = {
|
||||
call = function()
|
||||
@@ -923,7 +955,7 @@ local methods = {
|
||||
call = function(args)
|
||||
local iface = args.iface or ""
|
||||
local interface = get_device(iface)
|
||||
local server = uci:get("shadowsocks-libev", "sss0", "server") or ""
|
||||
local server = trace_server()
|
||||
-- Placeholders the shadowsocks config ships until a VPS is set
|
||||
-- (127.0.0.1 now, 192.168.1.3 in older releases): tracing to them
|
||||
-- would report a path that has nothing to do with the proxy.
|
||||
|
||||
@@ -86,5 +86,16 @@
|
||||
"depends": {
|
||||
"acl": [ "luci-app-mptcp" ]
|
||||
}
|
||||
},
|
||||
"admin/network/mptcp/mptcp_check": {
|
||||
"title": "MPTCP Support Check",
|
||||
"order": 70,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "mptcp/mptcp_check"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-mptcp" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
"mptcp_check_trace",
|
||||
"get_settings",
|
||||
"get_interface_settings",
|
||||
"mqvpn_state",
|
||||
"diagnose"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user