Skip to content

Latest commit

 

History

History
31 lines (17 loc) · 829 Bytes

README.textile

File metadata and controls

31 lines (17 loc) · 829 Bytes

IP Whitelist Middleware

About

Rack Middleware for websites that need to contain access to a group of ip addresses (a whitelist).
Outside these addresses, vistors are shown 403 Forbidden page.
The whitelist is maintained via environment-specific lists in a YAML configuration file.

Usage

Rails 3

in Gemfile

gem 'ip_whitelist', :git => 'git://github.com/nexiahome/ip_whitelist.git'

That’s it! (Railtie will auto-load this middleware code right after Rails::Logger)

Use 'rake middleware' to see the load order

YAML File

Be sure to set up your YAML file to list the whitelisted IPs. It must be at:

config/whitelist.yml

Otherwise it will not be loaded.

Kudos

This middleware gem started from https://github.com/jake3030/rack-ip-whitelist but changed enough to warrant it’s own new name.