XP Cluster Manager
XP Cluster Manager 是 self-hosted multi-host Xray cluster manager。README.md 明确每台 host 运行 xp 和 xray 两个进程,xp 用 OpenRaft 保存 cluster-wide desired state,并通过 Xray gRPC API reconcile 本地 runtime。
- Distributed system
- Rust web service
- Embedded admin UI
- React app
- shadcn/ui
- Ops tool
- Dockerized dev
- Storybook component QA
- Service ports
- PR label release
- Release failure notification
目录
技术栈
运行与交付
- CI 工作流
- ci.yml
- label-gate.yml
- notify-release-failure.yml
- release.yml
- xray-e2e.yml
- 能力标记
- bun_lock
- cargo_toml
- dockerfile
- github_actions
- package_json
依赖与工具
- package.json
- 开发依赖
- @commitlint/cli
- @commitlint/config-conventional
- commitlint-plugin-function-rules
- dprint
配置与质量
- 配置文件
- .bun-version
- .dockerignore
- .gitignore
- Cargo.toml
其他信息
- Cargo
- Deps build
- protoc-bin-vendored
- tonic-build
- tonic-prost-build
- 开发依赖
- assert_cmd
- bytes
- http-body-util
- predicates
- Deps main
- anyhow
- argon2
- axum
- base64
{
"cargo": {
"deps_build": [
"protoc-bin-vendored",
"tonic-build",
"tonic-prost-build"
],
"deps_dev": [
"assert_cmd",
"bytes",
"http-body-util",
"predicates",
"pretty_assertions",
"shadowsocks",
"tempfile",
"tokio-stream",
"tower",
"wiremock",
"x509-parser"
],
"deps_main": [
"anyhow",
"argon2",
"axum",
"base64",
"chrono",
"clap",
"crossterm",
"dialoguer",
"flate2",
"futures-util",
"hex",
"hmac",
"libc",
"maxminddb",
"nanoid",
"openraft",
"prost",
"rand",
"ratatui",
"rcgen"
]
},
"ci_workflows": [
"ci.yml",
"label-gate.yml",
"notify-release-failure.yml",
"release.yml",
"xray-e2e.yml"
],
"configs_root": [
".bun-version",
".dockerignore",
".gitignore",
"Cargo.toml",
"dprint.json",
"lefthook.yml",
"package.json",
"rust-toolchain.toml",
"rustfmt.toml"
],
"markers_present": [
"bun_lock",
"cargo_toml",
"dockerfile",
"github_actions",
"package_json"
],
"package_json": {
"deps_dev": [
"@commitlint/cli",
"@commitlint/config-conventional",
"commitlint-plugin-function-rules",
"dprint"
]
}
}Purpose
XP Cluster Manager 是 self-hosted multi-host Xray cluster manager。README.md 明确每台 host 运行 xp 和 xray 两个进程,xp 用 OpenRaft 保存 cluster-wide desired state,并通过 Xray gRPC API reconcile 本地 runtime。它还内置 Vite + React admin UI,构建产物嵌入 Rust binary。
Taxonomy
- Tags: Distributed system, Rust web service, Embedded admin UI, React app, shadcn/ui, Ops tool, Dockerized dev, Storybook component QA, Service ports, PR label release, Release failure notification
- Why / evidence: 这些 tags 来自 checked-out repo 和 catalog record。主要证据包括
README.md、Cargo.toml、Dockerfile、proto/、docs/desgin/subscription.md、docs/desgin/quota.md、web/package.json、web/components.json。Topic token 的大小写以对应技术/工作流的官方写法为准;slug 只作为稳定 ID,不直接充当项目标题。
Repository map
Cargo.toml包含 Axum、OpenRaft、prost、rcgen、ratatui、reqwest 等依赖,说明它同时有 API、Raft、CLI/TUI 和 Xray integration。proto/保存 gRPC/protobuf 边界;src/是服务和 runtime。web/是 React/shadcn/ui admin UI,web/components.json记录radix-novastyle 和 aliases,.storybook/main.ts提供 component QA。Dockerfile构建 web assets、Rust binary,并以 Xray Docker tag 作为 build arg。
Runtime and delivery
Web dev 固定 60080,Storybook 固定 60081,这类默认端口在本地预览时必须用 port lease 管理。Dockerfile 的 XRAY_DOCKER_TAG、BUN_VERSION、XP_BUILD_VERSION 是 release/build contract。服务运行需要管理 Xray inbound/client、subscriptions、quota 和 cluster state。
Architecture notes
核心架构是 OpenRaft desired-state + 本机 Xray reconcile。admin UI 是控制面;subscription output、quota、auto-ban、REALITY/Shadowsocks 配置是用户可见功能。因为是 distributed system,任何单机 API 改动都要考虑 Raft log/state migration 和多 host 一致性。
证据锚点:README.md。
Workflow and quality gates
.github/workflows/ci.yml、xray-e2e.yml、label-gate.yml、release.yml、notify-release-failure.yml 说明 CI、Xray e2e、label release 和失败通知都是交付面。Web 有 Storybook/test/e2e,但没有 accessibility addon 证据,应命名为 component QA。
Reusable decisions
- 把 desired state 放 Raft,把 local runtime 作为 reconcile 结果,是多主机 ops 工具的稳定边界。
- 将 admin UI 嵌入 Rust binary,部署时减少前后端分离复杂度。
- Xray e2e 单独成 workflow,避免普通 CI 掩盖集成风险。
Risks and open questions
- 分布式状态迁移风险高,不能把它当普通 Rust web service。
- 默认端口硬编码需要在 Agent 本地预览时遵守租约。
- Xray 版本和协议配置变化会影响生成的订阅/REALITY。
Evidence index
README.mdCargo.tomlDockerfileproto/docs/desgin/subscription.mddocs/desgin/quota.mdweb/package.jsonweb/components.jsonweb/.storybook/main.ts.github/workflows/ci.yml.github/workflows/xray-e2e.yml.github/workflows/label-gate.yml.github/workflows/release.yml.github/workflows/notify-release-failure.yml
相关内容
Distributed system
主题Distributed system 在这里指“系统行为依赖多节点协同、复制状态或集群控制面”的工程模式,而不是“仓库里有几个服务”这么宽。真正命中这个 Topic 的项目,通常存在 cluster-wide desired state、节点成员关系、复制日志、leader/follower 语义、局部 runtime reconcile 和网络分区后的恢复问题;维护者必须同时考虑单节点局部行为与跨节点一致性(projects/xp.
Dockerized dev
主题Dockerized dev 标记 Dockerfile、Compose 或 container build 是本地开发、集成验证或部署交付的一等路径。它不表示“仓库里偶然有 Dockerfile”,而是 Docker 影响运行环境、数据卷、端口、build args、嵌入式前端产物或 release artifact。
Embedded admin UI
主题Embedded admin UI 表示 operator/admin UI 不是独立部署的前端产品,而是主服务交付物的一部分,通常由同一个 release binary、同一个镜像或同一个部署单元一起提供。这里的重点是交付和边界耦合,而不是框架选型。 这个 Topic 用来回答“控制台为什么要随服务一起发、一起验、一起部署”。
Ops tool
主题Ops tool 表示项目的核心价值在于运维自动化本身:部署、升级、监控、编排、设备管理、触发器或共享工作流,而不是面向终端用户的业务功能。这里的主语是“帮维护者安全地操作系统”,不是“恰好带个管理后台”。 这个 Topic 用来回答一个问题:系统真正的产品是不是一套可复用的操作能力。
PR label release
主题PR label release 是逐 PR 的产品发布协议:PR labels 只提供经过 gate 验证的发布操作与发布阶段;最高的合格 final vX.Y.Z Git release tag 是唯一数字版本基线,VERSION 只锁定 trusted preparation 已决定的精确产品版本。label 不能计算、覆盖或为版本提供 fallback。
React app
主题React app 标记 React 是主要用户界面、管理台、控制台或嵌入式操作面 runtime。这里关心的是 route、component tree、client state、表单流、dashboard 交互和前端构建后的真实运行边界,而不是“项目依赖里有 React”。 这个 Topic 用来回答“用户实际操作的是不是一个 React runtime,以及它在系统里承担什么职责”。
Release failure notification
主题Release failure notification 指一个仓库为所有“预期成功但最终以 failure 结束”的交付 workflow 建立显式、可审查的告警路径。范围包括 release、deploy、CI、Docs Pages 和 required gate,但必须由 checked-in allowlist 声明;成功、skipped、cancelled 和通知 workflow 自身不属于通知条件。
Rust web service
主题Rust web service 表示 Rust binary 承担长期运行的服务职责:提供 HTTP API、proxy、SSE、docs/data service、admin backend 或 ops daemon,并对外暴露稳定的网络、存储和部署边界。这里的关键词不是“Rust”,而是“服务进程”。 这个 Topic 不只是“语言是 Rust”。
Service ports
主题Service ports 表示端口号、bind 地址、dev/prod 暴露方式和多组件端口分工本身就是仓库的稳定 contract。它不是“服务都会有端口”这种空泛事实,而是说端口设计会直接影响本地预览、反向代理、权限边界、自动化脚本和故障排查。 这个 Topic 关注的是端口作为系统边界的那一面。
shadcn/ui
主题shadcn/ui 表示项目采用官方 shadcn/ui 风格的 checked-in component layer:components.json、@/components/ui aliases、Radix primitives、Tailwind utilities、class-variance-authority、tailwind-merge、clsx 和 Lucide icons 共同构成组件约定。
Storybook component QA
主题Storybook component QA 表示仓库把 Storybook 当作组件级文档、状态枚举、视觉检查或 interaction smoke 的稳定入口。它不等同于 Storybook accessibility:只有项目明确引入 a11y addon 或等价 Axe sweep 时,才同时打 accessibility Topic。这个拆分用于避免“只要有 Storybook 就叫 a11y”的误判。