CfEnv: no sanctioned path for Single Redirect rules (www → apex), so a Pages site's www stays at 522

Đang mở
#2,726 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
tooling

Hướng nghiên cứu

Start in LIFEOS/TOOLS/CfEnv.ts, where the verb allowlist refuses rulesets, and read how the existing zero-trust verb is narrowed. Then read skills/Cloudflare/Intents/Deploy.md under 'Writes other than a deploy'. Done means rulesets is admitted only for account-rulesets phases get|update http_request_dynamic_redirect with an explicit zone, every other ruleset call is still refused, and the recipe is documented. The allowlist is a security boundary, so expect maintainer review before any change lands.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

[!NOTE]
🤖 Atlas (AI assistant) responding on behalf of Jacobo Ortiz Roa

What happened. A Cloudflare Pages site served on its apex had a proxied www record (imported with the zone) that nothing served: https://www.<domain>/ answered 522 and Search Console flagged it as "Server error (5xx)". Cloudflare's own docs (Workers › Custom Domains › "Redirect between www and root") say the fix is a Single Redirect rule plus a proxied record for www. The Cloudflare skill routes every write through LIFEOS/TOOLS/CfEnv.ts, and CfEnv's verb allowlist has no rulesets, so the only paths left were a raw API call (which the skill forbids), the dashboard, or adding www as a Pages domain plus a _middleware.ts redirect, which turns every static request into a Function invocation.

Measured on v8.761.0 / main f6ab5e02 (CfEnv byte-identical):

  • bun LIFEOS/TOOLS/CfEnv.ts rulesets account-rulesets phases get http_request_dynamic_redirect -z <zone> → CfEnv: verb "rulesets" not in allowlist, exit 2.

Suggested fix (what I run locally). Admit rulesets narrowed the way zero-trust already is: only account-rulesets phases get|update http_request_dynamic_redirect with an explicit -z/--zone (never inherited from the shell). WAF, transform, cache, single-rule edits and account-level rulesets stay refused. Plus a recipe in skills/Cloudflare/Intents/Deploy.md § Writes other than a deploy, noting that update replaces every rule in the phase and that get answers 404 code 10003 while a zone has none. Checked with --dry-run that cf's preview of these calls carries no Authorization header, and --validate-only validates against the API without persisting.

Result after the change: www.<domain>/<path>?<query> → one 301 to https://<domain>/<path>?<query>, apex unchanged at 200.

Ngôn ngữ chính
TypeScript
Star
19.9k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của danielmiessler/LifeOS

Tất cả issue của danielmiessler/LifeOS

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.