# GitHub Enterprise Server

{% hint style="info" %}
This guide was written using GitHub Enterprise version 3.1.1.
{% endhint %}

## 1. Create a Swarmia app on GitHub

In your GitHub Enterprise organization settings, select *GitHub Apps* under *Developer Settings*. Select *New GitHub App*.

<figure><img src="/files/AnJPiATPUO50qPhl6wMD" alt=""><figcaption></figcaption></figure>

Fill out the form with the following values:

* GitHub App name: **Swarmia**
* Homepage URL: **<https://www.swarmia.com>**

<figure><img src="/files/co1FzFCgBBSJqKZtGgLl" alt=""><figcaption></figcaption></figure>

### Identifying and authorizing users

Callback URL: `https://app.swarmia.com/auth/github/callback/[your-github-organization-name]`

{% hint style="info" %}
If you don't know exactly what to put as your organization name, don't worry. This is just for an identifier on our side that you'll use to login.
{% endhint %}

Expire user authorization tokens: ✅

Request user authorization (OAuth) during installation: ✅

### Webhook

Active: ✅

Webhook URL: `https://hook.swarmia.com/GithubWebhook`

Webhook secret: \<random-string-with-high-entropy>

Enable SSL verification: ✅

<figure><img src="/files/OZqpi39taCzyqESLuE2T" alt=""><figcaption></figcaption></figure>

### Repository permissions

<figure><img src="/files/bPfyiVJmoc5LLZE6pckO" alt=""><figcaption></figcaption></figure>

### **Organization permissions**

<figure><img src="/files/E5QJOTuF6UvHMmVxDnlK" alt=""><figcaption></figcaption></figure>

### **Subscribe to events**

<figure><img src="/files/GGtc5C28bCmJpMAtFCgM" alt=""><figcaption></figcaption></figure>

### Create GitHub App

* Where can this GitHub App be installed? Select *Any account*
* Click *Create Github App*

<figure><img src="/files/hHsVY10GhlTyanmXJIN0" alt=""><figcaption></figcaption></figure>

After you've created the app, you will see the following message.

<figure><img src="/files/tUJAChx4bE7DlEvsHFpt" alt=""><figcaption></figcaption></figure>

Click **Generate a private key**.

It will take you to the Private keys section. Click *Generate a private key* button.

`swarmia.date.private-key.pem` will be downloaded.

<figure><img src="/files/ICr1fwEbv2foutDoPaQR" alt=""><figcaption></figcaption></figure>

After successfully registering your application, you can optionally add a logo to your app. Here is a pre-cropped image you can use:

<figure><img src="/files/E97pdHjuq53O5Y7lV6PA" alt=""><figcaption></figcaption></figure>

Make a note of your **App ID,** **Client ID,** and **Client Secret.** you will need those to connect your GitHub Enterprise Server with Swarmia in the next step. App ID and Client ID should be visible and client secret you can generate.

Finally, generate a **Client secret**, and store it somewhere safe. You'll need that in a bit:

<figure><img src="/files/AXUJjiD3iCaIc1ZEWyMN" alt=""><figcaption></figcaption></figure>

## **2.** Share your settings with Swarmia

{% hint style="info" %}
You should have acquired **App ID, Client ID, Client Secret, Callback URL, Webhook secret** and **Private key** in the previous steps. Share these secrets securely with [this Google Form](https://docs.google.com/forms/d/e/1FAIpQLSeX-es47DqzC9d1ogJzEsTTVPuk0owdFug02VwQ9rUr0SiBkg/viewform) and let your Swarmia contact person know that you're done with this part of the setup.
{% endhint %}

If you're using a self-signed TLS certificate in your GitHub Enterprise instance please supply a TLS certificate pair to be used by Swarmia as a client certificate when contacting your GitHub Enterprise endpoints.

## 3. Configure your firewall

If your GitHub Enterprise is behind a firewall you’ll need to allow Swarmia's IP address so we can perform GitHub Enterprise API calls and receive webhooks.

* Inbound IPs (we make HTTPS requests to your GitHub instance): 34.89.165.89 & 35.234.103.84
* Outbound IPs (GitHub makes HTTPS requests to us): 34.117.202.112 (hook.swarmia.com) & 34.107.207.241 (app.swarmia.com)

If you are unable to grant the inbound traffic access, you can use our [proxy agent](/settings/integrations/proxy-agent.md) to facilitate access.

## 4. Install the Swarmia app in organization(s)

After you've completed steps 1, 2, and 3 let Swarmia know you're ready to install the app. We then run the installation on our end, after which you're free to install the Swarmia app to your chosen organization(s). The app can be found at `https://[hostname]/github-apps/swarmia` where users can install it to their organization(s).

<figure><img src="/files/thlFg0Bfp7vvOuynIVrY" alt=""><figcaption></figcaption></figure>

## 5. Log in

Now you can log in to your Swarmia instance at `https://app.swarmia.com/login/[your-github-organization-name]`

where the Github organization name is the same one that you used for the Callback URL earlier.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.swarmia.com/settings/integrations/code-hosting-platforms/github/github-enterprise-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
