mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-01 04:43:56 +08:00
update 2026-07-16 04:54:23
This commit is contained in:
1 parent
6bc60cfbf2
commit
151daa8c75
42 files changed
+645
-689
No files matched your search
@@ -113,6 +113,8 @@ function index()
|
||||
|
||||
--[[geoview]]
|
||||
entry({"admin", "services", appname, "geo_view"}, call("geo_view")).leaf = true
|
||||
|
||||
entry({"admin", "services", appname, "fetch_certsha256"}, call("fetch_certsha256")).leaf = true
|
||||
end
|
||||
|
||||
local function http_write_json(content)
|
||||
@@ -939,3 +941,17 @@ function flush_set()
|
||||
http.redirect(api.url("log"))
|
||||
end
|
||||
end
|
||||
|
||||
function fetch_certsha256()
|
||||
local id = http.formvalue("id") or ""
|
||||
local address = (id ~= "") and uci:get(appname, id, "address") or ""
|
||||
local port = (id ~= "") and uci:get(appname, id, "port") or 0
|
||||
local sni = (id ~= "") and uci:get(appname, id, "tls_serverName") or ""
|
||||
sni = (sni ~= "") and sni or address
|
||||
if address == "" or port == 0 then
|
||||
http_write_json_error()
|
||||
return
|
||||
end
|
||||
local data = api.fetch_cert_sha256(address, port, sni, 5)
|
||||
http_write_json(data ~= "" and { code = 1, data = data } or { code = 0 })
|
||||
end
|
||||
Reference in new issue
Block a user