三个小型 Rust CLI 工具,用于照看 Linux 开发机器: 一个让你的 git 仓库保持提交和备份,一个防止你的磁盘 和内存崩溃,还有一个阻止密钥落入 你的 git 历史。它们以普通用户级 systemd 服务运行—— 无需 root。
| 工具 | 它解决的问题 | 一句话说明 |
|---|---|---|
dracon-sync | “我整天编辑文件却从未提交。” | 监视你的仓库,用确定性消息自动提交更改,推送到 GitHub/GitLab/任意位置 |
dracon-system | “我的磁盘在构建中途满了,一切都卡死了。” | 防范磁盘和内存压力,清理已知的空间占用大户,诊断存储问题 |
dracon-warden | “我差点把 API 密钥推送到 GitHub。” | 透明地加密形似密钥的文件(age),使其在 git 中静态存储时安全,但在你的编辑器中为明文 |
这里的一切都是按路径组织的单个 Cargo 工作区:在仓库
根目录运行 cargo test --workspace --locked 会构建并测试全部三个工具(2026-10-10 为 2347 个测试;0 失败,25 忽略)。三个工具目录
是嵌套的独立 git 仓库(自
2026-09-11 起拥有自己的 .git/、历史、远程和标签——父仓库仅跟踪元文件),因此仅克隆父仓库
无法构建;请将工具仓库克隆到其旁边(参见 CONTRIBUTING 的 Setup)。
git clone https://github.com/DraconDev/dracon-utilities.git
cd dracon-utilities
# nested utility repos (see CONTRIBUTING for the clone list)
git clone https://github.com/DraconDev/dracon-sync-background-auto-commit-multi-remote.git dracon-sync
git clone https://github.com/DraconDev/dracon-system-disk-process-guard-doctor.git dracon-system
git clone https://github.com/DraconDev/dracon-warden-secret-encrypt-age-git-filter.git dracon-warden
cargo build --release --locked
./target/release/dracon-system doctor # health check of this machine
./target/release/dracon-sync status # what sync would watch
./install.sh # binaries -> ~/.local/bin
systemctl --user enable --now dracon-sync.service # background auto-commit
systemctl --user enable --now dracon-system-guard.service # background guard
./uninstall.sh # remove binaries and services (configs kept unless --purge)
`install.sh` stops the services while it works, refreshes the user
service units from the repo, installs the warden git hooks globally,
and restarts the services afterwards (see `./install.sh --help`;
`--no-restart` and `--binaries-only` opt out of parts of this).
dracon-warden 不是一个服务——安装后,运行一次
dracon-warden setup-hooks --global 来启用其 git 钩子,然后运行
dracon-warden keygen 来创建本机的 age 密钥对。
随后每个工具都会从 ~/.dracon/utilities/ 读取各自的 TOML 配置
(示例随每个工具的目录一同提供)。任何被 git 跟踪的内容都不会
存在于仓库树之外;状态存放在 ~/.dracon/ 和
~/.local/state/dracon/。
dracon-sync你只管工作,它负责提交。给它指定监视根目录(比如 ~/Dev),它就会
发现其下的每一个 git 仓库,等待编辑稳定下来,
用基于差异的确定性消息进行提交,并推送到 origin
以及任何已配置的镜像。它会将推送失败分类
(STUCK/BLOCKED/BROKEN),而不是无声地无限重试,并且
会标记从磁盘上消失的仓库。
dracon-sync daemon # continuous loop (what the service runs)
dracon-sync repos # live report of every watched repo
dracon-sync sync-now ~/Dev/my-project
dracon-sync health
dracon-system针对机器本身的看门狗。当磁盘或内存压力越过警告/严重阈值时,它可以清理可再生的垃圾(构建目录、缓存),降低内存占用大户的优先级,让你的桌面保持响应,并让内核的 out-of-memory killer 偏向真正的罪魁祸首。它还提供一次性诊断:存储热点、符号链接管理、zram 状态。
dracon-system doctor # deterministic diagnostics pass
dracon-system storage ~/Dev # where did my disk go?
dracon-system guard clean # reclaim space (dry-run first)
dracon-system guard daemon # continuous monitoring (the service)
dracon-warden基于 Git filter 的加密,使用 age。
匹配密钥模式(.env、*.key 等)的文件在提交时加密、在检出时解密,因此工作区保持正常状态,而远程仓库仅保存密文。全局钩子通过扫描每次推送中形似密钥的内容并阻止有风险的推送来提供额外保障。
dracon-warden keygen # machine age keypair
dracon-warden setup-hooks --global
dracon-warden status # what's protected on this machine
dracon-utilities/
├── dracon-sync/ # auto-commit multi-remote git sync daemon
├── dracon-system/ # disk/process guard, storage & diagnostics
├── dracon-warden/ # age-based git secret encryption (hooks + CLI)
│ └── src/security/ # embedded dracon-security crate
├── .github/workflows/ci.yml # lint / test / release-build / deny / nix
├── flake.nix # optional Nix build path
├── scripts/ # release, checks, audit tooling
└── AGENTS.md # policies for agents/operators working here
export DRACON_SYNC_GIT_BIN=/run/current-system/sw/bin/git # NixOS only
cargo test --workspace --locked
cargo clippy --workspace --locked -- -D warnings
cargo deny check
nix flake check # optional
按工具构建:cargo build --release --locked -p dracon-{sync,system,warden}。
最新组件版本:dracon-sync 0.113.95 · dracon-system 0.112.44 ·
dracon-warden 0.113.15 — 参见
Releases。
工具发布版本在嵌套仓库中打标签(dracon-sync-vX.Y.Z 等);
每个工具的详细信息位于各自目录的 CHANGELOG.md 中,父级
CHANGELOG.md 是冻结的历史记录。
历史说明:每个工具最初都位于各自的仓库中 (
DraconDev/dracon-sync-background-auto-commit-multi-remote、...-disk-process-guard-doctor、...-secret-encrypt-age-git-filter)。 开发工作在这些相同仓库的嵌套独立检出中进行, 这些检出克隆在本元仓库旁边(父仓库不跟踪任何工具源代码)。
docs/ROADMAP.md 是唯一的文档地图 — 从那里开始了解安装、运维、贡献、安全和 版本历史。持久性设计调查单独索引于 docs/README.md(设计索引)。
AGPL-3.0-only — 详情参见 LICENSE。