Ivan's Blog
项目实践

Proxy Broker

Proxy Broker 是 standalone Rust service,用于加载 mihomo subscriptions,按 IP 构建带 probe/geo metadata 的代理池,按选择的 IP 开关本地 proxy listener sessions,并从同一 binary 提供 Bun-built operator web console。README.

  • shadcn/ui
  • Storybook accessibility
  • GitHub Actions scheduling

目录

技术栈

运行与交付

CI 工作流
  • ci-main.yml
  • ci-pr.yml
  • label-gate.yml
  • notify-release-failure.yml
  • release.yml
能力标记
  • cargo_toml
  • dockerfile
  • github_actions
JSON

Purpose

Proxy Broker 是 standalone Rust service,用于加载 mihomo subscriptions,按 IP 构建带 probe/geo metadata 的代理池,按选择的 IP 开关本地 proxy listener sessions,并从同一 binary 提供 Bun-built operator web console。README.md 明确它默认绑定 loopback,保护 API 需要 Forward Auth identity headers 和 owner-scoped API keys。

Taxonomy

  • Tags: shadcn/ui, Storybook accessibility, GitHub Actions scheduling

Repository map

  • Cargo.toml 是 Rust service manifest,build.rs 和 web/dist 嵌入把前端打包进后端 binary。
  • web/ 是 React/Vite/shadcn/ui 控制台,web/components.json、@storybook/addon-a11y、Playwright config 和 verify-stories 脚本都在这里。
  • Dockerfile 与 .dockerignore 是 container delivery 证据。
  • docs/ 和 deploy/ 保存部署/运维配置。

Runtime and delivery

服务默认 host/session listener 都在 loopback;Web dev 明确端口 38181/38182/38183,Storybook/preview/e2e 均有 strict local ports。SQLite 用于 session/config/audit 类低运维持久层。Dockerfile 支撑单 artifact 部署。

Architecture notes

核心边界是“subscription ingestion -> IP pool/probe metadata -> listener session -> embedded admin console”。Forward Auth 和 owner API key 是 human admin access 的安全层;React UI 不能绕过后端授权。shadcn/ui 组件层服务于 operator console,不是独立设计系统。

证据锚点:README.md。

Workflow and quality gates

ci-main.yml、ci-pr.yml、label-gate.yml、release.yml、notify-release-failure.yml 构成 release path。Web 子项目还要求 verify:stories、test-storybook、Playwright e2e 和 Biome/typecheck。Storybook a11y 证据来自 @storybook/addon-a11y 和 .storybook/main.ts。

.github/workflows/ci-pr.yml 的 edited metadata 重验复用可取消的 per-PR concurrency group;它属于 GitHub Actions scheduling 的后续同步对象,当前 snapshot 只记录证据,不预设修复 YAML。

Reusable decisions

  • 本地安全默认值用 loopback binding,公开部署交给反向代理/Forward Auth。
  • 嵌入式 admin UI 与 Rust binary 一起发布,减少部署组件数量。
  • Storybook 既做组件覆盖,也做 a11y sweep,适合 shadcn/ui 操作台。

Risks and open questions

  • 代理 listener 暴露地址是安全边界,修改 default bind 必须谨慎。
  • subscription/probe metadata 可能包含敏感信息,日志和 UI 展示要审查。
  • Docker + embedded UI release 需要同时验证前端 build 与 Rust build。

Evidence index

  • README.md
  • Cargo.toml
  • build.rs
  • Dockerfile
  • web/package.json
  • web/components.json
  • web/.storybook/main.ts
  • web/playwright.config.ts
  • web/scripts/verify-stories.ts
  • docs/
  • deploy/
  • .github/workflows/label-gate.yml
  • .github/workflows/release.yml
  • .github/workflows/notify-release-failure.yml