Skip to content
/ antispam Public

basic antispam framework, can be easily extended for other rules, see config.lua and antispam.lua.

Notifications You must be signed in to change notification settings

mxlxm/antispam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 26, 2020
a7292a6 · Oct 26, 2020

History

1 Commit
Oct 26, 2020
Oct 26, 2020
Oct 26, 2020
Oct 26, 2020
Oct 26, 2020
Oct 26, 2020
Oct 26, 2020
Oct 26, 2020
Oct 26, 2020
Oct 26, 2020

Repository files navigation

antispam

ngx.shared.dict based access control. use redis to share data with each others.

usage


http {
    lua_shared_dict prison 500m;
    lua_shared_dict rules 10m;

    lua_package_path '/path/to/antispam/?.lua;;';
    init_by_lua_file /path/to/antispam/init.lua;    

    ...

    server {
        access_by_lua_file /path/to/antispam/antispam.lua;

        ...

        location ~* /antimanage/(ban|delete|purge) {
            allow 10.0.0.0/8;
            deny all;
            content_by_lua_file /path/to/antispam/$1.lua;
        }
    }
}

config


see config.lua

rules


  • add rule in config.lua
  • add rule func in antispam.lua

manual control


  • ban
curl http://0:80/antimanage/ban?key=xxxx&ttl=500

key required, ip/token/ip+uri ...
ttl optional, seconds to ban

  • delelte
curl http://0:80/antimanage/delete?key=xxxx

key required,ip/token/ip+uri ...

  • purge
curl http://0:80/antimanage/purge

About

basic antispam framework, can be easily extended for other rules, see config.lua and antispam.lua.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages