Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

check

alias: c

校验配置而不构建:解析完整配置(thurgio.yaml + 全部 sibling YAML)后打印摘要与逐项检查结果。不访问网络、不写任何文件,适合放在 CI 或 cron 中做配置回归检查。

参数

无专属参数。支持全局参数 -c/--config-r/--root

输出内容

✅ Configuration is valid

  Summary:
    Providers:  2
    Snippets:   1
    Outputs:    3
    Tokens:     2 configured
    Address:    0.0.0.0
    Port:       10100
    Ttl:   provider=600s, snippet=86400s
    Provider 'example': OK (https://example.com/sub)
    Provider 'local': OK (file: prov/example.yaml)
检查项说明
Summaryprovider / snippet / 具名输出数量、令牌总数、监听地址/端口、TTL
Provider 来源URL 源检查 http(s):// 前缀格式;本地文件源检查文件是否存在
规则引用provider 的 pre_rename / filter / rename 规则名是否在 filter.yaml / rename.yaml 中定义
输出目录所有配置输出路径的父目录是否存在

WARNING 类型

解析期未知规则名会被静默忽略(不参与管线),check 把它们以 WARNING 形式报告出来:

Provider 'example' filter rule 'us': WARNING (not defined in filter.yaml)
Provider 'example' pre_rename rule 'typo_name': WARNING (not defined in rename.yaml)
Provider 'local': WARNING (file not found: prov/example.yaml)
Output directory 'output/proxies.yaml': WARNING (parent directory does not exist)
  • URL 格式异常 — 来源不是 http:// / https:// 开头却被当作 URL 解析。
  • 文件不存在 — 本地文件源指向的路径不存在。
  • 规则未定义 — 引用的规则名在对应表中不存在(最常见的静默失效来源)。
  • 输出父目录不存在 — 构建时写入会失败。

WARNING 不影响退出码(配置仍视为有效),但通常意味着运行时行为与预期不符。

示例

# 校验当前目录配置
thurgio check

# 校验指定配置
thurgio -c /etc/thurgio/thurgio.yaml check