> For the complete documentation index, see [llms.txt](https://docs.hivel.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hivel.ai/integrations/version-control/gitlab/gitlab-server-integration/gitlab-server-legacy-token-recommended.md).

# GitLab Server - Legacy token (recommended)

**Data Access by Hivel**

* Hivel accesses the past 60-90 days of commits and pull requests from active repositories during the initial sync.

**Authorization Mechanism**

* Hivel employs GitLab Server's **personal access token** for authentication.
* Users maintain full control and can withdraw access by revoking the Personal Access Token.

**Effortlessly Connect Your GitLab Server with Hivel**

This easy-to-follow guide will lead you through each step, ensuring a smooth and efficient integration process to unlock efficiency insights across your org.&#x20;

### **Step 1: Gather Your GitLab Server Details**

First things first, let's get some essential information from your GitLab Server:

* **GitLab Server URL**: This is your gateway to accessing your GitLab Server. Look for an address in the format of `https://{your-git-domain}.com/`. Don't forget to replace `{your-git-domain}` with your actual domain.
* **GitLab Server Version**: Compatibility is key, and knowing your GitLab Server version is crucial. Here's how to find it:
  * Head over to your GitLab Server interface.
  * Click on the 'Help' section. It’s usually at the end of your GitLab URL, like this: `/help`.
  * You'll see your version info displayed, typically in the format of "GitLab Community Edition {x.x.x} / GitLab Enterprise Edition {x.x.x}".

### **Step 2: Whitelist Necessary IP Addresses**

For a secure and uninterrupted connection, make sure to whitelist the following IP addresses:

* **Mandatory IPs**:
  * 107.23.139.76
  * 3.219.89.23
* **Recommended but Optional IPs**:
  * 45.119.114.218
  * 183.82.116.218

### **Step 3 Prepare a Service Account**

1. **Log into the GitLab service account:**
   * Use a dedicated service account that has access to the required repositories for Hivel integration.
   * Avoid using personal GitLab accounts to ensure only the intended repositories are accessed.

### **Step 4: Open Access Tokens**

1. In your GitLab account, click your **avatar** in the top-right corner.
2. Select **Preferences**.

   <img src="https://3057781534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5KAIOUWph0JLSgQqbzyT%2Fuploads%2FaRG2gWTy2XxZZuajF5ev%2Funknown.png?alt=media&amp;token=bfdb360a-f12f-42d7-910f-a15e806b8cb7" alt="" height="391" width="277">
3. On the left sidebar, select **Access > Personal access tokens**.<br>

   ![](https://3057781534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5KAIOUWph0JLSgQqbzyT%2Fuploads%2FMLPNIdIyHVLq8AMXx1rl%2Funknown.png?alt=media\&token=f118b7a6-0f55-457e-900e-485d388ea2af)

### **Step 5:** Click on the **Generate token** dropdown and select **Legacy token**.

![](https://3057781534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5KAIOUWph0JLSgQqbzyT%2Fuploads%2Fa3F6vr9HZaelQtvYcNxM%2Funknown.png?alt=media\&token=9c6936e4-0fdd-4717-80ca-bb2040e5b17f)

### **Step 6: Configure the Personal Access Token**

1. Enter a name (e.g. *Hivel*), and set the **longest expiry date your organization's policy allows**. (GitLab requires an expiry date on personal access tokens. You can revoke the token manually when the engagement ends.)
2. Select the desired scopes:

   1. *read\_api*
   2. *read\_user*
   3. *read\_repository*

   ![](https://3057781534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5KAIOUWph0JLSgQqbzyT%2Fuploads%2FITeViUlI0YHbMjOnmoMx%2Funknown.png?alt=media\&token=81c92d11-00e2-48f1-b68b-cf45cee0ccc7)
3. Select **Create personal access token**, and **copy it** immediately, as you won't be able to view it again.

### **Step 7: Connect in Hivel**

1. Copy the generated token immediately, as you won't be able to view it again.
2. **Submit:**\
   a. GitLab token\
   b. Email\
   c. base URL<br>

   <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Obtaining base URL:</strong></p><p>Open your <strong>GitLab dashboard</strong> or any project page and copy <strong>only the base URL</strong> from your browser’s address bar, excluding the project name and anything that follows it (e.g., <code>https://company.com</code>). For detailed instructions, <a href="/integrations/version-control/gitlab/gitlab-server-integration/how-to-find-your-gitlab-server-url.md">How to Find Your GitLab Server URL?</a></p></div>

   \
   d. username to Hivel.

Hivel validates the token instantly - if the token is wrong, expired, or missing any of the required scopes, Hivel shows a clear message telling you exactly what the problem is. Generate a new token with the correct scopes and reconnect.

That's it, all done!

***

#### **Continue setting up your integrations**

Now that GitLab Server is connected, connect the rest of your on-prem tools to complete your setup - [Back to Integrations](https://docs.hivel.ai/integrations#on-prem-server-integrations)
