Jean-Luc Makiola a9e468e2bb
Some checks failed
CI / build-test (push) Failing after 5m59s
Update CI workflow to use latest actions and Go version
Updated `actions/checkout` to v6 and `actions/setup-go` to v6 with Go version set to 1.26 for improved compatibility and functionality.

Changelog: other
2026-02-23 17:47:36 +01:00

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 tests
  • static/ — static assets
  • Dockerfile, 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 /webhook from 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 8090% 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.

Description
No description provided
Readme MIT 180 KiB
v0.0.1 Latest
2026-02-25 20:31:09 +00:00
Languages
TypeScript 48.9%
Go 47.8%
CSS 1.7%
Dockerfile 0.9%
HTML 0.6%
Other 0.1%