Docs
Documentation
forgemirror is a small Go service. It receives Forgejo push webhooks and mirrors the pushed repository to one or more public forges. Your Forgejo instance can stay private: the only connection it needs is the outgoing webhook to forgemirror.
How it works
sequenceDiagram
participant F as Forgejo
participant M as forgemirror
participant T as Targets (GitHub, Codeberg, …)
F->>M: POST /webhook (push event, HMAC-signed)
M->>M: verify signature, apply filter
M-->>F: 202 Accepted
M->>F: git clone --mirror
par every target
M->>T: git push --prune (branches + tags)
end
- A push to Forgejo sends a signed webhook to forgemirror.
- forgemirror verifies the HMAC signature and checks the filter rules. It answers immediately, and mirroring runs in the background.
- It clones the repository once into a temporary directory and pushes all branches and tags to every target in parallel. Branches and tags that were deleted on Forgejo are deleted on the targets as well.
- Pushes that arrive while a repository is being mirrored are coalesced into exactly one follow-up run. That run mirrors the latest state, so no push is lost and no work is repeated.
Where to go next
Run forgemirror and mirror the first repository.
Every setting, environment variable and CLI flag.
Connect Forgejo and understand the responses.
Kubernetes with kustomize or Helm, or a container.
Metrics, logs, health checks, shutdown, troubleshooting.
How credentials are handled; verifying releases.
Tooling, conventions, CI/CD and releases.
Last updated on