Skip to content
Install

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.

  • The superadmin role.
  • A Turnstile widget in your Cloudflare account. The widget provides a site key and a secret key.
  1. Go to Instance admin > Configuration.
  2. In Bot protection, enter the Site key and the Secret key.
  3. Keep Challenge the sign-in pages turned on.
  4. (Optional) Turn on Refuse sign-in when Cloudflare is unreachable.
  5. Select Save.
SettingDefaultDescription
Challenge the sign-in pagesOnOrchard 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 unreachableOffWhen this is off, Orchard allows sign-ins without a challenge if it cannot reach Cloudflare, and logs the event.

Each field has an environment variable. A value in the environment overrides the dashboard, and the field shows Set by the environment.

FieldEnvironment variable
Site keyTURNSTILE_SITE_KEY
Secret keyTURNSTILE_SECRET_KEY
Challenge the sign-in pagesTURNSTILE_ENABLED
Refuse sign-in when Cloudflare is unreachableTURNSTILE_STRICT

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 --apply

On a Helm install, set the variable in your values file.