- New projects table (job_id, metadata_r2_key, state JSONB) — created via create_all
- archive_job also uploads the metadata JSON (transcript) and upserts the
Project row + user_videos (no more duplicate rows on re-archive)
- archive_clip_edit re-archives a clip after each server-side edit, keeping
only the pristine original + current version per clip in R2
- fix /api/edit: persist new video_url in job result + metadata.json (the
other edit endpoints already did)
- POST /api/projects/{job_id}/restore re-hydrates R2 files into output/{job_id}
(per-job lock, temp-dir download, .owner sidecar, idempotent fast path)
- GET /api/projects + PUT /api/projects/{job_id}/state (debounced Remotion
layer sync from the frontend)
- History tab groups clips by project with a reopen button; App restores
jobId/results/project state; ResultCard seeds serverVideoFile/activeLayers
from the restored state and reports changes upward
Through the dev proxy the backend sees Host backend:8000, so url_for built
redirect_uri=https://backend:8000/... which Google rejects with 400
invalid_request. Allow pinning the callback via OAUTH_REDIRECT_URI; the
Host-derived behavior is unchanged when the variable is unset (prod).
- alerts.py: _looks_like_proxy_error only matches genuine proxy/download-stage
signatures (407, ProxyError, tunnel failed, 402/out-of-credits) instead of a
bare "proxy"/"credit"/"balance" substring — a job that failed in processing (or
a video titled with one of those words) no longer fires a false "out of credits"
alert. Real proxy failures still alert.
- app.py: _scrub_secrets() masks user:pass in any URL before a subprocess line is
printed or stored, so the residential proxy URL yt-dlp echoes in verbose debug
never lands in the server console or job log.
- app.py: _visible_logs() — cloud (BILLING on) surfaces only the pipeline's own
friendly progress lines (emoji-prefixed + worker start/finish) and hides the raw
yt-dlp/ffmpeg/debug spew from paying users; self-host still shows everything.
After a reload the ephemeral /videos/ files may be cleaned up (1h retention),
leaving black previews on the results screen. For managed users, fetch the job's
clips from /api/history (now includes clip_index) and fall back to the durable R2
url on video error (with a retry for the load race).
- revert showCalendar to true (calendar stays available in the white-label page)
- add a 'Content calendar' button (opens the Upload-Post page in a new tab) so users
can consult/manage scheduled posts from the dashboard
- social connect JWT: showCalendar=false (hide scheduling calendar in white-label page)
- connect opens in the same tab so the page's redirectUrl returns the user to the app
- after the first plan activation (checkout success), take the user straight to the
social-connect flow; guarded so top-up checkouts don't re-trigger it
Proxy-header trust alone wasn't enough in prod (still built http://). Build the
redirect_uri and force https for non-localhost hosts so it matches the registered
Google URI regardless of how the reverse proxy forwards the scheme.
- config: TELEGRAM_BOT_TOKEN / TELEGRAM_CHAT_ID + telegram_configured
- alerts: send_telegram(); send_admin_alert now pushes to Telegram + email
(so existing proxy-out-of-credits and high-failure alerts hit Telegram too)
- billing webhook: alert on new subscription, trial→paid conversion, and top-up
- .env.cloud.example documents the Telegram vars
Verified end-to-end: alert delivered to the admin group via the same
send_admin_alert path the webhook uses. Token stays in gitignored .env.
Security fixes on the hosted/paid surface (all no-op in self-host / BYOK):
- upload path traversal: basename() client filenames in /api/process,
/api/thumbnail/upload, /api/thumbnail/analyze fallback, /api/thumbnail/generate
(face/bg + session_id) so "../" can't escape UPLOAD_DIR
- SSRF: saasshorts subpage scraper now follow_redirects=False + assert_public_url
per hop (was open to 302 -> 169.254.169.254 metadata)
- metering: reserve+commit/release on /api/render, /api/subtitle, /api/hook and a
fixed guard cost on /api/thumbnail/upload transcription (were entitlement-gated
but unmetered -> unlimited off-quota compute)
- entitlement: SaaSShorts generate/actor-options/actor-upload now require a plan
in cloud; /api/edit ignores body api_key in cloud (no gate/meter bypass)
- multi-tenant IDOR: stamp user_id on thumbnail_sessions/saas_jobs and reject
non-owners (404) across status/mutation/publish/post endpoints
- DoS: bounded/streamed reads on actor-upload and thumbnail uploads
- retry_job_id routed through _safe_under
Frontend: raw fetch -> apiFetch on the now-gated/owner-checked endpoints so the
bearer token attaches.
License: cloud/ is now source-available under the OpenShorts Commercial License
(self-host/personal use allowed; no competing hosted service). Core stays MIT.
- config: TRIAL_MINUTE_CAP=20 — trial allowance capped across all plans
- metering: apply the cap in _balance while status=trialing (full minutes once active)
- billing: POST /api/billing/end-trial ends the Stripe trial immediately (charge now,
unlock full minutes); webhook flips status→active
- frontend: hitting the cap while trialing opens TrialUpgradeModal (activate plan now)
instead of the top-up modal; polls /api/me until active
- Legal: disclose the 20-minute trial allowance
- cloud/storage.py: R2 (S3-compatible) client — upload, presigned view/download
URLs, delete-by-prefix.
- cloud/videos.py: archive a completed managed job's clips to R2 under
users/<uid>/<job>/, GET /api/history (private signed links), and a retention
sweeper that deletes a user's videos 7 days after their subscription ends.
- models.py: user_videos table (created via create_all).
- app.py: archive clips to R2 on managed-job completion.
- billing.py: email the admin the moment a subscriber hits cancel.
- Frontend: History tab (library grid with per-video view + download).
R2 bucket 'openshorts-videos' + scoped API token created; end-to-end verified:
archive -> presigned GET (200) -> purge after grace -> object 404.
- main.py / metering.py: try the HD (bgutil/720p) strategy first, fall back to
the conservative (360p) clients on any failure, so a YouTube/yt-dlp change
degrades gracefully instead of failing the whole job.
- cloud/alerts.py: in-memory tracking of managed-job outcomes; emails the admin
(ADMIN_EMAIL) when a proxy/credit error appears or when many jobs fail in a
row, with a 1h per-alert cooldown. Wired into run_job_wrapper.
- Email switched from Resend to SMTP (cloud/emails.py) for magic link + alerts
(Namecheap Private Email). Config via SMTP_* / EMAIL_FROM / ADMIN_EMAIL in the
mounted .env (kept out of compose so the password's $/* aren't mangled).
SMTP send verified from host and from the backend container.
The metering duration probe (probe_url_minutes) ran yt-dlp without the proxy or
anti-bot extractor args, so it got IP-blocked on the server before the download
step. Now it mirrors main.py: PROXY_URL + player_client fallbacks. Verified E2E —
YouTube download completes through the DataImpulse residential proxy.