订阅
订阅是指 Specola 从 URL 下载、并按计划刷新的 Profile。当前的 Core 做不到这一点。 本页说明尝试时会发生什么, 以及现在如何使用别人发布的 Profile。
现状
| 你的操作 | 结果 |
|---|---|
| Profiles 页上的 Add from URL(从 URL 添加) | Core 不提供订阅相关方法。应用提示 This Core does not support URL profiles yet.,不会添加任何内容。 |
| Profile 的 Update now(立即更新)或更新间隔 | 不可用:Core 从不把任何 Profile 列为订阅 |
Profile 里的 [[subscription]] 或 subscriptions | 忽略,并告警 Ignoring configuration field 'subscription' in the minimal build |
[metadata] type = "subscription"、[metadata.subscription](auto-update、update-interval、user-agent)、[metadata] download-via | 不生效:Core 在读取之前就丢弃了整个 [metadata] 表。应用里的订阅设置项保持禁用。 |
控制接口 profile.createSubscriptionProfile、profile.updateSubscriptionProfile、profile.refreshSubscriptionProfile | 在 api/profile.toml 中有定义,但 Core 返回 method not found |
[metadata] name 仍然有用:应用用它作为 Profile 的显示名称。
现在如何使用别人发布的 Profile
从发布者那里下载 Profile 文件。
先通读,再校验:
bashspecola-core --test-config --config /absolute/path/to/team.toml在 Profiles 页点 Import file,再点 Use this profile。
Profile 决定了 Core 的所有路由、DNS 应答和监听。只使用你信任的发布者提供的文件,并看清楚它把什么流量送到哪里。
把自己的改动放进模块
把你自己的规则、节点和 DNS 设置写进一个模块,应用到这个 Profile 上,而不要直接编辑 Profile。 Profile 出了新版本时,你替换文件,模块照样叠加在上面。
手动更新
导入不会覆盖已有的 Profile。要更新,请自己替换 Profiles 目录里的文件,再重新激活 Profile:
bash
# macOS / Linux example
curl -fsSL -o /tmp/team.toml https://config.example.org/team.toml
specola-core --test-config --config /tmp/team.toml \
&& cp /tmp/team.toml ~/.config/specola/profiles/team.toml上面的校验只检查文件本身。激活时会连同模块再检查一次;失败的话,原来运行的 Profile 继续运行。各平台的 Profiles 目录见 快速开始。
替换文件时,team.toml.modules 和 team.toml.disabled-rules 留在原处,所以模块和你关掉的规则仍然生效。 被关闭的规则按文本匹配;如果新版本改动了那条规则,它会重新开启。
