You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why are these changes being introduced:
* Bots are using more resources than desired
Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/TIMX-480
How does this address that need:
* Adds rack-attack and bot_challenge_page gems
* Adds redis to heroku app.json (will need to manually enable in
staging and production environments before merge)
Copy file name to clipboardExpand all lines: README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,22 @@ If the `flipflop` gem has been updated, check that the `:gdt` feature is working
67
67
UI elements specific to GDT (e.g., geospatial search fields or the 'Ask GIS' link) appear with the
68
68
feature flag enabled, and do not when it is disabled.
69
69
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
+
70
86
### Required Environment Variables
71
87
72
88
-`TIMDEX_GRAPHQL`: Set this to the URL of the GraphQL endpoint. There is no default value in the application.
@@ -79,6 +95,10 @@ feature flag enabled, and do not when it is disabled.
79
95
-`BOOLEAN_OPTIONS`: comma separated list of values to present to testers on instances where `BOOLEAN_PICKER` feature is enabled.
80
96
-`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
81
97
testing and should never be enabled in production (mostly because the UI is a mess more than it would cause harm).
98
+
-`CLOUDFLARE_SITE_KEY`: obtained through our cloudflare account (see lastpass for account info)
99
+
-`CLOUDFLARE_SECRET_KEY`: obtained through our cloudflare account (see lastpass for account info)
100
+
-`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.
101
+
-`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.
82
102
-`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.
83
103
-`FILTER_ACCESS_TO_FILES`: The name to use instead of "Access to files" for that filter / aggregation.
84
104
-`FILTER_CONTENT_TYPE`: The name to use instead of "Content type" for that filter / aggregation.
0 commit comments