# GitLab

See all your teams work from JIRA issues to pull requests in once place by integrating Github with Haystack.

{% hint style="info" %}
For more information on what data Haystack uses from Gitlab, [here is an article!](https://help.usehaystack.io/admin/security-and-privacy)
{% endhint %}

### For GitLab integrations, there are 3 high level steps <a href="#h_fdbbdd3724" id="h_fdbbdd3724"></a>

1. **Generate Personal Access Token**
2. **Provide Access Token to Haystack**
3. **(Only self-hosted) Open GitLab firewall to Haystack IPs**

You can find detailed instructions on each step below.

### 1. Generate Personal Access Token <a href="#h_a694d7f69c" id="h_a694d7f69c"></a>

You can [create as many personal access tokens](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token) as you like from your GitLab profile.

1. Log in to GitLab.
2. In the upper-right corner, click your avatar and select Settings.
3. On the User Settings menu, select Access Tokens.
4. Choose a name and optional expiry date for the token - Don't set any date.
5. Choose the desired scopes - For Haystack we need only api scope and read\_user scope..
6. Click the Create personal access token button.
7. Save the personal access token somewhere safe. Once you leave or refresh the page, you won’t be able to access it again.

Here is the example:

<figure><img src="https://downloads.intercomcdn.com/i/o/449487822/3cd10e1e86f1d98c12a821ba/Screen+Shot+2022-01-17+at+3.21.01+PM.png" alt="" width="563"><figcaption></figcaption></figure>

### 2. Complete Filling Out Information on Haystack <a href="#h_cf91a75a3c" id="h_cf91a75a3c"></a>

<figure><img src="https://downloads.intercomcdn.com/i/o/907311855/bafe3108a1c4632c139f8664/Screenshot+2023-12-12+at+6.26.54%E2%80%AFPM.png" alt="" width="563"><figcaption></figcaption></figure>

Copy paste the newly generated token into Haystack.

Click "Connect" and you are all done if you are not using a self managed Gitlab instance.

{% hint style="info" %}
If you have a self managed Gitlab instance, please continue reading.
{% endhint %}

### 3. (Only self-managed) Open GitLab firewall to Haystack IPs <a href="#h_833ff6d687" id="h_833ff6d687"></a>

If you have a self managed Gitlab instance, you will need to open firewall access to the following IP addresses Haystack uses to connect to GitLab.

```
35.209.159.249
35.208.83.132
35.208.18.170
35.209.170.63
```
