clipwright/.env.cloud.example
juancarlos.cavero ebe876c497 feat: unlock 720p/1080p YouTube downloads (Deno + bgutil PO tokens)
YouTube now forces SABR streaming, capping downloads at 360p without a GVS PO
token. Adds the full recipe (cloud mode only):
- Dockerfile: Deno JS runtime (nsig challenge) + latest yt-dlp[default] nightly
  + bgutil-ytdlp-pot-provider plugin
- docker-compose.cloud.yml: bgutil PO-token sidecar + BGUTIL_BASE_URL
- main.py / metering.py: when BGUTIL_BASE_URL is set, use yt-dlp default clients
  + the bgutil HTTP provider (→ 720p); self-host keeps the conservative fallback

Verified E2E through the container: managed user -> YouTube -> DataImpulse
residential proxy + Deno + bgutil -> real 720p (format 136) download, no 403.
2026-07-14 13:42:07 +02:00

42 lines
1.6 KiB
Text

# Cloud (paid / managed-keys) mode — env template for openshorts.app.
# Copy to .env and fill in. Only needed when running with docker-compose.cloud.yml.
# Self-hosters running plain BYOK do NOT need any of this.
BILLING_ENABLED=true
# Postgres (docker-compose.cloud.yml provisions the `db` service)
POSTGRES_PASSWORD=change-me
DATABASE_URL=postgresql+asyncpg://openshorts:change-me@db:5432/openshorts
# Auth
JWT_SECRET=generate-a-long-random-string
FRONTEND_URL=https://openshorts.app
ALLOWED_ORIGINS=https://openshorts.app
# Email — magic link (Resend)
RESEND_API_KEY=re_...
EMAIL_FROM=OpenShorts <login@openshorts.app>
# Google OAuth (optional; magic link works without it)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# Stripe (test keys shown; use live keys in production).
# Prices are resolved by lookup_key (starter_monthly, topup_60, ...) at runtime,
# so no price IDs are needed here. Create the prices with those lookup_keys.
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Managed provider keys (server-owned; only handed to entitled paid users)
MANAGED_GEMINI_API_KEY=
MANAGED_UPLOAD_POST_API_KEY=
OPENSHORTS_LOGO_URL=https://openshorts.app/logo.png
# Residential proxy for YouTube downloads (avoids datacenter-IP bans on the
# hosted server). Recommended: DataImpulse (~$1/GB PAYG). Downloads are capped
# to 720p when this is set, to control bandwidth cost. Empty = direct download.
PROXY_URL=
# PO-token provider for 720p/1080p YouTube (bgutil sidecar in docker-compose.cloud.yml).
# Defaults to the sidecar; only override if you run bgutil elsewhere.
BGUTIL_BASE_URL=http://bgutil:4416