|
| 1 | +--- |
| 2 | +title:CodeRabbit for Self-Managed GitHub |
| 3 | +description:Integrate CodeRabbit with your Self-Managed GitHub instance. |
| 4 | +sidebar_label:Self-Managed GitHub |
| 5 | +sidebar_position:3 |
| 6 | +--- |
| 7 | + |
| 8 | +This page guides you through the process of integrating your Self-Managed GitHub with CodeRabbit. |
| 9 | + |
| 10 | +To initiate the integration, we require specific information. This is essential |
| 11 | +for the initial setup of CodeRabbit within your domain. Once this setup is |
| 12 | +complete, you can log in directly. |
| 13 | + |
| 14 | +###**Step 1: Getting Started** |
| 15 | + |
| 16 | +**Visit CodeRabbit:** Visit our[Login](https://coderabbit.ai/login) page and |
| 17 | +select Self-Hosted GitHub |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +On this page, enter the URL of your self-managed GitHub instance and click |
| 22 | +submit. Once, you submit, we check our database for a record of your |
| 23 | +organization and if we find an existing one, we will start the login process. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +If the self-managed GitHub instance is not found, you will be required to enter more details for the onboarding. |
| 28 | + |
| 29 | +###**Step 2: GitHub OAuth App** |
| 30 | + |
| 31 | +Navigate to your GitHub Self-Hosted Instance and follow the steps below to[create an OAuth App](https://docs.github.com/en/enterprise-server@latest/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app): |
| 32 | + |
| 33 | +1. Sign in to your GitHub Enterprise account. |
| 34 | +2. In the upper-right corner of any page, click your profile photo, then click**Settings**. |
| 35 | +3. In the left sidebar, click**Developer settings** >**OAuth Apps**. |
| 36 | +4. Click**New OAuth App**. |
| 37 | +5. Set the following fields: |
| 38 | +-**Application name**:`CodeRabbit OAuth` |
| 39 | +-**Homepage URL**:`https://coderabbit.ai` |
| 40 | +-**Application description**:`OAuth application for signing into CodeRabbit` |
| 41 | +-**Authorization callback URL**:`https://app.coderabbit.ai/login` |
| 42 | +6. Click**Register application**. |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +Once the OAuth App has been created, click on**Generate a new client secret** under the 'Client secrets' section and copy the secret as it will be visible once only |
| 47 | + |
| 48 | +Keep the following details handy: |
| 49 | + |
| 50 | +- Client ID |
| 51 | +- Client secret |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +###**Step 3: GitHub App** |
| 56 | + |
| 57 | +Navigate to your GitHub Self-Hosted Instance and follow the steps below to[create a GitHub App](https://docs.github.com/en/enterprise-server@latest/apps/creating-github-apps/registering-a-github-app/registering-a-github-app): |
| 58 | + |
| 59 | +1. Sign in to your GitHub Enterprise account. |
| 60 | +2. In the upper-right corner of any page, click your profile photo, then click**Settings**. |
| 61 | +3. In the left sidebar, click**Developer settings** >**GitHub Apps** |
| 62 | +4. Click**New GitHub App**. |
| 63 | +5. Set the following fields: |
| 64 | +-**GitHub App name**:`CodeRabbit GitHub App` |
| 65 | +-**Description**:`GitHub App for CodeRabbit` |
| 66 | +-**Homepage URL**:`https://coderabbit.ai` |
| 67 | +-**Callback URL**:`https://app.coderabbit.ai/login` |
| 68 | +-**Request user authorization (OAuth) during installation**:`true` |
| 69 | +-**Webhook Active**:`true` |
| 70 | +-**Webhook URL**:`https://app.coderabbit.ai/githubHandler` |
| 71 | +-**Webhook secret**: Use a secure string and keep it handy. |
| 72 | +-**Permissions**: |
| 73 | +-**Repository permissions**: |
| 74 | +-**Checks**: Read-only |
| 75 | +-**Contents**: Read and write |
| 76 | +-**Discussions**: Read-only |
| 77 | +-**Issues**: Read and write |
| 78 | +-**Metadata**: Read-only |
| 79 | +-**Pull requests**: Read and write |
| 80 | +-**Organization permissions**: |
| 81 | +-**Members**: Read-only |
| 82 | +-**Events**: |
| 83 | +- Meta |
| 84 | +- Issue comment |
| 85 | +- Issues |
| 86 | +- Label |
| 87 | +- Public |
| 88 | +- Pull request |
| 89 | +- Pull request review |
| 90 | +- Pull request review comment |
| 91 | +- Pull request review thread |
| 92 | +- Push |
| 93 | +- Release |
| 94 | +6. Click**Create GitHub App**. |
| 95 | + |
| 96 | +Once the GitHub App has been created, click on**Generate a new client secret** under the 'Client secrets' section and copy the secret as it will be visible once only. |
| 97 | + |
| 98 | +Scroll down and click on**Generate a private key** under the 'Private keys' section and download the PEM file. |
| 99 | + |
| 100 | +Also, from the**Install App** tab, install the GitHub App to your organizations. |
| 101 | + |
| 102 | +Keep the following details handy: |
| 103 | + |
| 104 | +- App ID |
| 105 | +- Client ID |
| 106 | +- Client secret |
| 107 | +- Webhook secret |
| 108 | +- Private key |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | +###**Step 4: CodeRabbit UI Onboarding** |
| 113 | + |
| 114 | +Submit the details that were accumulated in previous steps: |
| 115 | + |
| 116 | +- Host URL of your GitHub instance |
| 117 | +- OAuth Client ID |
| 118 | +- OAuth Client Secret |
| 119 | +- GitHub App ID |
| 120 | +- GitHub App Client ID |
| 121 | +- GitHub App Client Secret |
| 122 | +- GitHub App Webhook Secret |
| 123 | +- GitHub App Private Key |
| 124 | + |
| 125 | +Click on Submit and the login process will be initiated. |
| 126 | +On subsequent visits, your setup will be automatically detected, allowing for direct login. |
| 127 | + |
| 128 | +###**Step 5: Whitelist CodeRabbit IP address** |
| 129 | + |
| 130 | +Use this CodeRabbit IP if your instance requires IP whitelisting |
| 131 | +`35.222.179.152/32` |
| 132 | + |
| 133 | +VPN tunneling is available as an add-on package. Please reach out to us at |
| 134 | +[contact@coderabbit.ai](mailto:contact@coderabbit.ai) if you are interested. |