Self-Hosting SourceAnt
This guide is for users who want to host their own instance of SourceAnt.
Prerequisites
- Python 3.8+
- GitHub account with a repository for testing.
- LLM API key (e.g., Gemini).
Installation
- Clone the Repository:
git clone https://github.com/sourceant/sourceant.git && cd sourceant
- Initial project setup (docker-compose):
docker compose up -d
- Install Dependencies:
docker compose exec app pip install -r requirements.txt
- Set Environment Variables:
Copy.env.example
to.env
and update the credentials.
GitHub App Setup
If you are running your own instance of SourceAnt, you must create your own GitHub App. This is because the webhook URL must point to your own server.
- Create a New GitHub App:
- Navigate to your GitHub settings: Developer settings > GitHub Apps > New GitHub App.
- Webhook URL: Set this to the public URL of your backend, pointing to the webhook endpoint (e.g.,
https://your-domain.com/api/github/webhooks
). - Webhook Secret: Generate a secure secret and save it. You will need this for the
GITHUB_SECRET
environment variable.
- Set Permissions: Grant Pull requests: Read & write and Contents: Read-only.
- Generate a Private Key: Download the private key (
.pem
file). - Configure Environment Variables: Update your
.env
file with your App ID, private key path, and webhook secret.