7 Commits

Author SHA1 Message Date
Ben
ff469f84f1 docs: trigger AI review attempt 2 2026-01-01 05:30:11 +00:00
Ben
16023164ac Revert to explicit GITEA_API_URL configuration
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 36s
2026-01-01 05:27:38 +00:00
Ben
59c50c4cde Refactor config to use GITEA_BASE_URL
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 37s
2026-01-01 05:23:00 +00:00
Ben
a152406475 Fix API URL slash suffix
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 36s
2026-01-01 05:20:29 +00:00
Ben
c815464849 docs: test AI review trigger 2026-01-01 05:17:04 +00:00
Ben
dbe4c7659f Expose host port via PORT env var
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 35s
2026-01-01 05:00:52 +00:00
Ben
559fa574b0 Update compose to use Gitea registry image 2026-01-01 04:58:39 +00:00
2 changed files with 7 additions and 5 deletions

View File

@@ -4,6 +4,7 @@
A webhook-based service that automatically generates AI code reviews for Gitea Pull Requests using [xai-review](https://github.com/Nikita-Filonov/ai-review).
## Features
* **Integrated with AI**: Uses advanced LLMs for code analysis.
* **Zero-config per repository**: Works via a single Gitea System Webhook (or per-repo webhook).
* **Custom LLM Support**: Configuring it to use OpenAI, Ollama, vLLM, or any OpenAI-compatible endpoint.
* **Secure**: Runs in an isolated Docker container with strict context passed via environment variables.
@@ -11,7 +12,7 @@ A webhook-based service that automatically generates AI code reviews for Gitea P
## Deployment
### Docker Compose
Run the container using the provided `compose.yaml`.
Run the container using the provided `compose.yaml`. This will start the service in daemon mode.
```bash
docker compose up -d
@@ -24,7 +25,8 @@ Create a `.env` file with the following variables:
| Variable | Required | Description | Default |
| :--- | :--- | :--- | :--- |
| `GITEA_TOKEN` | **Yes** | A Gitea Access Token. Required permissions: `repository` (Read), `issue` (Read and Write). | |
| `GITEA_API_URL` | No | Full URL to your Gitea API (e.g., `http://gitea:3000/api/v1`). | |
| `GITEA_API_URL` | **Yes** | Full URL to your Gitea API (e.g., `https://git.example.com/api/v1`). | |
| `PORT` | No | Host port to expose the webhook server on. | `3000` |
| `OPENAI_API_KEY` | **Yes** | API Key for your LLM provider. Use `dummy` for local models if no auth needed. | |
| `OPENAI_BASE_URL` | No | Base URL for the LLM API. Set this for Ollama/vLLM (e.g. `http://host.docker.internal:11434/v1/`). | `https://api.openai.com/v1/` |
| `LLM_MODEL` | No | The model name to request (e.g. `gpt-4o`, `llama3.1`). | `gpt-4o` |

View File

@@ -1,11 +1,11 @@
services:
ai-webhook:
build: .
image: gitea.ext.ben.io/b3nw/gitea-ai-webhook:latest
container_name: gitea-ai-webhook
restart: always
ports:
- "3000:3000"
- "${PORT:-3000}:3000"
environment:
- GITEA_TOKEN=${GITEA_TOKEN}
# LLM Configuration
@@ -17,7 +17,7 @@ services:
# VCS Config
- VCS__PROVIDER=GITEA
- VCS__HTTP_CLIENT__API_TOKEN=${GITEA_TOKEN}
- VCS__HTTP_CLIENT__API_URL=${GITEA_API_URL:-http://gitea-server:3000/api/v1}
- VCS__HTTP_CLIENT__API_URL=${GITEA_API_URL}
volumes:
- xai-cache:/root/.cache