https://github.com/lehigh-university-libraries/turnstile_protect
  
  
    Put Drupal site routes behind a Cloudflare Turnstile 
    https://github.com/lehigh-university-libraries/turnstile_protect
  
cloudflare-turnstile drupal spam-filtering
        Last synced: 3 months ago 
        JSON representation
    
Put Drupal site routes behind a Cloudflare Turnstile
- Host: GitHub
- URL: https://github.com/lehigh-university-libraries/turnstile_protect
- Owner: lehigh-university-libraries
- Created: 2024-10-18T20:18:16.000Z (about 1 year ago)
- Default Branch: 1.0.x
- Last Pushed: 2024-11-17T21:15:28.000Z (12 months ago)
- Last Synced: 2024-11-17T21:24:58.541Z (12 months ago)
- Topics: cloudflare-turnstile, drupal, spam-filtering
- Language: PHP
- Homepage: https://www.drupal.org/project/turnstile_protect
- Size: 39.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
- 
            Metadata Files:
            - Readme: README.md
 
Awesome Lists containing this project
README
          ## INTRODUCTION
The Turnstile Protect module is a way to put site routes behind a Cloudflare Turnstile.
The primary use case for this module is:
- You have a route (or routes) on your Drupal site that do not need indexed by search engines you want to protect from excessive crawling
## How it works
```mermaid
flowchart TD
    Client(Client accesses path on website) --> Cookie{Has client passed turnstile before?}
    Cookie -- Yes --> Continue(Go to original destination)
    Cookie -- No --> Authenticated{Is client authenticated?}
    Authenticated -- Yes --> Continue(Go to original destination)
    Authenticated -- No --> IP_BYPASS{Is client IP whitelisted by captcha module?}
    IP_BYPASS -- Yes --> Continue(Go to original destination)
    IP_BYPASS -- No --> GOOD_BOT{Is client IP hostname in allowed bot list?}
    GOOD_BOT -- No --> PROTECTED_ROUTE{Is this route protected by Turnstile?}
    GOOD_BOT -- Yes --> CANONICAL_URL_BOT{Are there URL parameters?}
    CANONICAL_URL_BOT -- Yes --> PROTECTED_ROUTE{Is this route protected by Turnstile?}
    CANONICAL_URL_BOT -- No --> Continue(Go to original destination)
    PROTECTED_ROUTE -- Yes --> RATE_LIMIT{Is this IP in a range seeing increased traffic?}
    PROTECTED_ROUTE -- No --> Continue(Go to original destination)
    RATE_LIMIT -- Yes --> REDIRECT(Redirect to /challenge)
    RATE_LIMIT -- No --> Continue(Go to original destination)
    REDIRECT --> CHALLENGE{Cloudflare turnstile challenge}
    CHALLENGE -- Pass --> Continue(Go to original destination)
    CHALLENGE -- Fail --> Stuck
```
## REQUIREMENTS
- [Turnstile](https://www.drupal.org/project/turnstile)
- [Captcha](https://www.drupal.org/project/captcha)
## INSTALLATION
Install as you would normally install a contributed Drupal module.
See: https://www.drupal.org/node/895232 for further information.
## CONFIGURATION
- Follow [the turnstile module install instructions](https://www.drupal.org/project/turnstile)
- Configure which route(s) to protect - (TODO - implement config settings)
- If you want to exclude IPs from being protected, configure them in the captcha IP settings on your site at `/admin/config/people/captcha`
## MAINTAINERS
Current maintainers for Drupal 10:
- Joe Corall (joecorall) - https://www.drupal.org/u/joecorall