2.9 KiB
2.9 KiB
SelfMedia 运维入口
管理员凭据分发
- 在 owner-only
/root/.unidesk/.env/selfmedia-access.env中维护以下键:SELFMEDIA_ADMIN_USERNAME;SELFMEDIA_ADMIN_PASSWORD;SELFMEDIA_API_KEY;SELFMEDIA_SESSION_SECRET。
- 不用
cat、source、env、Pod env 或 Secret decode 检查值。 - 先预检 sourceRef、键和 fingerprint:
bun scripts/cli.ts secrets plan --config config/secrets-distribution.yaml --scope selfmedia --target selfmedia-nc01
- 提交异步同步作业:
bun scripts/cli.ts secrets sync --config config/secrets-distribution.yaml --scope selfmedia --target selfmedia-nc01 --confirm
- 使用返回的 job ID 查询,直到终态:
bun scripts/cli.ts job status <job-id> --tail-bytes 12000
-
confirmed sync 默认只返回 source/Secret fingerprint、键和 rollout 摘要;只有一次性下钻时才使用
--full,不得让默认输出因超限隐藏 ready 证据。 -
再核对目标 Secret 的键存在性:
bun scripts/cli.ts secrets status --config config/secrets-distribution.yaml --scope selfmedia --target selfmedia-nc01
consumerRollout是凭据生效合同:selfmediaDeployment 通过 SecretsubPath挂载凭据;- 后端在启动时加载管理员凭据和 session secret;
sync必须按 YAML 重启消费者,并通过多次短连接轮询等待 ready;- 总等待时限和轮询间隔分别由
timeoutSeconds、pollIntervalSeconds声明; - 只更新 Secret 而没有成功 rollout 时,不得声称新账号已生效。
自动交付观察
- SelfMedia PaC consumer 为
selfmedia-nc01:
bun scripts/cli.ts platform-infra pipelines-as-code status --target NC01 --consumer selfmedia-nc01
bun scripts/cli.ts platform-infra pipelines-as-code history --target NC01 --consumer selfmedia-nc01 --limit 10
- 只有失败归因时才按具体 PipelineRun 下钻:
bun scripts/cli.ts platform-infra pipelines-as-code debug-step --target NC01 --consumer selfmedia-nc01 --id <pipeline-run-id>
- 正常发布只由
pikainc/selfmedia的 GitHub PR merge 触发,不执行 bootstrap、apply、trigger-current、mirror sync、人工 PipelineRun 或 Argo refresh/sync。
公网原入口验收
- 从
config/selfmedia.yaml#delivery.targets.NC01.deployment读取公网 host、端口和健康路径,不在脚本中复制配置值。 - 无凭据检查:
/返回200;/healthz返回200;/api/v1/system返回401;/api/v1/terminal/status返回401。
- 使用 owner 提供的新账号完成浏览器登录;不得把账号密码写入命令历史、截图、报告、issue 或日志。
- 登录后核对 WebTerm 打开、Codex session resume、统一 CLI 请求和流水线 job 状态;不使用终端访问 Kubernetes、Docker socket、ServiceAccount token 或宿主路径。