Skip to content

dask-58/conduit

Repository files navigation

Conduit

Conduit is a small webhook relay for GitHub events. It accepts events, stores them in Postgres, queues deliveries in Redis, and forwards each payload to configured destinations.

Discord webhook URLs are handled specially: push, pull request, and ping events are converted into Discord messages. Other destinations receive the raw JSON payload with an HTTP POST.

Features

  • GitHub webhook ingest endpoint
  • Postgres event and delivery history
  • Redis-backed delivery queue and retries
  • Discord webhook destination formatter
  • Live delivery status over WebSocket
  • Minimal dashboard at /dashboard/
  • Docker Compose stack with Postgres and Redis
  • Automatic database migrations on startup

Quick Start

cp .env.example .env
docker compose up --build

Generate a real API key before exposing the service:

openssl rand -hex 32

Health check:

curl http://localhost:8080/healthz

Dashboard:

http://localhost:8080/dashboard/

Configuration

.env.example contains the Docker Compose defaults:

DATABASE_URL=postgres://conduit:conduit@postgres:5432/conduit?sslmode=disable
REDIS_URL=redis://redis:6379
API_KEY=change-me-generate-with-openssl-rand-hex-32
PORT=8080

API

Authenticated endpoints use:

Authorization: Bearer <API_KEY>

Create a destination endpoint:

curl -X POST http://localhost:8080/endpoints/ \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"discord","url":"https://discord.com/api/webhooks/..."}'

Ingest an event:

curl -X POST http://localhost:8080/ingest \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-GitHub-Event: push" \
  -d '{"ref":"refs/heads/main","repository":{"name":"demo"},"head_commit":{"message":"test"},"pusher":{"name":"you"}}'

List events:

curl http://localhost:8080/events

List deliveries for an event:

curl http://localhost:8080/events/<event_id>/deliveries

Stream delivery status:

wscat -c "ws://localhost:8080/ws/status?event_id=<event_id>"

GitHub Webhooks

Set the webhook URL to:

https://<your-host>/ingest

Use application/json as the content type. If you deploy the Cloudflare Worker from worker-edge/, configure it to forward GitHub requests to your Conduit origin with the Conduit API key.

Development

make dev      # docker compose up --build
make logs     # app logs
make down     # stop containers
make clean    # stop containers and remove volumes
go test ./...

License

MIT

About

Distributed webhook delivery engine with at-least-once guarantees, edge rate limiting, and real-time delivery tracing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors