Kalandra can be used to mirror multiple Git repositories across different locations in an efficient manner without having to keep a full copy of any of the repositories.
All changes in Git are kept as objects (commits, tags, trees, etc.). Branches and tags are just references to objects. The Git Protocol allows for discovering what objects are present on the given server. It also allows to negotiate the minimal set of objects (or deltas of objects) that need to be transferred to synchronize with the server.
The naive approach to mirroring a Git repository is:
# First time
git clone --mirror upstream
# Every X minutes
git fetch --prune upstream
git push --mirror downstream
This works fine most of the time, but requires that you maintain a local copy the repository that you are mirroring.
What Kalandra does instead, is to that it acts as a broker between the two servers. No data is persisted by the running service. We negotiate the minimal pack needed to syncronize the mirror with upstream and then only transfer the pack.
Completed features:
- support for
file://
targets. - basic support for
ssh://
targets using AsyncSSH. - support for
http://
targets. - GitHub App token authentication for HTTP
Planned features (in order of priority):
- add "sync-to-github" command which updates a mirror on GitHub based on metadata configured in GH custom properties
- package as OCI image.
- optimize use of capabilities like
ofs-delta
.
TBD
Copyright (c) 2024-2025 Łukasz Rekucki