feat: finish Douyin production readiness flow
This commit is contained in:
@@ -75,6 +75,10 @@ curl --fail --silent --show-error \
|
||||
--retry 30 --retry-delay 2 --retry-connrefused \
|
||||
--output /dev/null "http://127.0.0.1:${CREATORHUB_PORT}/healthz"
|
||||
|
||||
curl --fail --silent --show-error \
|
||||
--retry 30 --retry-delay 2 --retry-connrefused \
|
||||
--output /dev/null "http://127.0.0.1:${CREATORHUB_PORT}/readyz"
|
||||
|
||||
curl --fail --silent --show-error \
|
||||
--retry 30 --retry-delay 2 --retry-connrefused \
|
||||
--user "${CONTROL_PLANE_USERNAME}:${CONTROL_PLANE_PASSWORD}" \
|
||||
@@ -287,10 +291,28 @@ Compose 部署时通常只需设置以下宿主机变量:
|
||||
| `docker-gateway` | `DOCKER_SOCKET` | 默认值和 Compose 挂载均固定为 `/var/run/docker.sock`;不能只覆盖环境变量 |
|
||||
| `docker-gateway` | `BROWSER_NETWORK` | `creatorhub_browser` |
|
||||
| `docker-gateway` | `GATEWAY_TOKEN` | 与平台注册值一致,长度 ≥16;`/v1` 全部接口校验 Bearer 令牌 |
|
||||
| `docker-gateway` | `BROWSER_CDP_URL` | 空;仅本地联调时连接外部 CDP,例如 `http://host.docker.internal:9222` |
|
||||
| `docker-gateway` | `BROWSER_CDP_TARGET_ID` | 空;外部 CDP 多页面时必须指定抖音页面 ID |
|
||||
| `docker-gateway` | `LOG_LEVEL` | 默认 `info` |
|
||||
|
||||
不要把凭据写入仓库或 Compose 文件。
|
||||
|
||||
### 本地 9222 CDP 联调
|
||||
|
||||
网关支持显式连接已经登录的本地 CDP,不创建或回收 Docker 浏览器。仅用于开发和真实平台链路测试,不应在生产 Compose 中设置。先从 `http://127.0.0.1:9222/json/list` 选择唯一的抖音页面 `id`,再在宿主机启动网关:
|
||||
|
||||
```bash
|
||||
export LISTEN_ADDR=127.0.0.1:18081
|
||||
export GATEWAY_TOKEN=0123456789abcdef
|
||||
export BROWSER_CDP_URL=http://127.0.0.1:9222
|
||||
export BROWSER_CDP_TARGET_ID=<已登录抖音页面的 target id>
|
||||
export BROWSER_CDP_ALIAS=local-cdp
|
||||
export BROWSER_CDP_NETWORK_ID=local-cdp
|
||||
python3 -m cmd.docker_gateway.gateway
|
||||
```
|
||||
|
||||
该模式的 generation 固定为 `binding_version=1`、`runtime_id=64 个 0`、`network_id=local-cdp`。生命周期接口明确不可用于此浏览器;身份、受限读取、事件订阅和动作接口仍要求完整 generation,并继续执行 UID 核对。`BROWSER_CDP_TARGET_ID` 必须固定到抖音页面,不能把包含多个网站的 CDP 页面列表交给自动猜测。
|
||||
|
||||
### P0-lite 停机通知
|
||||
|
||||
当前只使用 `creator-hub` 的专用 Logrus JSON logger 作为通知渠道;它固定输出警告,不继承业务 `LOG_LEVEL`。选择它是因为 Compose 已可靠收集服务日志,不需要新增外部账号、凭据、网络重试或通知依赖。仅 `policy_hold` 和 `needs_confirmation` 会产生 `operator attention required`,字段限定为 `event_type`、`reason_code`、账号/任务 ID;不会包含请求头、Secret 引用或凭据值。运维可用下列命令接入现有日志采集或人工查看:
|
||||
|
||||
Reference in New Issue
Block a user