客户端埋点复用已有下载渠道配置
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
删除独立埋点 origin 环境变量及配置字段,按 dev/release 渠道校验官方站点。 本地开发、测试及容器的 dev 渠道允许规范回环地址,兼容可变端口。 同步环境变量示例、技术方案和运维说明,补充渠道隔离与身份校验测试。
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# 客户端本地埋点与主站入库契约
|
||||
|
||||
Version: 0.31
|
||||
Version: 0.32
|
||||
Status: 本地采集及上传、入库、成功清理、后台查询已实现并完成本地隔离环境验收;未部署生产
|
||||
Date: 2026-09-21
|
||||
需求来源:[Game Agent 埋点设计原始方案](./【需求来源】GameAgent埋点设计原始方案-2026-09-05.md);原始方案与后续已确认决策有差异时,以本文为准。
|
||||
@@ -609,9 +609,9 @@ session.json 是本地恢复元数据,不是待上传事件;事件文件不
|
||||
|
||||
- 一次请求只发一个已封存批次,1 至 500 条。事件数据沿用 1 MiB 上限,JSON 请求体上限 2 MiB,容纳数组及 envelope 开销;服务端不依赖 Content-Length 自报大小。
|
||||
- 批次与所有事件的 user_id 必须相同且等于鉴权主体;匿名、未知 origin 批次不上传,不补认领到后来登录的账号。
|
||||
- destination_origin 必须匹配当前服务部署的可信公开 origin 配置,不使用未经信任的 Host 头作为判据。
|
||||
- 接收端配置 `GENARRATIVE_AGC_ANALYTICS_ORIGIN` 为规范 origin(无路径和尾部斜杠):正式站 `https://www.genarrative.world`,测试站 `https://dev.genarrative.world`,本地联调填写客户端实际连接的 loopback origin。未配置/非法配置时接口返回 503,不猜测默认站点;允许 HTTPS 和本地 loopback HTTP。
|
||||
- 该变量在 API Server 运行时注入,修改后重启服务;客户端与管理后台无需新增埋点构建变量。配置示例见根目录 `.env.example`(本地默认 `http://127.0.0.1:8082`)、`deploy/env/api-server.env.example`(release,并注明 dev 值)与 `deploy/container/api-server.env.example`(compose 默认宿主机入口 `http://127.0.0.1:18080`)。实际端口、映射或域名变化时同步修改,始终与客户端登录地址一致。
|
||||
- 接收端复用 API Server 已有的 `GENARRATIVE_CLIENT_DOWNLOAD_CHANNEL`,不再单独配置埋点 origin:`dev` 只对应 `https://dev.genarrative.world`,`release` 只对应 `https://www.genarrative.world`;渠道未设置时沿用现有默认 `dev`,空值或其它渠道返回 503。destination_origin 与渠道不匹配时返回 403,不使用客户端请求的 Host / Forwarded 头推断部署渠道。
|
||||
- 本地联调例外:仅 `dev` 渠道且已有 `GENARRATIVE_ENV` 为 `development`(现有默认)、`test` 或 `container` 时,额外接受规范的 HTTP(S) loopback origin(localhost、IPv4/IPv6 回环地址,无路径、查询串、凭据或尾部斜杠)。端口可变以兼容本地漂移和容器映射;服务端不再按本地端口区分实例,客户端仍按精确登录 origin 与 user_id 隔离批次。`production` 环境或 `release` 渠道均不接受此例外。
|
||||
- 渠道与环境在 API Server 运行时读取,修改后重启服务;客户端与管理后台无需新增埋点构建变量。配置示例见根目录 `.env.example`(本地 dev)、`deploy/env/api-server.env.example`(release,dev 部署改为 dev)与 `deploy/container/api-server.env.example`(container + dev)。
|
||||
- 复用现有事件版本、枚举、字段长度与必填 nullable 校验;批内重复 event_id、未知字段或非法事件整批拒绝。
|
||||
- 本接口不进入普通成功路由 tracking 映射,不为每次上传另生成主站产品事件。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user