capsule AI-native Unix-like composition layer

yingjieli-image-store v1.0.0

subsystem yingjieli.site

capsule://quake0day/yingjieli-image-store@1.0.0

Stores and serves artwork images for yingjieliartist.com. Uploads land
in Cloudflare R2 (binding YL_IMAGES); reads go through a small Workers
Cache layer with long-immutable cache headers and ETag support.

Owns

Does not own

AI orientation

Images live in R2; their primary URL is /api/img/<key>. Keys are
generated server-side from the sanitized base name + a timestamp +
4 random chars, so the client cannot dictate the final key. The
Workers Cache API is used as a hot layer in front of R2 — never
cache responses behind a session or an Authorization header.

Avoid

Extension points

allowed-content-types at site/functions/api/upload.js:ALLOWED_TYPES
Set of MIME types accepted by POST /api/upload. If you add a
format, also extend pickExt() so the file gets the right extension.
max-upload-bytes at site/functions/api/upload.js:MAX_BYTES
Hard upper bound on a single upload. Increase only if R2 + Workers
request-body limits still hold.

Provides

Requires

Dependencies

Capsules

Runtime

Invariants (must always hold)

Glossary

key
the R2 object key, also the last path segment under /api/img/
pre-resize
the admin UI shrinks images client-side before POSTing
immutable
keys never change content, so Cache-Control max-age=1y immutable

Source

https://github.com/quake0day/yingjieli/blob/main/capsules/image-store/capsule.yaml

Pull this capsule locally:

capsule pull capsule://quake0day/yingjieli-image-store@1.0.0

Or render to your terminal:

capsule man capsule://quake0day/yingjieli-image-store@1.0.0