reCAPTCHA
GitLab leverages Google's reCAPTCHA to protect against spam and abuse. GitLab displays the CAPTCHA form on the sign-up page to confirm that a real user, not a bot, is attempting to create an account.
Configuration
To use reCAPTCHA, first you must create a public and private key.
-
Go to the URL: https://www.google.com/recaptcha/admin
-
Fill out the form necessary to obtain reCAPTCHA keys.
-
On your GitLab server, open the configuration file.
For omnibus package:
sudo editor /etc/gitlab/gitlab.rb
For installations from source:
cd /home/git/gitlab sudo -u git -H editor config/gitlab.yml
-
Enable reCAPTCHA and add the settings:
For omnibus package:
gitlab_rails['recaptcha_enabled'] = true gitlab_rails['recaptcha_public_key'] = 'YOUR_PUBLIC_KEY' gitlab_rails['recaptcha_private_key'] = 'YOUR_PUBLIC_KEY'
For installation from source:
recaptcha: enabled: true public_key: 'YOUR_PUBLIC_KEY' private_key: 'YOUR_PRIVATE_KEY'
-
Change 'YOUR_PUBLIC_KEY' to the public key from step 2.
-
Change 'YOUR_PRIVATE_KEY' to the private key from step 2.
-
Save the configuration file.
-
Restart GitLab.