clipwright/cloud
juancarlos.cavero 080dd5780b feat(delivery): serve clips from a custom R2 domain, and show download progress
Measured 22-ago-2026 against prod, on one 46 MB / 52 s clip:

  origin -> itself through Traefik   130 MB/s
  origin -> a datacenter client      838 KB/s
  origin -> the author's browser      90 KB/s   (8.5 min for one clip)
  R2 S3 endpoint -> the server        11 MB/s, 206
  R2 S3 endpoint -> that browser      503, every single request

So the API process is not the bottleneck (it serves the file at 130 MB/s while
the box sits at 0.01 MB/s of egress); the long path out of Hetzner is. And the
fix for that, R2, is unreachable from a browser: *.r2.cloudflarestorage.com is
an S3 endpoint, and a presigned GET that curl fetches at 11 MB/s with identical
headers returns 503 to Chrome.

R2_PUBLIC_BASE points presigned_get() at a custom domain bound to the bucket
instead, which serves the same objects through the normal Cloudflare edge.
Unset, everything keeps signing S3 URLs exactly as before, so this is inert
until the domain exists. Switched at that one choke point because every caller
hands the URL to a browser.

The download button streamed nothing to the screen while it buffered tens of MB
into a blob, which on a slow link is minutes of a button that looks dead. It now
reports percentage, which needs Content-Length readable from JS, which needs the
CORS middleware to name it in expose_headers.
2026-08-23 13:49:08 +02:00
..
__init__.py feat(alerts): daily Telegram ops digest 2026-08-18 14:40:55 +02:00
alerts.py fix: reject too-short sources at submit and stop alerts blaming recovered downloads 2026-08-20 22:54:51 +02:00
analytics.py feat(analytics): report job outcomes to OpenPanel, with the user's job index 2026-07-28 21:49:40 +02:00
api_keys.py feat(agents): the pipeline as a platform — API keys, MCP server, webhooks 2026-08-03 22:33:16 +02:00
auth.py fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00
billing.py fix(billing): stop stranding customers whose payment failed 2026-07-25 15:14:15 +02:00
config.py feat(delivery): serve clips from a custom R2 domain, and show download progress 2026-08-23 13:49:08 +02:00
database.py feat: add hosted paid mode (managed keys, Stripe trial, metering) 2026-07-14 13:04:43 +02:00
digest.py fix(digest): harden daily digest after code review 2026-08-18 14:53:31 +02:00
disposable_domains.txt feat(auth): verify email domain MX before sending magic links 2026-08-13 01:03:05 +02:00
disposable_mx.txt fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00
email_policy.py fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00
emails.py fix(emails): stop duplicate expiry warnings and fix the button that 404s 2026-07-27 22:31:04 +02:00
LICENSE fix(cloud): harden paid-mode surface + source-available license for cloud/ 2026-07-16 17:30:12 +02:00
managed_keys.py feat: add hosted paid mode (managed keys, Stripe trial, metering) 2026-07-14 13:04:43 +02:00
metering.py fix(proxy): probe the duration over the static pool, not the per-GB proxy 2026-08-21 22:45:53 +02:00
models.py fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00
oauth.py feat(abuse): abrir free a email normal + bloquear dominios desechables 2026-07-21 00:45:54 +02:00
social_profiles.py feat(social): keep scheduling calendar + add Content calendar button in dashboard 2026-07-16 19:26:51 +02:00
storage.py feat(delivery): serve clips from a custom R2 domain, and show download progress 2026-08-23 13:49:08 +02:00
videos.py perf(dashboard): play clip previews from R2, not from the render box 2026-08-22 19:52:17 +02:00