README.md in spanx-0.1.1 vs README.md in spanx-0.3.0

- old
+ new

@@ -1,8 +1,9 @@ Spanx ===== +[![Gem Version](https://badge.fury.io/rb/spanx.png)](http://badge.fury.io/rb/spanx) [![Build status](https://secure.travis-ci.org/wanelo/spanx.png)](http://travis-ci.org/wanelo/spanx) Spank down IP spam: IP-based rate limiting for web applications behind HTTP server such as nginx or Apache. Spanx integrates into any web application simply by monitoring one or more HTTP server access log file(s) @@ -41,13 +42,11 @@ If you have multiple web servers, you need to run watcher on each server, and analyzer only once (somewhere). ### Alerts Besides actually writing out IPs to a block list file, Spanx supports notifiers that will be called when a new IP -is blocked. Currently supported are audit log notifier (that writes that information to a log file), a Campfire -Chat notifier, which will print IP blocking information into your Campfire chat room, and an Email notifier. It is -very easy to write additional notifiers. +is blocked. Currently supported are audit log notifier (that writes that information to a log file), both a Campfire and Slack chat notifier (which will print IP blocking information into each respective chat room), and an Email notifier. It is very easy to write additional notifiers. ## Installation Add this line to your application's Gemfile: @@ -142,9 +141,44 @@ ```bash Usage: [bundle exec] spanx flush [options] -c, --config CONFIG Path to config file (YML) (required) -g, --debug Log status to STDOUT -h, --help Show this message +``` + +### api + +This starts an HTTP server with endpoints for managing blocked ips. Your +application (or admin interface) can connect to this, for example. + +```bash +Usage: [bundle exec] spanx api [options] + -c, --config CONFIG Path to config file (YML) (required) + -g, --debug Log status to STDOUT + -h, --help Show this message + -h, --host Host for the HTTP server to listen on + -p, --port Port for the HTTP server to listen on +``` + +#### Endpoints: + +To retrieve a list of currently blocked ips: + +``` +GET /ips/blocked +[ + "127.0.0.1", + "11.100.193.12" +] +``` + +To unblock a specific ip: + +This will remove the IP from redis and shortly afterwards it will be removed +from the nginx block files. + +``` +DELETE /ips/blocked/11.100.193.12 ``` ## Examples If you have only one load balancer, you may want to centralize all work into a single process, as such: