Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Simple gem that extends Rails `request.remote_ip` to default to Cloudflare's `HTTP_CF_CONNECTING_IP` header.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Actionpack::Cloudflare

Build Status

Simple gem that extends Rails request.remote_ip to default to Cloudflare's HTTP_CF_CONNECTING_IP header. More about CloudFlare HTTP Headers and why we choose to trust CF-Connecting-IP.

Installation

Add this line to your Rails application's Gemfile:

gem 'actionpack-cloudflare'

Usage

None! Just install and feel confident that request.remote_ip is doing its job.

Alternatives

  • cloudflare-rails - Leverages cached HTTP requests to Cloudflare to extend Rails' trusted proxies list.

Contributing

We use the Appraisal gem from Thoughtbot to help us test different versions of Rails. The appraisal rake test subcommand runs our test suite against all Rails versions in the Appraisal file. So after cloning the repo, running the following commands.

$ bundle install
$ bundle exec appraisal update
$ bundle exec appraisal rake test

If you want to run the tests for a specific appraisal, use one of the names found in our Appraisal file. For example, the following will run our tests suite for Rails 4.2 only.

$ bundle exec appraisal rails42 rake test

License

The gem is available as open source under the terms of the MIT License.