Update README with Docker webhook setup instructions

Documents the host.docker.internal approach for Gitea running in
a Docker container, including docker-compose config and gotchas.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-14 21:43:43 -05:00
parent 7819dccb10
commit a2adda20a8

View File

@@ -64,7 +64,7 @@ You can re-trigger processing by editing the file to restore the original `BLIGH
```bash
# 1. Clone this repo onto the machine that will run the listener
git clone <this-repo-url>
cd Blight_Reader
cd BLIGHT--CUE
# 2. Create and activate a virtual environment
python3 -m venv .venv
@@ -84,7 +84,7 @@ cp .env.example .env
Edit `.env` with your values:
| Variable | Description |
|---|---|
| ---------------- | ------------------------------------------------------------------- |
| `GITEA_URL` | Base URL of your Gitea instance, no trailing slash |
| `GITEA_TOKEN` | Personal access token from Gitea → Settings → Applications |
| `GEMINI_API_KEY` | API key from [Google AI Studio](https://aistudio.google.com/apikey) |
@@ -125,12 +125,45 @@ WantedBy=multi-user.target
## Registering the Webhook in Gitea
### If Gitea runs in Docker
Gitea containers cannot reach `localhost` on the host directly. The recommended approach is to use `host.docker.internal`, which Docker resolves to the host machine's IP.
**1. Add `extra_hosts` to your Gitea `docker-compose.yml`:**
```yaml
services:
gitea:
image: gitea/gitea:latest
# ... your existing config ...
extra_hosts:
- "host.docker.internal:host-gateway"
```
**2. Restart Gitea:**
```bash
docker compose down && docker compose up -d
```
**3. Register the webhook using `host.docker.internal` as the host** (see below), with the Target URL set to:
```
http://host.docker.internal:5010/webhook
```
> **Note:** If Gitea is not running when CUE fires, or CUE is not running when Gitea sends a webhook, the delivery will fail. You can use the **Redeliver** button in the webhook's delivery history to retry without needing to push again.
---
### Registering the Webhook
Do this for **each repository** you want BLIGHT: CUE to watch.
1. Open the repository in Gitea.
2. Go to **Settings****Webhooks****Add Webhook****Gitea**.
3. Set the fields:
- **Target URL**: `http://<your-machine-ip>:5010/webhook`
- **Target URL**: `http://host.docker.internal:5010/webhook` (Docker) or `http://<host-ip>:5010/webhook` (non-Docker)
- **HTTP Method**: POST
- **Content Type**: `application/json`
- **Secret**: the same value as `WEBHOOK_SECRET` in your `.env`