From 623c1ea05dd831c1388fab3d4ad195ffa19b64b4 Mon Sep 17 00:00:00 2001 From: Aaron Suggs Date: Sat, 28 Jul 2012 19:35:59 -0400 Subject: [PATCH] Cleanup README --- README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index dd5704c..24e76e5 100644 --- a/README.md +++ b/README.md @@ -8,28 +8,29 @@ Thottle state is stored in a configurable cache (e.g. `Rails.cache`), presumably ## Installation -Add `rack-attack` to your Gemfile or run +Add "rack-attack" to your Gemfile or run + gem install rack-attack -Tell your app to use the `Rack::Attack` middleware. +Tell your app to use the Rack::Attack middleware. For Rails 3 apps: # In config/application.rb config.middleware.use Rack::Attack Or in your `config.ru`: + use Rack::Attack Optionally configure the cache store for throttling: - Rack::Attack.cache.store = my_cache_store # defaults to Rails.cache + Rack::Attack.cache.store = my_cache_store # defaults to Rails.cache Note that `Rack::Attack.cache` is only used for throttling, not blacklisting & whitelisting. ## How it works -The Rack::Attack middleware examines each request against *whitelists*, *blacklists*, and *throttles* that you define. -By default, there are no whitelists, blacklists, or throttles. +The Rack::Attack middleware examines each request against *whitelists*, *blacklists*, and *throttles* that you define. There are none by default. * If the request matches any whitelist, the request is allowed. Blacklists and throttles are not checked. * If the request matches any blacklist, the request is blocked. Throttles are not checked. @@ -83,9 +84,4 @@ less on short-term, one-off hacks to block a particular attack. Rack::Attack complements `iptables` and nginx's [limit_zone module](http://wiki.nginx.org/HttpLimitZoneModule). -## Processing order - * If any whitelist matches, the request is allowed - * If any blacklist matches, the request is blocked (unless a whitelist matched) - * If any throttle matches, the request is throttled (unless a whitelist or blacklist matched) - [![Travis CI](https://secure.travis-ci.org/ktheory/rack-attack.png)](http://travis-ci.org/ktheory/rack-attack)