Turn on bot protection
Bot protection adds a Cloudflare Turnstile challenge to sign-in with an email code or a password, and to password-protected apps, so that scripts cannot request sign-in codes or guess passwords in bulk. Passkeys and single sign-on do not get a challenge. Turnstile checks the visitor in the background and usually does not ask them to solve a puzzle.
Bot protection stays off until you set both keys.
Prerequisites
Section titled “Prerequisites”- The superadmin role.
- A Turnstile widget in your Cloudflare account. The widget provides a site key and a secret key.
Turn on bot protection
Section titled “Turn on bot protection”- Go to Instance admin > Configuration.
- In Bot protection, enter the Site key and the Secret key.
- Keep Challenge the sign-in pages turned on.
- (Optional) Turn on Refuse sign-in when Cloudflare is unreachable.
- Select Save.
| Setting | Default | Description |
|---|---|---|
| Challenge the sign-in pages | On | Orchard ignores this setting until both keys are set. Turning it off removes the challenge from sign-in and from password-protected apps, and keeps the keys. |
| Refuse sign-in when Cloudflare is unreachable | Off | When this is off, Orchard allows sign-ins without a challenge if it cannot reach Cloudflare, and logs the event. |
Set keys with environment variables
Section titled “Set keys with environment variables”Each field has an environment variable. A value in the environment overrides the dashboard, and the field shows Set by the environment.
| Field | Environment variable |
|---|---|
| Site key | TURNSTILE_SITE_KEY |
| Secret key | TURNSTILE_SECRET_KEY |
| Challenge the sign-in pages | TURNSTILE_ENABLED |
| Refuse sign-in when Cloudflare is unreachable | TURNSTILE_STRICT |
Recover from wrong keys
Section titled “Recover from wrong keys”If the keys are wrong, you cannot sign in to change them. To turn off the challenge, set TURNSTILE_ENABLED to false on the server.
On an installer host, run the following command:
sudo orchardctl env set TURNSTILE_ENABLED false --applyOn a Helm install, set the variable in your values file.
Related resources
Section titled “Related resources”- Configuration - Set instance settings in the dashboard or with environment variables.
- Host commands - Change environment variables on an installer host with
orchardctl. - Rate limits and client addresses - Make sign-in limits apply to each visitor.