Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
appraise 'rails-7.1' do
gem 'rails', '~> 7.1.0'
end

appraise 'rails-7.2' do
gem 'rails', '~> 7.2.0'
end
Expand All @@ -11,7 +7,7 @@ appraise 'rails-8.0' do
end

appraise 'rails-8.1' do
gem 'rails', '~> 8.1.0.beta1'
gem 'rails', '~> 8.1.0.rc1'
end

appraise 'rails-edge' do
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ This gem correctly configures Rails for [CloudFlare](https://www.cloudflare.com)

## Rails Compatibility

This gem requires `railties`, `activesupport`, and `actionpack` >= `7.1`. For older `rails` versions see the chart below:
This gem requires `railties`, `activesupport`, and `actionpack` >= `7.2`. For older `rails` versions see the chart below:

| `rails` version | `cloudflare-rails` version |
| --------------- | -------------------------- |
| 7.1 | 6.2.0 |
| 7.0 | 5.0.1 |
| 6.1 | 5.0.1 |
| 6.0 | 3.0.0 |
Expand All @@ -34,9 +35,10 @@ And then execute:

### If you're using Kamal

If you're using Kamal 2 for deployments, `kamal-proxy` [won't forward headers to your Rails app while using SSL]([url](https://kamal-deploy.org/docs/configuration/proxy/#forward-headers)), unless you explicitly tell it to. Without this, `cloudflare-rails` won't work in a Kamal-deployed Rails app using SSL.
If you're using Kamal 2 for deployments, `kamal-proxy` [won't forward headers to your Rails app while using SSL](<[url](https://kamal-deploy.org/docs/configuration/proxy/#forward-headers)>), unless you explicitly tell it to. Without this, `cloudflare-rails` won't work in a Kamal-deployed Rails app using SSL.

You need to add `forward_headers: true` to your `proxy` section, like this:

```yaml
proxy:
ssl: true
Expand Down Expand Up @@ -87,10 +89,10 @@ You can use the `#cloudflare?` method from this gem to block all non-Cloudflare

Note that the request may optionally pass through additional trusted proxies, so it will return `true` for any of these scenarios:

- `REMOTE_ADDR: CloudFlare`
- `REMOTE_ADDR: trusted_proxy`, `X_HTTP_FORWARDED_FOR: CloudFlare`
- `REMOTE_ADDR: trusted_proxy`, `X_HTTP_FORWARDED_FOR: CloudFlare,trusted_proxy2`
- `REMOTE_ADDR: trusted_proxy`, `X_HTTP_FORWARDED_FOR: untrusted,CloudFlare`
- `REMOTE_ADDR: CloudFlare`
- `REMOTE_ADDR: trusted_proxy`, `X_HTTP_FORWARDED_FOR: CloudFlare`
- `REMOTE_ADDR: trusted_proxy`, `X_HTTP_FORWARDED_FOR: CloudFlare,trusted_proxy2`
- `REMOTE_ADDR: trusted_proxy`, `X_HTTP_FORWARDED_FOR: untrusted,CloudFlare`

but it will return `false` if CloudFlare comes to the left of an untrusted IP in `X-Forwarded-For`.

Expand Down
6 changes: 3 additions & 3 deletions cloudflare-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop-rails', '~> 2.33.4'
spec.add_development_dependency 'rubocop-rspec', '~> 3.7.0'
spec.add_development_dependency 'webmock', '~> 3.25.0'
spec.add_dependency 'actionpack', '>= 7.1.0', '< 8.2.0'
spec.add_dependency 'activesupport', '>= 7.1.0', '< 8.2.0'
spec.add_dependency 'railties', '>= 7.1.0', '< 8.2.0'
spec.add_dependency 'actionpack', '>= 7.2.0', '< 8.2.0'
spec.add_dependency 'activesupport', '>= 7.2.0', '< 8.2.0'
spec.add_dependency 'railties', '>= 7.2.0', '< 8.2.0'
spec.add_dependency 'zeitwerk', '>= 2.5.0'

spec.required_ruby_version = '>= 3.2.0'
Expand Down
7 changes: 0 additions & 7 deletions gemfiles/rails_7.1.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion gemfiles/rails_8.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

source 'https://rubygems.org'

gem 'rails', '~> 8.1.0.beta1'
gem 'rails', '~> 8.1.0.rc1'

gemspec path: '../'