d3c15648f7e57e3fccbe7d2add36b6f9e1c9bb14
GOTOOLCHAIN environment variable to local in CI workflow
Changelog: other
DIUN Webhook Dashboard
A tiny Go web app that receives DIUN webhook events and shows the latest image updates in a simple UI.
- Receives DIUN webhooks at
POST /webhook - Serves a minimal dashboard at
/ - Exposes a read-only API at
GET /api/updates - Stores events in memory (ephemeral)
Quick start
Run locally (Go 1.26+)
go run .
# open http://localhost:8080
Docker
docker build -t diun-webhook-dashboard .
docker run --rm -p 8080:8080 diun-webhook-dashboard
# open http://localhost:8080
Docker Compose
docker compose up -d
# open http://localhost:8080
DIUN configuration example
Configure DIUN to send webhooks to this app. Example (YAML):
notif:
webhook:
enable: true
endpoint: http://your-host-or-ip:8080/webhook
Expected JSON payload (simplified):
{
"image": "library/nginx",
"tag": "1.27.0",
"status": "new",
"time": "2026-02-23T16:00:00Z"
}
API
POST /webhook— accept a DIUN event JSON body.GET /api/updates— return the latest events as a JSON object keyed by image name./— static HTML dashboard.
Note: data is only kept in-memory and will be reset on restart.
Project Structure
cmd/diunwebhook/— main application source and testsstatic/— static assetsDockerfile,docker-compose.yml,go.mod,go.sum— project config/build files
Development
- Code:
main.go - Static assets:
static/ - Container image:
Dockerfile
Production notes
- Behind a reverse proxy, ensure the app is reachable at
/webhookfrom DIUN. - Persistence is not implemented; hook up a store (e.g., BoltDB/Redis/Postgres) if you need durability.
- Consider adding auth, rate limiting, or a secret/token on the webhook endpoint if exposed publicly.
Testing
Run unit tests and check coverage:
go test -v -cover
Aim for 80–90% coverage. Coverage below 80% will emit a warning in CI but will not fail the pipeline.
CI/CD with Gitea Actions
A sample Gitea Actions workflow is provided in .gitea/workflows/ci.yml to automate build, test, and coverage checks.
License
MIT — see LICENSE.