load inline multisite values for white/black/grey list core
This commit is contained in:
parent
c2e0e51067
commit
5f9f1e54f8
4
TODO
4
TODO
|
@ -1,5 +1,5 @@
|
|||
- load inline values for white/black/grey list core
|
||||
- bwcli with redis
|
||||
- direct access to ANTIBOT_URI without prepare_challenge call
|
||||
- don't fail if session err is not nil (new session will be created)
|
||||
- limit refactoring with redis scripts if needed
|
||||
- stream refactoring
|
||||
- stream examples
|
||||
|
|
|
@ -25,6 +25,23 @@ function blacklist:initialize()
|
|||
else
|
||||
self.lists = cjson.decode(lists)
|
||||
end
|
||||
local kinds = {
|
||||
["IP"] = {},
|
||||
["RDNS"] = {},
|
||||
["ASN"] = {},
|
||||
["USER_AGENT"] = {},
|
||||
["URI"] = {},
|
||||
["IGNORE_IP"] = {},
|
||||
["IGNORE_RDNS"] = {},
|
||||
["IGNORE_ASN"] = {},
|
||||
["IGNORE_USER_AGENT"] = {},
|
||||
["IGNORE_URI"] = {},
|
||||
}
|
||||
for kind, _ in pairs(kinds) do
|
||||
for data in self.variables["BLACKLIST_" .. kind]:gmatch("%S+") do
|
||||
table.insert(self.lists[kind], data)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Instantiate cachestore
|
||||
self.cachestore = cachestore:new(self.use_redis)
|
||||
|
|
|
@ -24,6 +24,18 @@ function greylist:initialize()
|
|||
else
|
||||
self.lists = cjson.decode(lists)
|
||||
end
|
||||
local kinds = {
|
||||
["IP"] = {},
|
||||
["RDNS"] = {},
|
||||
["ASN"] = {},
|
||||
["USER_AGENT"] = {},
|
||||
["URI"] = {}
|
||||
}
|
||||
for kind, _ in pairs(kinds) do
|
||||
for data in self.variables["GREYLIST_" .. kind]:gmatch("%S+") do
|
||||
table.insert(self.lists[kind], data)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Instantiate cachestore
|
||||
self.cachestore = cachestore:new(self.use_redis)
|
||||
|
|
|
@ -26,6 +26,19 @@ function whitelist:initialize()
|
|||
else
|
||||
self.lists = cjson.decode(lists)
|
||||
end
|
||||
local kinds = {
|
||||
["IP"] = {},
|
||||
["RDNS"] = {},
|
||||
["ASN"] = {},
|
||||
["USER_AGENT"] = {},
|
||||
["URI"] = {}
|
||||
}
|
||||
for kind, _ in pairs(kinds) do
|
||||
for data in self.variables["WHITELIST_" .. kind]:gmatch("%S+") do
|
||||
self.logger:log(ngx.ERR, data)
|
||||
table.insert(self.lists[kind], data)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Instantiate cachestore
|
||||
self.cachestore = cachestore:new(self.use_redis and ngx.get_phase() == "access")
|
||||
|
|
Loading…
Reference in New Issue