No description
tests | ||
.gitignore | ||
asn_blacklist | ||
auth.lua | ||
blacklist_asn | ||
config.example.lua | ||
init.lua | ||
LICENSE | ||
maxmind.lua | ||
README.md | ||
test.lua |
resty-whitelister
OpenResty scripts used at Computernewb to check if an IP is anonymous using various tests
Dependencies
- OpenResty or nginx-cn with the following modules:
- lua-resty-redis
- json.lua
- luafilesystem (ffi)
- luasocket
- For ASN testing: lua-resty-maxminddb
- Redis
Configuration
Copy config.example.lua
to config.lua
and fill out the necessary fields.
NGINX Configuration
http {
# (...)
# Needed for resty.http to work
resolver 1.1.1.1;
lua_ssl_trusted_certificate /etc/ssl/cert.pem;
# Change if whitelister is not at /opt/lua/whitelister
init_by_lua_file /opt/lua/whitelister/init.lua;
server {
# (...)
location /whitelister/ {
# Change if whitelister is not at /opt/lua/whitelister
content_by_lua_file /opt/lua/whitelister/auth.lua;
}
location /protected/ {
auth_request /whitelister/;
}
}
Credits
Written by Elijah R and Lily Tsuru