Skip to content

Commit a4922a2

Browse files
authored
Merge pull request #233 from MITLibraries/timx-565-depupdates
Removes bot_challenge_page gem
2 parents b6ed2bf + 7f4d294 commit a4922a2

File tree

6 files changed

+1
-85
lines changed

6 files changed

+1
-85
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44
ruby '3.2.9'
55

66
gem 'bootsnap', require: false
7-
gem 'bot_challenge_page'
87
gem 'graphql'
98
gem 'graphql-client'
109
gem 'http'

Gemfile.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ GEM
106106
debug_inspector (>= 1.2.0)
107107
bootsnap (1.18.6)
108108
msgpack (~> 1.2)
109-
bot_challenge_page (0.4.0)
110-
http (~> 5.2)
111-
rack-attack (~> 6.7)
112-
rails (>= 7.1, < 8.1)
113109
builder (3.3.0)
114110
capybara (3.40.0)
115111
addressable
@@ -415,7 +411,6 @@ DEPENDENCIES
415411
better_errors
416412
binding_of_caller
417413
bootsnap
418-
bot_challenge_page
419414
capybara
420415
climate_control
421416
debug

README.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,6 @@ If the `flipflop` gem has been updated, check that the `:gdt` feature is working
6767
UI elements specific to GDT (e.g., geospatial search fields or the 'Ask GIS' link) appear with the
6868
feature flag enabled, and do not when it is disabled.
6969

70-
### CloudFlare Turnstile
71-
72-
This application uses [CloudFlare Turnstile](https://www.cloudflare.com/application-services/products/turnstile/) via
73-
the [Bot Challenge Page](https://github.com/samvera-labs/bot_challenge_page) gem.
74-
75-
In development, you can enable/disable this by running `rails dev:cache`. When `dev:cache` is not enabled, the cache is
76-
set to `null` so no enforcement is in place. As we do not register `localhost` with CloudFlare, if you have `dev:cache`
77-
enabled locally, you won't actually see the Turnstile challenge and instead will see a message saying you have been
78-
blocked. This is what users would also see if a deployed app is not registered with CloudFlare so we need to ensure all
79-
apps we intend to protect are registered with the site key we have enabled.
80-
81-
`Bot Challenge Page` uses [rack-attack](https://github.com/rack/rack-attack). On Heroku deployed apps, we'll be using
82-
Redis to track requests.
83-
84-
See `Optional Environment Variables` for more information.
85-
8670
### Rack Attack
8771

8872
This application uses [Rack Attack](https://github.com/rack/rack-attack).
@@ -109,10 +93,6 @@ See `Optional Environment Variables` for more information.
10993
- `BOOLEAN_OPTIONS`: comma separated list of values to present to testers on instances where `BOOLEAN_PICKER` feature is enabled.
11094
- `BOOLEAN_PICKER`: feature to allow users to select their preferred boolean type. If set, feature is enabled. This feature is only intended for internal team
11195
testing and should never be enabled in production (mostly because the UI is a mess more than it would cause harm).
112-
- `CLOUDFLARE_SITE_KEY`: obtained through our cloudflare account (see lastpass for account info)
113-
- `CLOUDFLARE_SECRET_KEY`: obtained through our cloudflare account (see lastpass for account info)
114-
- `CLOUDFLARE_REQUEST_PERIOD_IN_HOURS`: integer in hours we use for grouping requests. Combined with `CLOUDFLARE_REQUESTS_PER_PERIOD` this makes up the "requests allowed per time period". Defaults to 12.
115-
- `CLOUDFLARE_REQUESTS_PER_PERIOD`: integer representing number of results and records pages allowed in the period defined in `CLOUDFLARE_REQUEST_PERIOD_IN_HOURS`. Defaults to 10.
11696
- `FACT_PANELS_ENABLED`: Comma separated list of enabled fact panels. See `/views/results.html.erb` for implemented panels/valid options. Leave unset to disable all.
11797
- `FILTER_ACCESS_TO_FILES`: The name to use instead of "Access to files" for that filter / aggregation.
11898
- `FILTER_CONTENT_TYPE`: The name to use instead of "Content type" for that filter / aggregation.
@@ -189,4 +169,4 @@ If you prefer an editor other than VSCode, you can manage [Dev Containers from t
189169

190170
[DevPod](https://github.com/loft-sh/devpod) is also something to consider. It provides a VScode-via-web-browser-in-a-box
191171
as well as allowing you to use whatever editor you want and only using DevPod to start/stop the containers and run your
192-
terminals. Local for editor, DevPod managed Dev Container for everything else.
172+
terminals. Local for editor, DevPod managed Dev Container for everything else.
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
class ApplicationController < ActionController::Base
2-
# This will only protect CONFIGURED routes, but also could be put on just certain
3-
# controllers, it does not need to be in ApplicationController
4-
before_action do |controller|
5-
BotChallengePage::BotChallengePageController.bot_challenge_enforce_filter(controller)
6-
end
7-
82
helper Mitlibraries::Theme::Engine.helpers
93
end

config/initializers/bot_challenge_page.rb

Lines changed: 0 additions & 51 deletions
This file was deleted.

config/routes.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Rails.application.routes.draw do
2-
post "/challenge", to: "bot_challenge_page/bot_challenge_page#verify_challenge", as: :bot_detect_challenge
32
mount Flipflop::Engine => "/flipflop"
43
root "basic_search#index"
54

0 commit comments

Comments
 (0)