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

オープン
#2,726 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
tooling

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

[!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.

主要言語
TypeScript
スター
19.9k
フォーク
2.5k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

danielmiessler/LifeOS のほかの issue

danielmiessler/LifeOS の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。