feat: Refine captcha configuration and drivers

Introduce a configurable captcha manager with drivers for image,
Cloudflare Turnstile, and Google reCAPTCHA, including fallback
behaviour.

Refactor login, signup, complain, and related flows to use the new
abstraction while simplifying the legacy image endpoint.

Document captcha environment options and restore classic defaults in
.env.example.

Signed-off-by: Qi HU <github@spcsky.com>
This commit is contained in:
Qi HU
2025-10-11 23:38:27 +08:00
parent fc4c174442
commit 9033eff8ea
16 changed files with 734 additions and 100 deletions
+16
View File
@@ -96,6 +96,22 @@ CHANNEL_NAME_SETTING=channel_setting
CHANNEL_NAME_MODEL_EVENT=channel_model_event
FORCE_SCHEME=
# Captcha settings
# Available drivers: image, cloudflare_turnstile, google_recaptcha_v2
CAPTCHA_DRIVER=image
# Cloudflare Turnstile keys (used when CAPTCHA_DRIVER=cloudflare_turnstile)
TURNSTILE_SITE_KEY=
TURNSTILE_SECRET_KEY=
TURNSTILE_THEME=light
TURNSTILE_SIZE=flexible
# Google reCAPTCHA v2 keys (used when CAPTCHA_DRIVER=google_recaptcha_v2)
RECAPTCHA_SITE_KEY=
RECAPTCHA_SECRET_KEY=
RECAPTCHA_THEME=light
RECAPTCHA_SIZE=normal
CROWDIN_ACCESS_TOKEN=
CROWDIN_PROJECT_ID=