yingjieli-cloudflare-deploy v1.0.0
adapter yingjieli.deploy
capsule://quake0day/yingjieli-cloudflare-deploy@1.0.0
Cloudflare Pages deployment adapter for yingjieliartist.com. Owns the
project name, the KV namespace binding (YL_DATA), the R2 bucket
binding (YL_IMAGES), the CDN cache + security headers, and legacy
URL redirects.
Owns
- site/wrangler.toml (project name, compat date, KV + R2 bindings)
- site/_headers (CDN cache rules, security headers)
- site/_redirects (legacy URL fixes)
- the deploy commands (Wrangler CLI or Cloudflare Dashboard upload)
- the public custom domain mapping (yingjieliartist.com, www.)
Does not own
- any application code (functions and assets belong to their own capsules)
- the ADMIN_PASSWORD / SESSION_SECRET values (configured in Cloudflare dashboard, not in repo)
AI orientation
This capsule is the bridge between the code in this repo and the
Cloudflare Pages runtime. It does not contain logic — it contains
bindings. The two bindings (YL_DATA, YL_IMAGES) are what make the
other capsules' env requirements satisfied at runtime. If the
bindings change, every dependent capsule's `requires.env` section
must change with them.
Avoid
- Committing ADMIN_PASSWORD or SESSION_SECRET to wrangler.toml.
- Renaming bindings without coordinating with dependent capsules.
- Skipping HTTPS (Cloudflare Pages forces it; do not override).
Extension points
cache-headersatsite/_headers- Long-cache /assets/* and /images/*; no-cache HTML. Add new path
patterns above the catch-all. kv-bindingatsite/wrangler.toml- The `binding = "YL_DATA"` name is the contract — any rename
breaks every capsule that imports env.YL_DATA.
Provides
env:YL_DATA— KV namespace binding, id bbed5ce0f0954546bf5c58bd5b8f1f80.env:YL_IMAGES— R2 bucket binding, bucket_name=yl-images.cli:wrangler-deploy— wrangler pages deploy . --project-name yingjieliartist (run from inside site/)
Requires
env:ADMIN_PASSWORD— Set via Cloudflare Pages → Settings → Environment Variables. Required by yingjieli-admin-auth; the deploy adapter only documents that it must be set.env:SESSION_SECRET— HMAC key (>= 32 bytes). Set in the same place as ADMIN_PASSWORD.
Dependencies
Runtime
wrangler>=3cloudflare-pages*
Invariants (must always hold)
- Secrets are never committed to wrangler.toml.
- The binding names YL_DATA and YL_IMAGES are stable; renaming requires a coordinated capsule version bump.
- /assets/* and /images/* responses are immutable cache; HTML is no-cache.
Glossary
binding- a name made available in the Functions runtime as env.<binding>
KV- Cloudflare key-value store; backs the content blob and rate-limit counters
R2- Cloudflare object store; backs uploaded images