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

Aperta
#2,726 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
19.9k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di danielmiessler/LifeOS

Tutte le issue di danielmiessler/LifeOS

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.