Merge branch 'master' into opt/admin-sort-project
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 1m12s
Project CI / AI game creator shell Rust crates (pull_request) Failing after 1m12s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 1m13s
Project CI / AI game creator shell Rust smoke (pull_request) Failing after 1m13s
Project CI / Frontend tests (pull_request) Successful in 3m37s
Project CI / Repository checks (pull_request) Successful in 4m42s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m19s
Project CI / Backend tests (pull_request) Successful in 6m53s
Project CI / Native shell tests (pull_request) Successful in 7m31s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 1m12s
Project CI / AI game creator shell Rust crates (pull_request) Failing after 1m12s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 1m13s
Project CI / AI game creator shell Rust smoke (pull_request) Failing after 1m13s
Project CI / Frontend tests (pull_request) Successful in 3m37s
Project CI / Repository checks (pull_request) Successful in 4m42s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m19s
Project CI / Backend tests (pull_request) Successful in 6m53s
Project CI / Native shell tests (pull_request) Successful in 7m31s
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
- 默认转发 `api-server` 到 `127.0.0.1:8082`。
|
||||
- 默认转发最小 SpacetimeDB 公网路由到 `127.0.0.1:3101`。
|
||||
- 默认静态目录为 `/srv/genarrative/web`,维护开关文件为 `/var/lib/genarrative/maintenance/enabled`。
|
||||
- 清智创游官网独立域名的 `/home/` 静态资源仍由 Nginx 独立 vhost 提供;`/api/*` 必须进入 api-server,不能回退为静态 404。
|
||||
- 静态响应会显式写入 `Cache-Control`:HTML / SPA fallback 默认 `no-cache`,Vite 指纹静态资源默认 `public, max-age=31536000, immutable`,其它静态资源默认 `no-cache`。三档分别由 `GENARRATIVE_PINGORA_GATEWAY_HTML_CACHE_CONTROL`、`GENARRATIVE_PINGORA_GATEWAY_ASSET_CACHE_CONTROL` 和 `GENARRATIVE_PINGORA_GATEWAY_STATIC_CACHE_CONTROL` 覆盖,配置值禁止换行或 NUL,避免响应头注入。静态文件还会按 metadata 写入弱 `ETag`、`Last-Modified` 与 `Accept-Ranges: bytes`,并对 `GET` / `HEAD` 的 `If-None-Match`、`If-Modified-Since` 返回 `304`;单段 `Range: bytes=` 返回 `206 + Content-Range`,越界范围返回 `416 + Content-Range: bytes */<len>`,保持 HTML `no-cache` 下的浏览器协商缓存和 Nginx 直连体验一致。
|
||||
- `/api` 通用路由同时按 `Content-Length` 与实际流式请求体累计字节数执行大小上限,避免客户端省略长度头绕过网关保护。
|
||||
- `GENARRATIVE_PINGORA_GATEWAY_PROBE_TOKEN` 非空时,`/__genarrative_pingora/healthz` 可用同名探针 header 做本机 shadow 健康检查;未带 token 或 token 不匹配时仍返回 404。
|
||||
|
||||
@@ -4,6 +4,25 @@
|
||||
|
||||
主站 Vite 将 `/api/client-downloads` 转发到当前 `runtimeServerTarget`。通过 `npm run dev:api-server` 与 `npm run dev:web` 联调时,先确认运行日志与 `.app/dev-stack.json` 的实际 API 地址,检查 `/healthz`,再从 Vite 同源访问 `/api/client-downloads`;正常应返回 `downloads` 平台列表、`unavailablePlatforms` 和 `Cache-Control: no-store`,不能落入 SPA HTML fallback。渠道 404 表示未发布,单端失败只影响对应平台;公网 OSS 清单没有官网 CORS,浏览器不直接读取该清单。
|
||||
|
||||
### 清智创游官网独立域名路由
|
||||
|
||||
清智创游官网 `tsingnovagames.com` / `www.tsingnovagames.com` 使用独立的 Nginx 配置 `/etc/nginx/conf.d/tsingnova-games.conf`,静态根目录是 `/srv/genarrative/corporate-site-current`;主站模板 `deploy/nginx/genarrative.conf` 不应重复声明这两个域名。官网首页按同源请求 `/api/client-downloads`,因此应在现役官网 HTTPS `server` 中 include `deploy/nginx/snippets/tsingnova-client-downloads.conf`,只代理这个精确路径到 `genarrative_api`,不要把整个 `/api` 交给官网静态站点兜底。
|
||||
|
||||
线上修复或排障后必须确认的是**生效配置**而不是仓库模板:
|
||||
|
||||
```bash
|
||||
sudo nginx -T | grep -n -A45 -B5 'server_name tsingnovagames.com'
|
||||
sudo nginx -t
|
||||
sudo systemctl reload nginx
|
||||
curl -fsS -D ~/data/tmp/tsingnova-client-download.headers \
|
||||
https://tsingnovagames.com/api/client-downloads \
|
||||
-o ~/data/tmp/tsingnova-client-download.json
|
||||
jq . ~/data/tmp/tsingnova-client-download.json
|
||||
grep -i '^cache-control: no-store' ~/data/tmp/tsingnova-client-download.headers
|
||||
```
|
||||
|
||||
验收必须同时满足:接口返回 `200 application/json`,响应包含 `downloads` 与 `unavailablePlatforms`,并带 `Cache-Control: no-store`;`https://tsingnovagames.com/` 仍返回官网首页。若 API 直连 `http://127.0.0.1:8082/api/client-downloads` 是 `200`、官网域名仍是 `404`,说明官网 vhost 没有 include 下载 snippet,不能靠 reload 旧配置解决。
|
||||
|
||||
## 构建回归的隔离与发布文件权限
|
||||
|
||||
Git hook 的临时仓库测试必须清除子进程继承的仓库定位环境(例如 `GIT_DIR`、`GIT_WORK_TREE`、`GIT_INDEX_FILE`);仅设置 `cwd` 不能隔离 Git。回归应从带这些变量的外层仓库运行,验证外层引用、索引与配置不变。临时测试文件必须留在独立目录并清理,不得通过测试生成主仓库提交或覆盖 ESLint、Prettier 配置。修复 lint 配置时保留原有规则、忽略范围与零警告门禁,不以关闭规则代替排障。
|
||||
|
||||
Reference in New Issue
Block a user