eat: add reCAPTCHA v3 and Cloudflare Turnstile verification support

- Implement reCAPTCHA v3 with score-based validation
- Add Cloudflare Turnstile as captcha alternative
- Create reusable CaptchaService for unified validation
- Support switching between recaptcha, recaptcha-v3, and turnstile
- Maintain backward compatibility with existing configurations
This commit is contained in:
xboard
2025-06-28 18:01:59 +08:00
parent f1d1dd5684
commit 6d85736eea
18 changed files with 1097 additions and 836 deletions
+51 -11
View File
@@ -416,20 +416,60 @@ window.XBOARD_TRANSLATIONS['en-US'] = {
"description": "Enter the allowed email suffixes, one per line"
}
},
"recaptcha": {
"captcha": {
"enable": {
"label": "Enable reCAPTCHA",
"description": "When enabled, users will need to pass reCAPTCHA verification when registering."
"label": "Enable Captcha",
"description": "When enabled, users will need to pass captcha verification when registering."
},
"key": {
"label": "reCAPTCHA Key",
"placeholder": "Enter reCAPTCHA key",
"description": "Enter your reCAPTCHA key"
"type": {
"label": "Captcha Type",
"description": "Select the captcha service type to use",
"options": {
"recaptcha": "Google reCAPTCHA v2",
"recaptcha-v3": "Google reCAPTCHA v3",
"turnstile": "Cloudflare Turnstile"
}
},
"siteKey": {
"label": "reCAPTCHA Site Key",
"placeholder": "Enter reCAPTCHA site key",
"description": "Enter your reCAPTCHA site key"
"recaptcha": {
"key": {
"label": "reCAPTCHA Key",
"placeholder": "Enter reCAPTCHA key",
"description": "Enter your reCAPTCHA key"
},
"siteKey": {
"label": "reCAPTCHA Site Key",
"placeholder": "Enter reCAPTCHA site key",
"description": "Enter your reCAPTCHA site key"
}
},
"recaptcha_v3": {
"secretKey": {
"label": "reCAPTCHA v3 Key",
"placeholder": "Enter reCAPTCHA v3 key",
"description": "Enter your reCAPTCHA v3 server key"
},
"siteKey": {
"label": "reCAPTCHA v3 Site Key",
"placeholder": "Enter reCAPTCHA v3 site key",
"description": "Enter your reCAPTCHA v3 site key"
},
"scoreThreshold": {
"label": "Score Threshold",
"placeholder": "0.5",
"description": "Set verification score threshold (0-1), higher scores indicate more likely human behavior"
}
},
"turnstile": {
"secretKey": {
"label": "Turnstile Key",
"placeholder": "Enter Turnstile key",
"description": "Enter your Cloudflare Turnstile key"
},
"siteKey": {
"label": "Turnstile Site Key",
"placeholder": "Enter Turnstile site key",
"description": "Enter your Cloudflare Turnstile site key"
}
}
},
"registerLimit": {