25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

12345678910111213141516171819202122232425262728293031323334353637
  1. # Overview
  2. A captcha can be enabled on your homeserver to help prevent bots from registering
  3. accounts. Synapse currently uses Google's reCAPTCHA service which requires API keys
  4. from Google.
  5. ## Getting API keys
  6. 1. Create a new site at <https://www.google.com/recaptcha/admin/create>
  7. 1. Set the label to anything you want
  8. 1. Set the type to reCAPTCHA v2 using the "I'm not a robot" Checkbox option.
  9. This is the only type of captcha that works with Synapse.
  10. 1. Add the public hostname for your server, as set in `public_baseurl`
  11. in `homeserver.yaml`, to the list of authorized domains. If you have not set
  12. `public_baseurl`, use `server_name`.
  13. 1. Agree to the terms of service and submit.
  14. 1. Copy your site key and secret key and add them to your `homeserver.yaml`
  15. configuration file
  16. ```yaml
  17. recaptcha_public_key: YOUR_SITE_KEY
  18. recaptcha_private_key: YOUR_SECRET_KEY
  19. ```
  20. 1. Enable the CAPTCHA for new registrations
  21. ```yaml
  22. enable_registration_captcha: true
  23. ```
  24. 1. Go to the settings page for the CAPTCHA you just created
  25. 1. Uncheck the "Verify the origin of reCAPTCHA solutions" checkbox so that the
  26. captcha can be displayed in any client. If you do not disable this option then you
  27. must specify the domains of every client that is allowed to display the CAPTCHA.
  28. ## Configuring IP used for auth
  29. The reCAPTCHA API requires that the IP address of the user who solved the
  30. CAPTCHA is sent. If the client is connecting through a proxy or load balancer,
  31. it may be required to use the `X-Forwarded-For` (XFF) header instead of the origin
  32. IP address. This can be configured using the `x_forwarded` directive in the
  33. listeners section of the `homeserver.yaml` configuration file.