objgit README

The project's README from github.com/tigrisdata/objgit. As one markdown file: README.md.

objgit

An experiment in storing git repositories in object storage. You probably don't need this. This is a proof of concept and doesn't really have a lot of uses yet.

This is heavily vibe coded as an exploration of the design space. See the claude plans folder for an idea of the kinds of things that were being explored and why. If this experiment ends up being shippable, a better implementation will be made to replace this terrible code.

License: MIT

Price: Free as in mattress. If you use this, it's your problem.

Notable features

Design tradeoffs

Future goals

Setup instructions

objgit depends on the following things:

Prepare your .env file

objgit takes its configuration via flags, environment variables, and .env files in this order of precedence:

Here is a sample .env file:

# Use the AWS credential chain to load Tigris credentials
AWS_PROFILE=tigris

# If true, allow the execution of post-receive hooks
ALLOW_HOOKS=true
# Hook timeout in go time.Duration format
HOOK_TIMEOUT=60s

# If true, allow anonymous pushes
ALLOW_PUSH=true

# The Tigris bucket that all repos are stored in,
# as well as the SSH host key
BUCKET=xe-git-repos

# Per-protocol bindhosts
GIT_BIND=:9418
HTTP_BIND=:8080
SSH_BIND=:2222

# Pushes that unpack a packfile at the same time. This is what bounds
# memory under concurrent pushes: each one costs roughly 400 MiB of
# resident set for a large repository. 0 disables the limit.
MAX_CONCURRENT_PUSHES=4
# How long a push waits for a slot before it fails,
# in go time.Duration format
PUSH_QUEUE_TIMEOUT=2m

# Prometheus metrics
METRICS_BIND=:9090

# Logging detail level
SLOG_LEVEL=INFO

Run the program

go run ./cmd/objgitd

Push a repo

$ git push ssh://localhost:2222/xeiaso.net/objgit.git
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 32 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 2.80 KiB | 2.80 MiB/s, done.
Total 9 (delta 5), reused 0 (delta 0), pack-reused 0 (from 0)
remote: push to xeiaso.net/objgit.git refs/heads/main: a300ea49df20ad5dc82fc4dabb85fbd3261faed7 -> 3d889908eefd60d9a11605f077b7b4560aef8e74
remote: top-level contents:
remote: CLAUDE.md
remote: LICENSE
remote: README.md
remote: cmd
remote: docs
remote: go.mod
remote: go.sum
remote: internal
remote: go module: tangled.org/xeiaso.net/objgit
remote: manifest (/tmp/manifest.txt):
remote: ref refs/heads/main
remote: sha 3d889908eefd60d9a11605f077b7b4560aef8e74
remote: hook done
To ssh://localhost:2222/xeiaso.net/objgit.git
   a300ea4..3d88990  main -> main

Deployment to production

TODO(Xe): re-evaluate performance-based life choices and write.

objgit (tigrisdata/objgit)

Searching Database…

141 ·GitHub
这是什么?objgit 是一个实验项目:一个把代码仓库保存在对象存储(Tigris)里而不是本地磁盘上的 Git 服务器。作者称它只是一个概念验证,你目前大概还用不上。
它是一套新的版本控制系统,还是一个托管普通 Git 仓库的服务器?它是一个服务器,不是新的版本控制系统——仓库仍然是普通的 Git 仓库,以 bare repo(裸仓库)格式存放在存储桶里,并通过 ssh、http 和 git 协议对外提供访问。
我要怎么把它跑起来?先注册一个 Tigris 账号,创建存储桶和一对访问密钥,把配置写进 .env 文件(环境变量的优先级高于 .env 文件,而 .env 文件又高于命令行参数),然后运行程序并推送一个仓库即可。
我可以把它指向任何 S3 兼容的存储桶吗,还是必须用 Tigris?必须用 Tigris:整个核心流程依赖 Tigris 的 RenameObject 调用,而这并不在标准 S3 API 之列。此外你还需要一台能运行 Go 的系统、磁盘上的 TLS 证书颁发机构,以及 IPv4/IPv6 网络栈。
那我真正想放心用它之前,还缺哪些东西?缺的还不少:它完全没有身份验证,读取操作会整个缓存在内存里(理论上文件大小上限为 2Gi),对象存储的延迟也比本地磁盘高,而且作者自己也说它非常新、几乎没经过什么测试。
作者为什么要做这个,而不是直接搭一个普通的 Git 服务器?README 里说这个项目大量由 vibe coding 完成——算是对设计空间的一次探索,claude plans 文件夹记录了当时探索了什么以及为什么。如果这个实验被证明可以做成产品,将会用更好的实现来替换现在的代码。
后续计划里都有什么?未来的目标包括:集成 Tekton 来支持 CI 流水线,基于 Xe Design System 构建网页界面,部署到 Kubernetes,支持带 TLS 终止的 HTTPS,以及写一篇博客文章。
它有提供监控指标吗?有,开箱即用地内置了基础的 Prometheus 指标。
What are similar projects?minio, thanos, git-ai, walgithub, walgit, kubo, crab, sftpgo
Creator
tigrisdata
Size
1.5 MB
Stars
141
Age
4mo
Commits · 90 Days