Skip to content

chore(deploy): 同步 Caddyfile.tmpl 与生产实际配置 - #204

Closed
FatNine wants to merge 1 commit into
v0.1-dev/hackforgerfrom
chore/sync-caddyfile-from-prod
Closed

chore(deploy): 同步 Caddyfile.tmpl 与生产实际配置#204
FatNine wants to merge 1 commit into
v0.1-dev/hackforgerfrom
chore/sync-caddyfile-from-prod

Conversation

@FatNine

@FatNine FatNine commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

目的

deploy/ecs/caddy/Caddyfile.tmpl 与华为生产 /etc/caddy/Caddyfile 已漂移两处——都已在生产生效但未回写模板,未来用 ecs-bootstrap.sh 重建/换机时会静默丢失:

  1. /xuedoushan/ 静态落地页块(handle_path + file_server)——历史手工上线,未回写;
  2. 2026-08-21 爬虫 archive 拦截——对百度渲染 bot(固定 Chrome/83.0.4103.106 UA)和 meta-externalagent*/archive/* 请求返 403。背景:这两类爬虫无视 robots.txt(默认规则已 disallow archive/bundle),为每个爬到的 commit sha 铸造 .bundle 压缩包,两周产生 34G repo-archive,是天翼云冷备磁盘事故的根因之一(详见私有运维仓库 addendum:2026-08-20-ctyun-replica-retention-and-payload-fix)。

变更性质

  • 模板与生产文件逐字节一致(仅 __ACME_EMAIL__ 占位符替换回 ops@synnovator.com);
  • 无运行时变更:生产已经在跑这份配置,此 PR 只是把现实回写进版本控制;
  • 不触发部署,无需 smoke report(非用户面变更,只是部署模板与现实对齐)。

验证

diff <(sed 还原占位符后的模板) <(生产 /etc/caddy/Caddyfile) 为空。

🤖 Generated with Claude Code

The template had drifted from /etc/caddy/Caddyfile on the Huawei ECS in
two ways — both are live on prod but were missing from the template, so
any future reprovision would silently drop them:

1. the /xuedoushan/ static landing-page block (handle_path + file_server)
2. the 2026-08-21 crawler-archive block: 403 */archive/* for the Baidu
   render bot (fixed Chrome/83.0.4103.106 UA) and meta-externalagent,
   which ignore robots.txt and were minting .bundle archives for every
   crawled commit sha (34G in two weeks under data/repo-archive)

Template is byte-identical to the production file except the
__ACME_EMAIL__ placeholder. No runtime change: prod already runs this
exact config.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@FatNine
FatNine requested a review from a team as a code owner August 21, 2026 15:17
@FatNine

FatNine commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

改为在私有运维仓库维护生产 Caddyfile(生产专属配置不入公共仓库),关闭本 PR。

@FatNine FatNine closed this Aug 21, 2026
@FatNine
FatNine deleted the chore/sync-caddyfile-from-prod branch August 21, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant