feat: forgejo integration - webhooks, commit reminders, and templated notifications #2

Merged
geekiot merged 12 commits from feature/forgejo-integration into main 2026-05-11 22:06:55 +05:00
Owner

Summary

Full integration with Forgejo: webhook handling, commit storage, daily reminders,
and CI workflow notifications with formatted messages.

Changes

Webhook handler (/webhook/forgejo)

  • HMAC-SHA256 signature verification
  • push event — saves commits to PostgreSQL
  • workflow_run event — sends success/failure/cancelled notifications to Matrix room
  • Configurable via FORGEJO_WEBHOOK_SECRET, FORGEJO_ROOM_ID, SERVER_LISTEN_ADDR

Commit storage

  • PostgreSQL table (init.sql) with unique commit deduplication
  • get_today_commits() / has_commits_today() queries

Daily scheduler

  • Background task checks time every 60s, sends commit summary at SCHEDULER_TIME
  • Uses shared send_reminder() logic

Commands

  • /commits — manual commit summary for today
  • /ping — health check with sender name

Templating (askama + pulldown-cmark)

  • Markdown rendered with org.matrix.custom.html format
  • Commits grouped by repository, description in code blocks
  • Workflow notifications with status icons and repo links
  • Link previews disabled per-message

Infrastructure

  • Graceful shutdown via ctrl_c
  • docker-compose.yml for easy deployment
  • Updated README with setup, webhook config, and database init
## Summary Full integration with Forgejo: webhook handling, commit storage, daily reminders, and CI workflow notifications with formatted messages. ## Changes ### Webhook handler (`/webhook/forgejo`) - HMAC-SHA256 signature verification - `push` event — saves commits to PostgreSQL - `workflow_run` event — sends success/failure/cancelled notifications to Matrix room - Configurable via `FORGEJO_WEBHOOK_SECRET`, `FORGEJO_ROOM_ID`, `SERVER_LISTEN_ADDR` ### Commit storage - PostgreSQL table (`init.sql`) with unique commit deduplication - `get_today_commits()` / `has_commits_today()` queries ### Daily scheduler - Background task checks time every 60s, sends commit summary at `SCHEDULER_TIME` - Uses shared `send_reminder()` logic ### Commands - `/commits` — manual commit summary for today - `/ping` — health check with sender name ### Templating (askama + pulldown-cmark) - Markdown rendered with `org.matrix.custom.html` format - Commits grouped by repository, description in code blocks - Workflow notifications with status icons and repo links - Link previews disabled per-message ### Infrastructure - Graceful shutdown via `ctrl_c` - `docker-compose.yml` for easy deployment - Updated README with setup, webhook config, and database init
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geekiot/homelab-bot!2
No description provided.