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