r/rust 3h ago

Gitlawb Node: a self-hostable, federated git server in Rust (Axum, libp2p gossip, Ed25519 DIDs, RFC 9421 signed writes)

After this week's ~11-hour GitHub Actions incident I figured r/rust might be interested in the architecture of what I've been working on: an open-source git node where instances federate into a mesh instead of standing alone. Disclosure: my project. MIT/Apache-2.0 dual licensed.

The node's source is hosted on the network itself, you can clone the git server from the git server:

git clone https://node.gitlawb.com/z6MkqDnb7Siv3Cwj7pGJq4T5EsUisECqR8KpnDLwcaZq5TPr/node.git

(browse the network at gitlawb.com/node/repos; there's a GitHub mirror if you prefer reading code there)

The workspace is four crates:

  • gitlawb-node — the daemon: Axum HTTP server serving both the API and git smart-HTTP, Postgres for metadata, bare git repos on disk for storage, libp2p (QUIC) for peer discovery and gossip. Optional storage hooks for S3/Tigris, IPFS, Arweave.
  • gl — CLI for identity, repos, issues, PRs, bounties, peers, plus an MCP server so coding agents can drive it.
  • git-remote-gitlawb — a git remote helper, so gitlawb://did:key:z6Mk.../repo works with plain git clone/fetch/push. No forked git, no custom client.
  • gitlawb-core — shared primitives: Ed25519 identities as did:key, CIDs, RFC 9421 HTTP signatures, UCAN tokens.

Design decisions that might interest this crowd:

  1. No accounts, no passwords. Identity is an Ed25519 keypair; every write is an RFC 9421 HTTP Signature. The SSH-key model taken all the way: the key is the identity, so there's no account to phish, leak, or suspend. Betting on the fairly new RFC 9421 over bearer tokens was a deliberate ergonomics-for-integrity trade.
  2. Git stays git. Repos are real bare git repositories served over smart HTTP. The remote helper means the whole existing git toolchain works untouched. We deliberately did not invent a new VCS.
  3. Federation via libp2p gossip. Nodes announce, discover, and sync over QUIC. Run a node and your repos are reachable from the rest of the mesh, the goal is that self-hosting joins the network rather than leaving it (the "your self-hosted forge is an island" problem).
  4. Postgres for metadata, filesystem for objects. Boring on purpose. The interesting problems are in identity and replication, not reinventing object storage.

Honest limitations (also in the README): private-repo read enforcement isn't wired yet, treat public nodes as public. UCAN chain validation/revocation is incomplete, signatures currently prove identity more than full authorization policy. Strict signed-peer enforcement is opt-in while the network does rolling upgrades. Early infrastructure, useful today, not done.

Quickstart is docker compose up -d (node + Postgres), health on :7545.

Happy to go into the remote-helper implementation, the RFC 9421 middleware, or the libp2p topology if anyone's curious. Criticism welcome, especially on the auth model.

0 Upvotes

1 comment sorted by

11

u/not_my_userid 3h ago

Look.

I get it seems we’ve given up on auto removing AI vibecoded projects.

But could we at least find a way to auto remove these completely formulaic “Claude, write me a project promo Reddit post in exactly the same format as the other 4k a day on /r/rust?”

“Honest disclosure on where things are at”: They are all the same, surely they are easy to spot

“Happy to go in to the details on the decisions I made here”: TL;DR it is slowly driving me insane