返回资讯中心
外部精选
软件工程
#开发者实时流

Yumak:无需守护进程、基于 ATProto 联邦的 Git 前端

来源标题:Yumak: Hyperfast, daemonless Git front end that federates over ATProto

Yumak 是一个无需守护进程即可运行的 Git 前端,并通过 ATProto 实现联邦。该项目用 Rust 编写(占代码 98%),附带 Nix 配置和 firehose 等模块。

Hacker News 最新nerdypepper2026/11/17 · 今天13 分钟阅读

以下正文由 AI 翻译自 Hacker News 最新(原文版权归原站所有),可能存在偏差,重要内容请以原文为准。

把一团乱麻分叉出来,无需守护进程即可运行 / .config/ 11月5日 ">bench/ 11月10日 benches/ 11月7日 ">docs/ 9月20日 ">firehose/ 11月8日 ">nix/ 11月10日 scripts/ 11月11日 src/ 11月16日 tests/ 11月11日 ">vendor/core/ 11月9日 " data-kind="file">.gitignore 11月9日 " data-kind="file">Cargo.lock 11月10日 " data-kind="file">Cargo.toml 11月10日 " data-kind="file">flake.lock 9月18日 " data-kind="file">flake.nix 11月10日 " data-kind="file">knot-static.toml.example 11月9日 " data-kind="file">LICENSE 11月8日 " data-kind="file">README.md 11月8日 语言 Rust 98% Nix 1% Shell 1% CSS <1% JavaScript <1% refs 1 main e3631dc 11月16日 ≡ yumak readmetickets …commitssettings new hr]:m-0 [&>hr]:mb-1 [&>hr]:h-px [&>hr]:min-h-px [&>hr]:border-0 [&>hr]:bg-(--y-border) svelte-x6k6te" role="menu" tabindex="-1" style="position-anchor: --dropdown-new-menu; transform: translateX(px)"> new repository hr]:m-0 [&>hr]:mb-1 [&>hr]:h-px [&>hr]:min-h-px [&>hr]:border-0 [&>hr]:bg-(--y-border) svelte-x6k6te" role="menu" tabindex="-1" style="position-anchor: --dropdown-profile-menu; transform: translateX(px)"> sign in sign in yumak(土耳其语意为“毛线球”)是一团乱麻,读取路径上没有守护进程。yumak 只在有变更时运行,把你的 git 仓库和 atproto 记录编译成不可变文件,由 nginx 直接从磁盘提供服务。 git.klbr.net 运行 yumak 并托管本仓库 (did:plc:amxsvho4opuwe53msnkbwa5j,位于 tangled 上的 tangled.org/ptr.pet/yumak)。 在 git.klbr.net 本机上托管 linux 内核(torvalds/linux:一个 6.5 GB 的 pack 中有 12.0M 个对象, 953 个 ref):4 个 amd epyc genoa vcpu、7.9 GB 内存、btrfs。测量于 2026-11-06,yumak 限制在 4 GB 且无 swap,nice 19 并设置较低的 cpu 和 io 权重,与该机器的其他服务 (一个 pds、knot2、navidrome、metrics、logs、bun server 等)并行运行。 请注意这里的内存是峰值匿名内存,其余内存使用取决于 有多少数据经过 page cache,对于内核这样的大仓库这一点影响更大。 nix profile add git+https://git.klbr.net/did:plc:amxsvho4opuwe53msnkbwa5j 或者用 cargo 构建(cargo build --release)。主机需要 git、一个 用 pcre jit 构建的 nginx,以及 fcgiwrap。为获得最佳性能(以及大仓库上的磁盘 占用),把 <output.root> 放在支持 reflink 的文件系统上 (btrfs、xfs 或 apfs)。 把 knot-static.toml.example 复制为 knot-static.toml 并填写。--config 或 KNOT_STATIC_CONFIG 指向 另一个路径。用于密封 sealed_key_file 的主密钥来自 KNOT_MASTER_KEY(32 字节的 base64),或来自 secrets.master_key_env 指定的变量。 注意:即使关闭 [writes] 也需要 fcgiwrap。 把 ssh 用户的 authorized_keys 指向一个 wrapper,它导出 KNOT_MASTER_KEY 并运行 knot-static --config /etc/knot-static/config.toml git-ssh "$@"。你自己在那里添加的 密钥属于操作员,可以推送到任何地方。git-ssh 在没有 --operator 或 --actor 时拒绝 运行,所以这样的密钥会这样写: command="/etc/knot-static/git-ssh --operator",restrict ssh-ed25519 AAAA... 通过 ssh 的 fetch 会得到与 nginx 提供的相同的固定回复,而这些需要 git 协议 v2。git 2.26+ 和 gix 通过 GIT_PROTOCOL 请求它,而 sshd 只有在 AcceptEnv GIT_PROTOCOL 时才会传递。 对于协作者,sshd 向 knot-static keys list 询问他们的密钥。keys sync 将它们读入 <output.root>/ssh-keys.json,而推送或授权 会读取它尚未见过的账户。每个密钥都被强制以 --command 运行, 并加上 --actor DID: Match User op AuthorizedKeysCommand /etc/knot-static/keys-list AuthorizedKeysCommandUser op /etc/knot-static/keys-list 是一个脚本,运行 knot-static --config /etc/knot-static/config.toml keys list --command /etc/knot-static/git-ssh。 如果除 root 以外任何人都能写入该脚本或其上层目录,sshd 会 拒绝该命令,这就排除了 /nix/store。在 nixos 上,用 environment.etc.<name>.mode 把它复制出来。 knot-static init 创建 meta 仓库和 knot 签名密钥 knot-static generate 构建新的一代(--repo 重建单个仓库) knot-static activate 将 active.conf 切换到某一代并重新加载 knot-static gc 删除旧代和未引用的数据 knot-static maintenance repack、bitmap 并 prune 托管的仓库 knot-static repo 创建、导入、重命名和配置仓库 knot-static issue / pull / label 管理 issue、pull request 和 label knot-static oauth 登录 pds 以发布仓库声明 knot-static keys sync 为 sshd 同步协作者的 ssh 密钥 knot-static plc 重试待处理的 plc genesis 操作 knot-static git-ssh / cgi sshd 的 ForceCommand 和 fcgiwrap 入口点 运行 knot-static <command> --help 查看任意子命令的选项。 cargo nextest run # 默认测试集 NGINX_BINARY=$(command -v nginx) cargo nextest run --run-ignored all 第二行会加上需要真实 nginx 的测试(不用 nextest 则是 cargo test -- --include-ignored)。 .config/nextest.toml 关闭了重试,因此不稳定的测试会让本次运行失败。 这要感谢 LLM!感谢 opus / sonnet 5.5、gemini 4 argon、gemini 3.8 flash、gpt 6.1 sol! 感谢 tangled,特别是 @oyster.cafe 带来的超棒 knot2 :3 毛线球 favicon 是参照 twemoji 的 🧶 重新绘制的(原版由 twitter, inc. 及贡献者以 cc-by 4.0 授权)。

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →