Files
pangolin/deploy/single-node/seed-node.sql.tmpl
T
wangjia 5d90610649
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
feat(single-node): 改 SQLite + 非特权 pangolin 用户 + 免 Docker(512MB 可跑)
为小内存机收尾单机栈,已在 racknerd(107.172.55.251)实跑验证通过:
- 数据库:MySQL(docker)→ SQLite 文件(DB_DRIVER=sqlite);Redis 改 apt 原生
  (免 Docker);依赖 redis-server/sqlite3/polkitd/sing-box 由 deploy.sh 自动装
- 运行身份:三 systemd 单元 User=root → User=pangolin;sing-box 经
  AmbientCapabilities 绑 443;新增 polkit 规则让 pangolin 仅可重启 sing-box
- 二进制:支持预置(机上无 go 时用交叉编译产物;SQLite 纯 Go 免 CGO)
- 端口:REALITY 默认 443/tcp(对齐 bootstrap 防火墙);deploy.sh 放行 8080/tcp
- 修 sing-box.service:ExecStart 按实际安装路径渲染(官方 .deb 在 /usr/bin)
- Hy2 默认关闭:控制面尚未下发 Hy2 TLS 证书(handler_grpc.go 仅发 ListenPort)
  → 开启会 missing certificate;待补全证书后传 HY2_PORT=443 开启
- 删 docker-compose.yml;seed TRUE→1;README 同步

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 07:46:54 +08:00

29 lines
1.2 KiB
Cheetah

-- Single-node seed: 1 provider + 1 status='up' node, so GET /v1/nodes returns
-- this box and the client can connect to it. Placeholders (__VAR__) are filled
-- by deploy.sh from the generated REALITY keypair + the VPS public IP.
--
-- Idempotent: fixed uuid, delete-then-insert so re-running deploy.sh refreshes
-- the row without duplicating it. The REALITY keys MUST stay stable across
-- re-deploys (deploy.sh persists them in /etc/pangolin/reality.env) or already
-- issued client configs would break.
DELETE FROM nodes WHERE uuid = '__NODE_UUID__';
DELETE FROM providers WHERE name = 'single-node';
INSERT INTO providers (name, api_kind, regions, pool, enabled)
VALUES ('single-node', 'manual', '["__REGION__"]', 'consumable', 1);
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 (
'__NODE_UUID__',
'__REGION__', '__NAME_ZH__', '__NAME_EN__',
'exit', 'free',
'__ENDPOINT__', __HY2_PORT__,
'__REALITY_PBK__', '__REALITY_PRK__', '__REALITY_SHORT_ID__',
'__REALITY_SNI__',
(SELECT id FROM providers WHERE name = 'single-node' LIMIT 1),
'up', 100
);