Files
blog/docs/上线检查单.md
wait4xandGLM-5.3 22930cfffd feat(seo): robots.txt 与 SEO 解封操作单(blog-5f T1)
robots 404 补齐(Allow 全站/Disallow admin+draft/Sitemap 行);
操作单三步走:nginx snippet 剥 noindex+内部 vhost 补回+admin 局部
保留、ESA purge+TTL+绕缓存、curl 三验证——用户侧执行入口。

验证: T1 verify 命令全过(robots 三断言+操作单节存在)

Spec: 2026-10-26_blog-5f

Co-authored-by: GLM-5.3
2026-11-01 09:06:54 +08:00

64 lines
3.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 上线检查单(Phase 4 → 用户执行部分)
> 全部工程准备已完成(spec: 2026-10-25_add-blog-launch)。以下是上线动作与顺序,全程可秒级回滚。
## 前置确认(已由 preflight.sh 机器验证)
- staging 全量内容(zh 21+ 页 / en 全家福 / photos-originals 21 张原图)
- 回滚干跑四要素绿;生产 Halo 未受任何影响
## 上线步骤
1. `sudo loginctl enable-linger wait4x`(一次性:让 webhook 接收器开机自启)
2. `sudo bash infra/deploy/launch.sh --dry-run`(过一遍计划)
3. `sudo bash infra/deploy/launch.sh --exec`(切换 + 自动 nginx -t + reload)
4. 浏览器验证(手机+桌面各一轮):
- `https://wait4x.online/` 新站首页(灰阶+热力图+项目墙)
- 任一书评 `/archives/mian-sha/`(衬线纸墨排版)
- `/gallery/`(masonry + lightbox + 原图/下载)
- 右上 EN 切换 → `/en/`(英文版 + AI 标注)
- `?` 键盘帮助 / `~` 搜索 / Ctrl+K(若 T1 已合)
- 评论区可见(Artalk)
5. ESA 控制台刷新 `wait4x.online` 缓存(或等 TTL;HTML 建议规则短缓存)
6. ICP 页脚核对:陕ICP备2026014860号-1(zh/en 页都在)
## 回滚(任何不满意时)
```bash
sudo bash infra/deploy/rollback.sh --exec # 秒级回 Halo
```
静态目录与 Halo 互不干扰,可反复切换。
## 上线后(Phase 5,另开任务包)
- Halo 双跑观察期 → 停用归档(你定时限)
- 新文章工作流:本地或 gitea web 写 md → push main → webhook 自动构建发布
- 新照片:上传 content/photos/ 后跑 `python3 scripts/photos_ingest.py` 再 commit
- 翻译:新文章 push 后跑 `python3 scripts/translate/translate_posts.py`(幂等)
---
## SEO 解封操作单(Phase 5f T1,2026-10-26 立案)
**背景**:生产全站自上线起带 `X-Robots-Tag: noindex`(/etc/nginx/snippets/esa-origin-ssl.conf:11 共享片段误伤博客 vhost)+ robots.txt 404 + ESA 将带 noindex 的响应头缓存 30 天——搜索引擎全站不可见。
**第一步:nginx(需 sudo)**
1. 编辑 `/etc/nginx/snippets/esa-origin-ssl.conf`:删除第 11 行 `add_header X-Robots-Tag noindex always;`(改前备份 .bak)
2. 给确实需要 noindex 的内部服务 vhost(api/oj/token/fc/latex/cpa/git)各 server 块补回该行
3. 博客 vhost 补局部:`location /admin/ { add_header X-Robots-Tag noindex always; }`
4. `sudo nginx -t && sudo systemctl reload nginx`
**第二步:ESA 控制台(不做则 noindex 再活 30 天)**
1. 全站 purge `wait4x.online`
2. HTML 边缘 TTL 调 ≤1h(当前 2592000s,靠回源重验证更新——头会固化)
3. 加规则:`/artalk/api/*` 绕过缓存(GET stats 有 Age 头实锤,pv 数字会冻)
**第三步:验证**
```bash
curl -sI https://wait4x.online/ | grep -ci x-robots-tag # 期望 0
curl -s https://wait4x.online/robots.txt | head -3 # 期望 User-agent + Sitemap
curl -sI https://wait4x.online/admin/ | grep -ci noindex # 期望 1(局部保留)
```
仓库侧已就绪:public/robots.txt(本提交);生产 Lighthouse SEO≥95 复测随后入档。