...
|
...
|
@@ -125,21 +125,22 @@ local query_limit_ip_access_conf=function() |
|
|
if property then
|
|
|
local source=property["source"]
|
|
|
if source then
|
|
|
local limit_ip_access={}
|
|
|
|
|
|
local limit_ip_access={ degrades = {} }
|
|
|
|
|
|
limit_ip_access["is_open"]=source["is_open"]
|
|
|
|
|
|
local white_ips={}
|
|
|
local degrade_methods = {}
|
|
|
for k,v in pairs(source) do
|
|
|
if string.find(k,"^white_ips%[*") then
|
|
|
table.insert(white_ips,v)
|
|
|
elseif string.find(k,"^degrade_methods%[*") then
|
|
|
table.insert(degrade_methods,v)
|
|
|
d_method = split_str_list("v", ",", 2)
|
|
|
local e_code = d_method[2]
|
|
|
if e_code == nil then e_code = 9999991 end
|
|
|
limit_ip_access.degrades[d_method[1]] = e_code
|
|
|
end
|
|
|
end
|
|
|
limit_ip_access["white_ips"]=white_ips
|
|
|
limit_ip_access["degrade_methods"]=degrade_methods
|
|
|
lua_context.lua_conf_cache:set("limit_ip_access",cjson.encode(limit_ip_access))
|
|
|
end
|
|
|
end
|
...
|
...
|
|