UI - copy from helpers, systemd service and instances page update
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
local M = {}
|
||||
local M = {}
|
||||
local api_list = {}
|
||||
local iputils = require "resty.iputils"
|
||||
|
||||
@@ -10,6 +10,10 @@ api_list["^/reload$"] = function ()
|
||||
return os.execute("/usr/sbin/nginx -s reload") == 0
|
||||
end
|
||||
|
||||
api_list["^/stop$"] = function ()
|
||||
return os.execute("/usr/sbin/nginx -s quit") == 0
|
||||
end
|
||||
|
||||
function M.is_api_call (api_uri, api_whitelist_ip)
|
||||
local whitelist = iputils.parse_cidrs(api_whitelist_ip)
|
||||
if iputils.ip_in_cidrs(ngx.var.remote_addr, whitelist) and ngx.var.request_uri:sub(1, #api_uri) .. "/" == api_uri .. "/" then
|
||||
|
||||
Reference in New Issue
Block a user