Render the legacy-forwarding server list from the CR #15

Closed
opened 2026-07-28 12:22:04 +09:00 by FLYEMOJ1 · 1 comment
FLYEMOJ1 commented 2026-07-28 12:22:04 +09:00 (Migrated from github.com)

问题

哪些后端走 legacy forwarding,这个列表写死在 bootstrap 生成的 systemd 单元里,不是从 CR 渲染的。加一台 1.8 后端就得手改 bootstrap 并重装 Velocity 的 systemd 单元。

证据

Identified by Claude Opus 5 (claude-opus-5) while auditing how the fork learns which backends are legacy, on 2026-07-28.

deploy/bootstrap.sh:1596:

local legacy_forwarding_servers="legacy18"

:1608 把它拼进 ExecStart:-Dfelis.legacy-forwarding.servers=${legacy_forwarding_servers}。

验收

给一台 MinecraftServer CR 打上标记(label 或 spec 字段)之后,Velocity 的 legacy-forwarding 列表能收敛到包含它,不需要手改 bootstrap。

备注

有一个看着像 bug 其实不是的现象,查这条的时候别被带偏:legacy18 的 CR 上没有对应的 label,所以 operator 的 init-forwarding initContainer 照样会往它的数据目录里写一份 0666 的转发密钥。那份密钥对一台跑 legacy forwarding 的后端毫无作用 —— 它读都不读。功能上无害,只是多了个没人用的文件。真正的问题是上面那条:列表和 CR 之间没有连接。

## 问题 哪些后端走 legacy forwarding,这个列表写死在 bootstrap 生成的 systemd 单元里,不是从 CR 渲染的。加一台 1.8 后端就得手改 bootstrap 并重装 Velocity 的 systemd 单元。 ## 证据 Identified by Claude Opus 5 (claude-opus-5) while auditing how the fork learns which backends are legacy, on 2026-07-28. `deploy/bootstrap.sh:1596`: ```sh local legacy_forwarding_servers="legacy18" ``` `:1608` 把它拼进 ExecStart:`-Dfelis.legacy-forwarding.servers=${legacy_forwarding_servers}`。 ## 验收 给一台 MinecraftServer CR 打上标记(label 或 spec 字段)之后,Velocity 的 legacy-forwarding 列表能收敛到包含它,不需要手改 bootstrap。 ## 备注 有一个看着像 bug 其实不是的现象,查这条的时候别被带偏:`legacy18` 的 CR 上没有对应的 label,所以 operator 的 `init-forwarding` initContainer 照样会往它的数据目录里写一份 0666 的转发密钥。那份密钥对一台跑 legacy forwarding 的后端毫无作用 —— 它读都不读。功能上无害,只是多了个没人用的文件。真正的问题是上面那条:列表和 CR 之间没有连接。
Lemon-miaow commented 2026-09-26 09:10:27 +09:00 (Migrated from github.com)

5099b25(Felis)+ FelisMC/Felis-Legacy e00df63 落地。

  • CR 打 felis.lolicon.best/forwarding=legacy 标签即标记为 legacy 转发。用标签而非 spec 字段:CRD 不用改,operator 不把 CR 标签拷到 pod 上所以不会重启服务器,felis-api 不写它所以只能在集群上 kubectl 打。
  • felis-api 的内部 GET /servers 带 legacyForwarding,felis-link 每次刷新把被标记的服务器并入 felis.legacy-forwarding.servers;安装时的 FELIS_LEGACY_FORWARDING_SERVERS 是下限,始终保留。
  • Fork 新增 patch 0004:每次后端连接重读该属性(原 0003 只在首次连接时解析一次)。插件按反射识别代理版本:带 0004 即时生效;只有 0003 时提示需重启;原版 Velocity 给出警告并点名服务器。
  • 测试:LegacyForwardingTest(34 checks,10 个变异体全部杀死)、ServerListSourceTest 保存/解析标记、TestServerListCarriesLegacyForwarding、fork 侧 FelisLegacyForwardingTest(Mockito,设置→清空→再设置序列)。

VM 实测(b109,fork 带 0004):

08:07:48 Felis: legacy forwarding list is now [legacy18,resolvecheck] (added [resolvecheck], removed []).
08:09:18 Felis: legacy forwarding list is now [legacy18] (added [], removed [resolvecheck]).

打标签 12 秒后生效,摘标签后回退。运维步骤见 docs/operations.md「Legacy-forwarded backends」。

生产现有的 fork 只带 0003,部署带 0004 的构建之前,标签变更要重启 felis-velocity 才生效(日志会以 warning 说明)。

5099b25(Felis)+ FelisMC/Felis-Legacy e00df63 落地。 - CR 打 `felis.lolicon.best/forwarding=legacy` 标签即标记为 legacy 转发。用标签而非 spec 字段:CRD 不用改,operator 不把 CR 标签拷到 pod 上所以不会重启服务器,felis-api 不写它所以只能在集群上 kubectl 打。 - felis-api 的内部 `GET /servers` 带 `legacyForwarding`,felis-link 每次刷新把被标记的服务器并入 `felis.legacy-forwarding.servers`;安装时的 `FELIS_LEGACY_FORWARDING_SERVERS` 是下限,始终保留。 - Fork 新增 patch 0004:每次后端连接重读该属性(原 0003 只在首次连接时解析一次)。插件按反射识别代理版本:带 0004 即时生效;只有 0003 时提示需重启;原版 Velocity 给出警告并点名服务器。 - 测试:`LegacyForwardingTest`(34 checks,10 个变异体全部杀死)、`ServerListSourceTest` 保存/解析标记、`TestServerListCarriesLegacyForwarding`、fork 侧 `FelisLegacyForwardingTest`(Mockito,设置→清空→再设置序列)。 VM 实测(b109,fork 带 0004): ``` 08:07:48 Felis: legacy forwarding list is now [legacy18,resolvecheck] (added [resolvecheck], removed []). 08:09:18 Felis: legacy forwarding list is now [legacy18] (added [], removed [resolvecheck]). ``` 打标签 12 秒后生效,摘标签后回退。运维步骤见 docs/operations.md「Legacy-forwarded backends」。 生产现有的 fork 只带 0003,部署带 0004 的构建之前,标签变更要重启 felis-velocity 才生效(日志会以 warning 说明)。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: FelisMC/Felis#15