mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-29 14:45:13 +08:00
update 2026-08-09 04:21:56
This commit is contained in:
1 parent
62707c2029
commit
2ead6d3cf2
1994 files changed
+1524120
-950
No files matched your search
@@ -51,14 +51,14 @@ function index()
|
||||
entry({"admin", "services", appname, "socks_config"}, cbi(appname .. "/client/socks_config")).leaf = true
|
||||
entry({"admin", "services", appname, "acl"}, cbi(appname .. "/client/acl"), _("Access control"), 98).leaf = true
|
||||
entry({"admin", "services", appname, "acl_config"}, cbi(appname .. "/client/acl_config")).leaf = true
|
||||
entry({"admin", "services", appname, "log"}, form(appname .. "/client/log"), _("Runtime Logs"), 999).leaf = true
|
||||
entry({"admin", "services", appname, "log"}, template(appname .. "/log/log"), _("Runtime Logs"), 999).leaf = true
|
||||
|
||||
--[[ Server ]]
|
||||
entry({"admin", "services", appname, "server"}, cbi(appname .. "/server/index"), _("Server-Side"), 99).leaf = true
|
||||
entry({"admin", "services", appname, "server_user"}, cbi(appname .. "/server/user")).leaf = true
|
||||
|
||||
--[[ API ]]
|
||||
entry({"admin", "services", appname, "server_user_update"}, call("server_user_update")).leaf = true
|
||||
entry({"admin", "services", appname, "server_update_config"}, call("server_update_config")).leaf = true
|
||||
entry({"admin", "services", appname, "server_user_status"}, call("server_user_status")).leaf = true
|
||||
entry({"admin", "services", appname, "server_user_log"}, call("server_user_log")).leaf = true
|
||||
entry({"admin", "services", appname, "server_get_log"}, call("server_get_log")).leaf = true
|
||||
@@ -308,7 +308,7 @@ end
|
||||
|
||||
function get_socks_log()
|
||||
local name = http.formvalue("name")
|
||||
local path = "/tmp/etc/passwall/SOCKS_" .. name .. ".log"
|
||||
local path = "/tmp/etc/passwall/" .. name .. ".log"
|
||||
if fs.access(path) then
|
||||
local content = luci.sys.exec("cat ".. path)
|
||||
content = content:gsub("\n", "<br />")
|
||||
@@ -389,7 +389,7 @@ function socks_status()
|
||||
local index = http.formvalue("index")
|
||||
local id = http.formvalue("id")
|
||||
e.index = index
|
||||
e.socks_status = luci.sys.call(string.format("/bin/busybox top -bn1 | grep -v 'grep' | grep '/tmp/etc/passwall/bin/' | grep -v '_acl_' | grep '%s' | grep 'SOCKS_' > /dev/null", id)) == 0
|
||||
e.socks_status = luci.sys.call(string.format("/bin/busybox top -bn1 | grep -v -E 'grep|acl/|acl_' | grep '%s/bin/' | grep '%s' > /dev/null", appname, id)) == 0
|
||||
local use_http = uci:get(appname, id, "http_port") or 0
|
||||
e.use_http = 0
|
||||
if tonumber(use_http) > 0 then
|
||||
@@ -554,7 +554,7 @@ end
|
||||
function clear_all_nodes()
|
||||
uci:set(appname, '@global[0]', "enabled", "0")
|
||||
uci:set(appname, '@global[0]', "socks_enabled", "0")
|
||||
uci:set(appname, '@haproxy_config[0]', "balancing_enable", "0")
|
||||
uci:set(appname, '@global_haproxy[0]', "balancing_enable", "0")
|
||||
uci:delete(appname, '@global[0]', "tcp_node")
|
||||
uci:delete(appname, '@global[0]', "udp_node")
|
||||
uci:foreach(appname, "socks", function(t)
|
||||
@@ -784,7 +784,7 @@ function rollback_rules()
|
||||
http_write_json_ok()
|
||||
end
|
||||
|
||||
function server_user_update()
|
||||
function server_update_config()
|
||||
local id = http.formvalue("id") -- Node id
|
||||
local data = http.formvalue("data") -- json new Data
|
||||
if id and data then
|
||||
|
||||
Reference in new issue
Block a user