Patch routes git hosting webhooks and upstream feed signals to notifications and flow dispatch.
Find a file
2026-05-15 23:00:31 +00:00
.forgejo/workflows Rename Patchbay service to Patch 2026-05-15 17:02:05 +00:00
src foo 2026-05-15 23:00:31 +00:00
test foo 2026-05-15 23:00:31 +00:00
.gitignore foo 2026-05-15 23:00:31 +00:00
bun.lock Use shared flow client for Patch dispatch 2026-05-15 20:44:41 +00:00
Dockerfile Add upstream feed watcher 2026-05-12 22:37:26 +00:00
feed-sources.json Rename Patchbay service to Patch 2026-05-15 17:02:05 +00:00
forgejo-forking-problem-space.md Track Forgejo fork problem space notes 2026-05-12 23:20:42 +00:00
package.json Use shared flow client for Patch dispatch 2026-05-15 20:44:41 +00:00
README.md foo 2026-05-15 23:00:31 +00:00
tsconfig.json Initial git webhooks service 2026-05-12 21:06:22 +00:00

patch

Containerized Bun service for upstream feed watching and flow dispatch.

Canonical public host: https://patch.moi.

Endpoints

GET  /healthz
GET  /flow-events
GET  /flow-events/:id
POST /flow-events/:id/retry
POST /flow-events/:id/replay
GET  /flow-dispatches

Environment

HOST=0.0.0.0
PORT=3000
DATA_DIR=/app/data
DISCORD_OUTPUT_ENABLED=false
DISCORD_WEBHOOK_URL=
DISCORD_NOTIFY_EVENTS=push,release
FEED_SOURCES_PATH=./feed-sources.json
PATCH_FLOW_DISPATCH_URL=
PATCH_FLOW_DISPATCH_SECRET=
PATCH_ADMIN_TOKEN=

Discord notifications are off by default. Set DISCORD_OUTPUT_ENABLED=true and DISCORD_WEBHOOK_URL to send Discord output. DISCORD_NOTIFY_EVENTS is a comma-separated allow list and defaults to push,release.

Development

bun install
bun run check
bun run dev

Feed watcher events are configured in feed-sources.json. The first poll primes DATA_DIR/feed-state.json; later polls append upstream activity to DATA_DIR/feed-events.jsonl. Targets using mode: "fork_sync" append legacy work to DATA_DIR/feed-jobs.jsonl. Targets using mode: "flow_dispatch" append generic flow events to DATA_DIR/flow-events.jsonl, POST them to the configured dispatch URL, and record dispatch outcomes in DATA_DIR/flow-dispatches.jsonl.