feat(admin): manage captcha configuration centrally

- add a dedicated Filament settings tab for captcha drivers
- persist selections into config-compatible schema and migrate legacy keys
- extend captcha manager to consume database overrides transparently

Signed-off-by: Qi HU <github@spcsky.com>
This commit is contained in:
Qi HU
2025-10-13 12:15:33 +08:00
parent 60e1e45d73
commit ce913b7a54
5 changed files with 274 additions and 0 deletions

View File

@@ -103,6 +103,48 @@ return [
'max_uploaded_duration' => 'Maximum upload volume multiplier effective time range',
'max_uploaded_duration_help' => 'Unit: hours. The maximum upload volume multiplier takes effect within this time range after the torrent is published, and does not take effect beyond this range. A setting of 0 is always in effect',
],
'captcha' => [
'tab_header' => 'Captcha',
'driver' => 'Captcha driver',
'driver_help' => 'Choose which verification mechanism is displayed on public forms.',
'drivers' => [
'image' => 'Built-in image captcha',
'cloudflare_turnstile' => 'Cloudflare Turnstile',
'google_recaptcha_v2' => 'Google reCAPTCHA v2',
],
'turnstile' => [
'section' => 'Cloudflare Turnstile',
'site_key' => 'Site key',
'site_key_help' => 'Copied from the Cloudflare Turnstile dashboard.',
'secret_key' => 'Secret key',
'secret_key_help' => 'Keep this value private.',
'theme' => 'Theme',
'theme_help' => 'Automatically adapts when set to Auto.',
'theme_auto' => 'Auto',
'theme_light' => 'Light',
'theme_dark' => 'Dark',
'size' => 'Widget size',
'size_help' => 'Flexible stretches to match the container width.',
'size_normal' => 'Normal',
'size_compact' => 'Compact',
'size_flexible' => 'Flexible',
],
'recaptcha' => [
'section' => 'Google reCAPTCHA v2',
'site_key' => 'Site key',
'site_key_help' => 'Provided by the Google reCAPTCHA admin console.',
'secret_key' => 'Secret key',
'secret_key_help' => 'Keep this value private.',
'theme' => 'Theme',
'theme_help' => 'Use dark when your site runs a dark palette.',
'theme_light' => 'Light',
'theme_dark' => 'Dark',
'size' => 'Widget size',
'size_help' => 'Compact is suitable for narrow layouts.',
'size_normal' => 'Normal',
'size_compact' => 'Compact',
],
],
'meilisearch' => [
'tab_header' => 'Meilisearch',
'enabled' => 'Whether to enable Meilisearch',