Configuring Cloudflare Turnstile
Cloudflare Turnstile is our recommended Captcha provider. It is a free, privacy-friendly alternative to CAPTCHA that automatically verifies visitors.
Unlike traditional challenges that ask users to "identify crosswalks," Turnstile runs smart background checks. In most cases, it is completely invisible or requires only a single click.
Step 1: Get Your Keys
- Log in to the Cloudflare Dashboard.
- Navigate to Turnstile in the sidebar.
- Click Add Site.
- Site Name: Enter a friendly name (e.g., "Flux Forms").
- Domain: Enter the domains where you will host the form (e.g.,
mysite.com).- Tip: Add
localhostor127.0.0.1to the list if you plan to test the form on your local machine.
- Tip: Add
- Widget Mode:
- Managed (Recommended): Cloudflare decides when to show a challenge.
- Non-interactive: Runs purely in the background. If it fails, the user cannot submit.
- Invisible: The widget is hidden, but a challenge may appear if needed.
- Click Create.
- Copy the Site Key and Secret Key.
Step 2: Configure Flux
Now, store these keys securely in your Flux server.
- SSH into your Flux instance:
ssh -p 2222 admin@<your-ip> - Navigate to Infrastructure -> Captcha (or "Manage Captchas").
- Press
nto create a new configuration. - Provider Name: Give it a unique ID (e.g.,
cf-turnstile-main). - Type: Select
Cloudflare Turnstilefrom the list. - Site Key: Paste the Site Key you copied from Cloudflare.
- Secret Key: Paste the Secret Key.
- Select Save (or press Enter) to confirm.
Step 3: Attach to a Form
Finally, link this configuration to the specific form you want to protect.
- Go back to the Dashboard and select Forms (or "Manage Forms").
- Select the form you want to protect.
- Select Edit Metadata.
- In the Captcha dropdown, select your new provider (e.g.,
cf-turnstile-main). - Select Save & Exit.
Success!
Your form is now protected. Flux will automatically inject the necessary scripts and render the Turnstile widget (or run it invisibly) whenever the form is loaded.