recaptcha.md 1.32 KB

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.

  1. Go to the URL: https://www.google.com/recaptcha/admin

  2. Fill out the form necessary to obtain reCAPTCHA keys.

  3. 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
  4. 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'
  5. Change 'YOUR_PUBLIC_KEY' to the public key from step 2.

  6. Change 'YOUR_PRIVATE_KEY' to the private key from step 2.

  7. Save the configuration file.

  8. Restart GitLab.