Brings the Flask-era commits (incl. PR #43 video demo) into the port
branch so the PR can merge cleanly. Conflicts resolved in favor of the
FastAPI port: Dockerfile, README.md, requirements.txt, .gitignore
(superset). .dockerignore is a union of both apps' exclusions. The old
Flask app (app.py, templates/, static/, docker-compose.yml, demo.mp4,
pyproject.toml) is kept in the tree for reference.
HyperFrames render (1920x1080 @ 30fps, no audio) of the fastapi-port
pipeline: signed schema.arch -> archllm build -> auto-emitted openapi.json
+ generated client.js -> the generated UI, then four real pastes proved
against the live r3 backend (verbatim CRLF text, 64x64 image, 4,096-byte
file byte-exact, 404 card). All on-screen data is real.
Includes REVIEW.md (check green, 18 frames + seam strips verified).
Spec-first port of the Flask app (still on main):
- schema.arch: signed arch-llm spec (single source of truth)
- paste_bin/: generated FastAPI backend, verified 51/51 frozen owner
tests, 92.5% coverage (build r3, 2026-11-18)
- ui/: SPA + emitted OpenAPI contract (openapi.json + generated
client.js); the app calls only window.PasteBinAPI
- 7 old bugs fixed (file raw 500, silent expiry, AVI-as-webp,
stripped content, limiter leak, trusted mimetype, stale tmp)
- 62/62 live probe green; /health + JSON index added; JSON API
Full report on the wiki: 'FastAPI port (arch-llm pipeline)'.
Use secrets.token_hex for SECRET_KEY (no hardcoded default).
Add CSRF tokens to forms and cookie.
Rate limit uploads: 10 per 60s per IP.
Add security headers: CSP, X-Frame-Options, X-Content-Type-Options, HSTS, Referrer-Policy.
Block SVG uploads (executable JS risk).
Validate image content via magic bytes.
Atomic file creation with O_EXCL (fixes TOCTOU race).
Increase paste ID from 8→16 hex chars.
Run cleanup_expired every 5min in background thread.
Delete .txt files on paste deletion.
Fix file upload tab (missing name attribute).
Docker: add non-root user, pin dependency versions.