feat: 档2 接真后端 — mac app 真注册/登录/拉节点

dev 本机置备(新增 dev/):
- docker-compose.yml: MySQL :13306 + Redis :16379(避让本机已占的 3306/6379)
- run-local.sh 一键: 起容器→openssl 生成密钥(dev/.local gitignore)→migrate→
  seed→启动 server :18080(避让 8080);LogMailer 把验证码打日志
- seed.sql(1 provider + 1 HK 节点)、run-local.md 手册、.gitignore

后端两处修复(本地无 gRPC 场景,注释意图与代码不符的 bug):
- main.go: 无 gRPC 时真正构造 Hub-only nodeSvc(原只建 hub 没赋值),/v1/nodes 才能挂
- main.go: /me 改 Route 子路由根 Get,修 Get("/me")+Route("/me") 冲突致 404

客户端接真后端:
- token_store: MacOsOptions(useDataProtectionKeyChain:false) 修 keychain -34018
- auth_screen: 删 dev 旁路(test 账户内存登录),所有登录走真 API

验收: 后端 curl 端到端全通(验证码→注册→登录→/nodes→/me);
server go build/vet/test 通过, client analyze 0 + test 84

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-16 13:27:58 +08:00
parent fe16f89bc3
commit 6979411c1d
9 changed files with 175 additions and 31 deletions
+22
View File
@@ -0,0 +1,22 @@
-- 本地开发 seed1 provider + 1 个 status='up' 节点,供 GET /v1/nodes 返回。
-- 幂等:固定 uuid,重跑先删后插。endpoint/reality_* 为占位(档 2 不真连,档 3 再指真实数据面)。
DELETE FROM nodes WHERE uuid = '11111111-1111-1111-1111-111111111111';
DELETE FROM providers WHERE name = 'dev-local';
INSERT INTO providers (name, api_kind, regions, pool, enabled)
VALUES ('dev-local', 'manual', '["HK"]', 'consumable', TRUE);
INSERT INTO nodes
(uuid, region, name_zh, name_en, role, tier, endpoint, hy2_port,
reality_pbk, reality_prk, reality_short_id, reality_sni, provider_id, status, weight)
VALUES (
'11111111-1111-1111-1111-111111111111',
'HK', '香港 · 测试', 'Hong Kong (dev)',
'exit', 'free',
'127.0.0.1:11443', 443,
'devPlaceholderRealityPublicKey00000000000000', '', '6eb28f1a',
'www.apple.com',
(SELECT id FROM providers WHERE name = 'dev-local' LIMIT 1),
'up', 100
);