Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

Add documentation for integrating CodeRabbit with self-hosted GitHub #41

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions docs/integrations/self-hosted-github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: CodeRabbit for Self-Hosted GitHub
description: Integrate CodeRabbit with your Self-Hosted GitHub instance.
sidebar_label: Self-Hosted GitHub
---

This page guides you through the process of integrating your CodeRabbit with your self-hosted GitHub instance.

1. [Create a GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) in your Organization or User account.

- Set the following Repository permissions:
- Checks: Read-only
- Contents: Read and write
- Discussions: Read-only
- Issues: Read & write
- Metadata: Read-only
- Pull requests: Read & write

- Set the following Organization permissions:
- Members: Read-only

- Set the following events:
- Meta
- Issue comment
- Issues
- Label
- Public
- Pull request
- Pull request review
- Pull request review comment
- Pull request review thread
- Push
- Release

2. Get the following information from the GitHub App:

- App ID
- Client ID
- Client Secret
- Webhook Secret

3. Prepare a `.env` file with the following information:

```bash
OPENAI_API_KEYS=<openai-key>

TEMP_PATH=/cache

AST_GREP_RULES_PATH=/home/jailuser/ast-grep-rules
AST_GREP_ESSENTIALS=ast-grep-essentials

GH_WEBHOOK_SECRET=<webhook-secret>
GITHUB_APP_CLIENT_ID=<github-app-client-id>
GITHUB_APP_CLIENT_SECRET=<github-app-client-secret>
GITHUB_APP_ID=<github-app-id>
GITHUB_APP_PEM_FILE=<flattened-pem-file>
```

> Note: For the `GITHUB_APP_PEM_FILE`, you need to flatten the PEM file by replacing newlines with `\n`.

4. Pull the CodeRabbit Docker image. The CodeRabbit Docker image is not available for public use. Please contact us at [[email protected]](mailto:[email protected]) for access.

```bash
cat coderabbit.json | docker login -u _json_key --password-stdin https://gcr.io
docker pull gcr.io/coderabbitprod/coderabbit-agent:latest
```

> Note: The `coderabbit.json` file is a service account key file that will be shared with you.

5. Host the image on a server, serverless function, or a container environment and expose the port `8080`.

6. Install the GitHub App on your GitHub organization or user account and point the Webhook URL to the hosted CodeRabbit instance, for example, `http://127.0.0.1:8080/github_webhooks`. GitHub will send events to the CodeRabbit instance.
102 changes: 51 additions & 51 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
{
"name": "coderabbit-docs",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "^3.1.1",
"@docusaurus/plugin-client-redirects": "^3.1.1",
"@docusaurus/plugin-content-blog": "^3.1.1",
"@docusaurus/preset-classic": "^3.1.1",
"@mdx-js/react": "^3.0.0",
"autoprefixer": "^10.4.16",
"clsx": "^2.0.0",
"disqus-react": "^1.1.5",
"postcss": "^8.4.32",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"tailwindcss": "^3.4.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.1.1",
"@docusaurus/tsconfig": "^3.1.1",
"@docusaurus/types": "^3.1.1",
"typescript": "~5.2.2"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 3 chrome version",
"last 3 firefox version",
"last 5 safari version"
]
},
"engines": {
"node": ">=18.0"
}
"name": "coderabbit-docs",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "^3.1.1",
"@docusaurus/plugin-client-redirects": "^3.1.1",
"@docusaurus/plugin-content-blog": "^3.1.1",
"@docusaurus/preset-classic": "^3.1.1",
"@mdx-js/react": "^3.0.0",
"autoprefixer": "^10.4.16",
"clsx": "^2.0.0",
"disqus-react": "^1.1.5",
"postcss": "^8.4.32",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"tailwindcss": "^3.4.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.1.1",
"@docusaurus/tsconfig": "^3.1.1",
"@docusaurus/types": "^3.1.1",
"typescript": "~5.2.2"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 3 chrome version",
"last 3 firefox version",
"last 5 safari version"
]
},
"engines": {
"node": ">=18.0"
}
}