summaryrefslogtreecommitdiff
path: root/doc/integration/recaptcha.md
blob: 7e6f7e7e30a603efe8df48f24a99f8eed5e09cca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# reCAPTCHA

GitLab leverages [Google's reCAPTCHA](https://www.google.com/recaptcha/intro/index.html)
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

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

1. On your GitLab server, open the configuration file.

    For omnibus package:

    ```sh
      sudo editor /etc/gitlab/gitlab.rb
    ```

    For installations from source:

    ```sh
      cd /home/git/gitlab

      sudo -u git -H editor config/gitlab.yml
    ```

1.  Enable reCAPTCHA and add the settings:

    For omnibus package:

    ```ruby
      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'
    ```

1.  Change 'YOUR_PUBLIC_KEY' to the public key from step 2.

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

1.  Save the configuration file.

1.  Restart GitLab.