0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 05:42:36 +08:00
discourse/plugins/discourse-captcha/plugin.rb
Juan David Martínez Cubillos 04b5530f34
DEV: Plugin rename discourse captcha (#39350)
####  Description:
This PR renames the `discourse-hcaptcha` plugin to `discourse-captcha`
to better reflect its support for multiple captcha providers (hCaptcha
and reCAPTCHA)

#### Changes

- Renamed plugin directory from plugins/discourse-hcaptcha to
plugins/discourse-captcha
- Updated Ruby module namespace from DiscourseHcaptcha to
DiscourseCaptcha
  - Updated references in:
    - .gitignore
    - pnpm-workspace.yaml
    - tsconfig.json
    - config/official_plugins.json
    - translator.yml
    - migrations/core/config/intermediate_db.yml
    - `hosted-site` plugin
- Migration file preserved to handle existing discourse_hcaptcha_enabled
setting migration

---------

Co-authored-by: Gabriel Grubba <gabriel@discourse.org>
2026-07-21 17:21:39 -05:00

30 lines
941 B
Ruby
Vendored

# coding: utf-8
# frozen_string_literal: true
# name: discourse-captcha
# about: Captcha support for Discourse (hCaptcha and reCaptcha)
# version: 0.0.1
# authors: Discourse
# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-captcha
# required_version: 2.7.0
# meta_topic_id: 291383
enabled_site_setting :discourse_captcha_enabled
register_svg_icon "hand"
module ::DiscourseCaptcha
PLUGIN_NAME = "discourse-captcha"
end
require_relative "lib/discourse_captcha/engine"
require_relative "lib/discourse_captcha/captcha_provider"
after_initialize do
reloadable_patch { UsersController.include(DiscourseCaptcha::CreateUsersControllerPatch) }
require_relative "app/services/problem_check/hcaptcha_configuration"
require_relative "app/services/problem_check/recaptcha_configuration"
register_problem_check ProblemCheck::HcaptchaConfiguration
register_problem_check ProblemCheck::RecaptchaConfiguration
end