mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-15 04:53:00 +08:00
💐 Sync 2026-08-15 21:58:49
This commit is contained in:
1 parent
5bd78ffd1e
commit
2821617ed2
74 files changed
+3288
-2289
No files matched your search
@@ -120,6 +120,7 @@ function index()
|
||||
entry({"admin", "services", appname, "geo_view"}, call("geo_view")).leaf = true
|
||||
|
||||
entry({"admin", "services", appname, "fetch_certsha256"}, call("fetch_certsha256")).leaf = true
|
||||
entry({"admin", "services", appname, "gen_wireguard_key"}, call("gen_wireguard_key")).leaf = true
|
||||
end
|
||||
|
||||
local function http_write_json(content)
|
||||
@@ -304,7 +305,7 @@ end
|
||||
function get_redir_log()
|
||||
local id = http.formvalue("id")
|
||||
local name = http.formvalue("name")
|
||||
local file_path = "/tmp/etc/passwall2/acl/" .. id .. "/" .. name .. ".log"
|
||||
local file_path = api.TMP_PATH .. "/acl/" .. id .. "/" .. name .. ".log"
|
||||
if nixio.fs.access(file_path) then
|
||||
local content = luci.sys.exec("tail -n 19999 '" .. file_path .. "'")
|
||||
content = content:gsub("\n", "<br />")
|
||||
@@ -316,7 +317,7 @@ end
|
||||
|
||||
function get_socks_log()
|
||||
local name = http.formvalue("name")
|
||||
local path = "/tmp/etc/passwall2/" .. name .. ".log"
|
||||
local path = api.TMP_PATH .. "/" .. name .. ".log"
|
||||
if nixio.fs.access(path) then
|
||||
local content = luci.sys.exec("tail -n 5000 ".. path)
|
||||
content = content:gsub("\n", "<br />")
|
||||
@@ -349,7 +350,7 @@ end
|
||||
|
||||
function index_status()
|
||||
local e = {}
|
||||
e["global_status"] = luci.sys.call("/bin/busybox top -bn1 | grep -v 'grep' | grep '/tmp/etc/passwall2/bin/' | grep 'default' | grep 'global' >/dev/null") == 0
|
||||
e["global_status"] = luci.sys.call("/bin/busybox top -bn1 | grep -v 'grep' | grep '%s/bin/' | grep 'default' | grep 'global' >/dev/null" % api.TMP_PATH) == 0
|
||||
http_write_json(e)
|
||||
end
|
||||
|
||||
@@ -720,8 +721,9 @@ end
|
||||
|
||||
function server_log()
|
||||
local id = http.formvalue("id")
|
||||
if nixio.fs.access("/tmp/etc/passwall2_server/" .. id .. ".log") then
|
||||
local content = luci.sys.exec("cat /tmp/etc/passwall2_server/" .. id .. ".log")
|
||||
local f_file = api.S_TMP_PATH .. "/" .. id .. ".log"
|
||||
if nixio.fs.access(f_file) then
|
||||
local content = luci.sys.exec("cat " .. f_file)
|
||||
content = content:gsub("\n", "<br />")
|
||||
http.write(content)
|
||||
else
|
||||
@@ -1085,3 +1087,12 @@ function delete_select_shunt_rules()
|
||||
uci_save(true, true)
|
||||
end
|
||||
end
|
||||
|
||||
function gen_wireguard_key()
|
||||
local key = api.gen_wireguard_key()
|
||||
if key then
|
||||
http_write_json_ok(key)
|
||||
else
|
||||
http_write_json_error()
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user