Imported from vectorstone/dotfiles (
singbox/.config/sing-box/AGENTS.md). Install upstream withnpx skills add vectorstone/dotfiles --skill sing-box. Copyright stays with the author.
AGENTS.md
sing-box 配置仓库(macOS)。
参考资料
- 本地笔记:
/Users/wangxiaoguang/Documents/Obsidian/GavinObsidian/wiki/learning/sing-box(11 篇,从配置总纲、DNS 分流、路由规则集到部署排错,优先查阅) - 官方文档:https://sing-box.sagernet.org/configuration/
仓库文件布局
.
├── config.json # 主配置,sing-box 实际加载的文件
├── config-structure.json # 顶层字段结构参考
├── config-structure-demo.json # 与上一个内容完全相同
├── rulesets/
│ ├── geosite-cn.srs # 本地规则集,被 route.rule_set 引用
│ ├── cache.db # cache_file 落盘位置(config 实际引用)
│ └── scache.db
├── cache.db
├── sing-box.log # log.output,追加写入
└── ui/ # MetaCubeXD 面板静态文件(clash_api.external_ui)
├── config.js # 面板后端地址等前端配置
├── index.html
├── _nuxt/ _fonts/ # 面板构建产物
└── CNAME sw.js ... # PWA / 图标等
要点:
config.json顶层为log/dns/inbounds/outbounds/route/experimental; 入站是tun-in+mixed-in,route.rules6 条。- 运行时路径全部写在 config 里且是绝对路径:
cache_file→rulesets/cache.db,clash_api面板监听127.0.0.1:9096,external_ui→ui/。 - 根目录
cache.db与rulesets/scache.db当前未被 config 引用(仍已入库)。 sing-box.log由log.output追加写入且无轮转,注意体积增长。- 仓库没有
.gitignore,上述运行时产物(cache.db、sing-box.log)都会被 git 跟踪。