From 9d38c271b6d56ea46b9402291348152611991ba3 Mon Sep 17 00:00:00 2001 From: jonathan schatz Date: Wed, 15 Oct 2025 09:22:21 -0700 Subject: [PATCH] drop rails 7.1 --- Appraisals | 6 +----- README.md | 14 ++++++++------ cloudflare-rails.gemspec | 6 +++--- gemfiles/rails_7.1.gemfile | 7 ------- gemfiles/rails_8.1.gemfile | 2 +- 5 files changed, 13 insertions(+), 22 deletions(-) delete mode 100644 gemfiles/rails_7.1.gemfile diff --git a/Appraisals b/Appraisals index 26f6f30..6ff10a9 100644 --- a/Appraisals +++ b/Appraisals @@ -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 @@ -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 diff --git a/README.md b/README.md index f7a946a..b62c6cc 100644 --- a/README.md +++ b/README.md @@ -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 | @@ -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 @@ -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`. diff --git a/cloudflare-rails.gemspec b/cloudflare-rails.gemspec index bb66b0a..79c156b 100644 --- a/cloudflare-rails.gemspec +++ b/cloudflare-rails.gemspec @@ -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' diff --git a/gemfiles/rails_7.1.gemfile b/gemfiles/rails_7.1.gemfile deleted file mode 100644 index 9247b3b..0000000 --- a/gemfiles/rails_7.1.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source 'https://rubygems.org' - -gem 'rails', '~> 7.1.0' - -gemspec path: '../' diff --git a/gemfiles/rails_8.1.gemfile b/gemfiles/rails_8.1.gemfile index 6e0234c..e095716 100644 --- a/gemfiles/rails_8.1.gemfile +++ b/gemfiles/rails_8.1.gemfile @@ -4,6 +4,6 @@ source 'https://rubygems.org' -gem 'rails', '~> 8.1.0.beta1' +gem 'rails', '~> 8.1.0.rc1' gemspec path: '../'