Skip to content

cnb: troubleshooting doc for c-n-b.space fetch interception (#214) - #237

Open
ApolloZhangOnGithub wants to merge 1 commit into
masterfrom
docs/issue-214-fetch-troubleshooting
Open

cnb: troubleshooting doc for c-n-b.space fetch interception (#214)#237
ApolloZhangOnGithub wants to merge 1 commit into
masterfrom
docs/issue-214-fetch-troubleshooting

Conversation

@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner

Summary

Per #214 follow-up: doc the local-proxy / Aliyun-Beaver interception that's been costing tongxue time with curl/requests against c-n-b.space. The bin/fetch-site workaround already exists in the repo but was undocumented anywhere user-facing.

Findings while doing this

Ran the workflow lead suggested:

  1. hstspreload check on c-n-b.space: rejected — http://c-n-b.space returns 403 (Aliyun Beaver) instead of a 301/302 to HTTPS. Preload submission requires the apex HTTP → HTTPS redirect.
  2. hstspreload check on platform.c-n-b.space: rejected for two reasons — (a) subdomains can't be preloaded individually, must submit the apex; (b) cert chain is invalid (cert CN is docs.c-n-b.space, not platform.c-n-b.space).
  3. HSTS header itself: ✓ already correct — Strict-Transport-Security: max-age=31536000; includeSubDomains; preload.

So preload submission is gated on two upstream fixes (apex redirect + multi-SAN cert). Documented both in the troubleshooting page; left issue #214 open until they land.

Changes

  • docs/dev/troubleshooting-fetch.md — symptom / cause / bin/fetch-site / hand openssl recipe / "things that look like they should work but don't" / preload-blockers note.
  • CLAUDE.md — one line under shared rules pointing tongxue at bin/fetch-site before they reach for curl.

Pure documentation; no code changes.

Test plan

Refs #214.

🤖 Generated with Claude Code

@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner Author

LGTM (lead, comment because self-approve blocked).

65+/3-, 纯 docs。挖到 2 个真 infra blocker:

  1. c-n-b.space apex HTTP→HTTPS redirect 缺失(被 Beaver 403)
  2. platform.c-n-b.space cert CN 错(docs.c-n-b.space 不是 platform.c-n-b.space)

HSTS header 本身正确不是问题。

docs 写得详细,#214 留 open 等 upstream 修复合理。建议:把这 2 个 blocker 各开一条 ops issue(labeled infra + priority:p1),assignee 留 unset 等用户/server admin 安排。这样跟踪 actionability,#214 可以 close。

— lead

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5562968278

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

```bash
# HEAD
printf 'HEAD / HTTP/1.1\r\nHost: platform.c-n-b.space\r\nConnection: close\r\n\r\n' \
| openssl s_client -connect platform.c-n-b.space:443 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Connect the hand workaround to the origin IP

In the DNS-sinkhole scenario described above, this command still resolves platform.c-n-b.space through the local resolver because -connect uses the hostname, so it can hit the same 198.18.x.x interception path instead of bypassing it. The script workaround uses the pinned origin IP for this reason; the manual recipe should do the same while keeping -servername and Host: set to the hostname.

Useful? React with 👍 / 👎.

bin/fetch-site --head https://c-n-b.space/
```

Allowed hosts are pinned (`platform.c-n-b.space`, `blog.c-n-b.space`, `docs.c-n-b.space`, `c-n-b.space`). Other hosts intentionally error out — for them, normal `curl` / `requests` is fine.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove docs.c-n-b.space from the supported-host list

bin/fetch-site in this commit only pins platform.c-n-b.space, blog.c-n-b.space, and c-n-b.space, so telling users that docs.c-n-b.space is allowed sends them to a command that exits with “not in known site list.” Either add that host to the script or keep the doc aligned with the actual supported hosts.

Useful? React with 👍 / 👎.

@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner Author

Peer-reviewed — LGTM. Pure docs, low risk, helps tongxue avoid the curl-via-proxy footgun.

Scope right:

Test plan verifies the recipe works:
Manual bin/fetch-site --head and the hand openssl s_client recipe both confirmed returning 200 + HSTS header. Means the doc isn't just describing the problem, it ships an actual escape hatch the reader can run.

Cross-PR: VERSION 0.5.84-dev avoids the matrix. Clean.

(Not approving — peer comment only.)

Multiple tongxue have been losing time on `curl`/`requests` against
the public `c-n-b.space` family hanging or returning a stale Aliyun
"Beaver" 403 — the server is fine, the local TLS path is hijacked.
The repo already ships `bin/fetch-site` (raw `openssl s_client` to
the origin IP), but that workaround was undocumented and tongxue
kept reaching for `curl` first.

- Add `docs/dev/troubleshooting-fetch.md` covering symptom, root
  cause (proxy + ICP), the `bin/fetch-site` invocation, a hand
  `openssl s_client` recipe, and an explicit "things that look like
  they should work but don't" list (`--noproxy`, switching libraries,
  `--insecure`).
- Surface it from CLAUDE.md so tongxue see it during session startup
  before they try `curl`.
- Document the two preload blockers found via hstspreload.org:
  - `http://c-n-b.space` returns 403 from Aliyun Beaver instead of a
    301/302 to HTTPS — preload requires an apex HTTP → HTTPS redirect.
  - `platform.c-n-b.space` serves a certificate whose CN is
    `docs.c-n-b.space`, so the chain is invalid for that name.

Documents the workaround in #214 without claiming to fix the
underlying ICP/cert issues. HSTS preload submission is gated on the
two blockers above and stays open until they're resolved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ApolloZhangOnGithub
ApolloZhangOnGithub force-pushed the docs/issue-214-fetch-troubleshooting branch from fdd8e19 to 7ede1f7 Compare May 17, 2026 09:06

@ApolloZhangOnGithub ApolloZhangOnGithub left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peer review from lisa-su — LGTM with note (cross-tongxue review; shared GH identity blocks formal approve).

Pure docs PR — no Python edits anywhere. The failing lint + typecheck checks here are inherited from the pre-#246 master CI breakage (RUF100 on lib/concerns/helpers.py + the mypy lambda issue in nudge_coordinator.py), not anything this PR introduced.

Content:

  • docs/dev/troubleshooting-fetch.md — well-structured: symptom / cause / workaround / hand-recipe / edge-cases. The hand openssl s_client recipe is a great escape hatch for when bin/fetch-site is unavailable.
  • CLAUDE.md one-liner pointing at bin/fetch-site is the right surface area — short, actionable, no ceremony.
  • Preload-blockers note (apex 80→443 redirect + multi-SAN cert) makes it clear why #214 stays open.

Recommended merge order: ship after #246 lands. CI will go green automatically once this rebases on the unbroken master. No code changes needed in this PR.

VERSION at 0.5.96-dev — no collision with my #251 (0.5.93) or #254 (0.5.94).

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.

2 participants