vector / .env.example
d-ragon's picture
Upload 547 files
851e5ba verified
Raw History Blame Contribute Delete
18.9 kB
# SupoClip Environment Configuration
# Copy this file and fill in your API keys
# ==============================================
# AI Provider API Keys (Required for video processing)
# ==============================================
# Transcription provider: assemblyai (default), whisper, or youtube_captions
# - assemblyai: cloud API (requires ASSEMBLY_AI_API_KEY), best accuracy, speaker diarization
# - whisper: local transcription (no API key), good accuracy, word-level timestamps
# - youtube_captions: extract from YouTube captions (YouTube-sourced videos only)
TRANSCRIPTION_PROVIDER=assemblyai
# Avoid CUDA/NVIDIA dependency downloads on CPU-only Docker hosts (including Macs).
# Existing deployments without this setting retain their current Torch variant.
BACKEND_CPU_ONLY=true
# Image platform for the backend and worker. linux/amd64 is the default,
# including on Apple Silicon, where Docker emulates it. On an arm64 host, set
# linux/arm64 and keep BACKEND_CPU_ONLY=true (CUDA wheels are amd64-only),
# then rebuild: docker compose up -d --build backend worker
BACKEND_PLATFORM=linux/amd64
# AssemblyAI - Only needed when TRANSCRIPTION_PROVIDER=assemblyai
# Word-level timing, speaker diarization (best quality, cloud API)
ASSEMBLY_AI_API_KEY=
# Optional model override for all processing modes (fast, balanced, quality).
# Set universal-2 for lower cost with word timings and speaker labels retained.
# Empty preserves each processing mode's model selection.
ASSEMBLY_AI_SPEECH_MODEL=
# Total status-polling budget after transcript submission, in seconds.
ASSEMBLY_AI_HTTP_TIMEOUT_SECONDS=900
# Bound individual upload/submit HTTP requests; transient uploads retry up to 3 times.
ASSEMBLY_AI_REQUEST_TIMEOUT_SECONDS=60
# Spoken language of uploads. Leave empty (or "auto") to detect it per video.
# Set an AssemblyAI language code (e.g. es, de, pt, en_us) to force it; this
# also picks the matching audio track in multi-track files. Applies to Whisper too.
TRANSCRIPTION_LANGUAGE=
# Max accepted size (bytes) for an uploaded video. Default 4 GB (4000000000),
# enough for a full-length 1080p upload at a normal bitrate. Larger files make
# transcription, storage, and rendering slow and fragile.
# The web app reads the same value from the billing summary. Set
# NEXT_PUBLIC_MAX_VIDEO_UPLOAD_BYTES to this number as well so the pre-upload
# check matches before that summary loads.
MAX_VIDEO_UPLOAD_BYTES=4000000000
# Choose one AI provider for transcript analysis:
# OpenAI (recommended: gpt-5.2)
OPENAI_API_KEY=
# OpenRouter: Sonnet 5.5 primary, GPT-6 Luna fallback
OPENROUTER_API_KEY=
OPENROUTER_FALLBACK_MODEL=openai/gpt-6-luna
# NVIDIA API Catalog (hosted trial / research and development)
# Select LLM=nvidia:minimaxai/minimax-m3.1-flash to use MiniMax.
NVIDIA_API_KEY=
# Google AI (recommended: gemini-3-flash)
GOOGLE_API_KEY=
# Anthropic (claude-3-5-sonnet, claude-4-sonnet)
ANTHROPIC_API_KEY=
# Ollama (local/self-hosted or Ollama Cloud)
# Optional. Defaults to http://localhost:11434/v1 for local backend runs,
# or http://host.docker.internal:11434/v1 inside Docker.
OLLAMA_BASE_URL=
# Optional for Ollama Cloud
OLLAMA_API_KEY=
# Pexels - For AI B-Roll (free stock video footage)
# Get your free API key at: https://www.pexels.com/api/
PEXELS_API_KEY=
# Optional paid fallback for YouTube downloads
APIFY_API_TOKEN=
# YouTube download provider
# `yt_dlp` is the free default and works without APIFY_API_TOKEN.
# `apify` uses the Apify actor first, then falls back to yt-dlp.
# `rapidapi` tries API Router, then Apify, then yt-dlp.
# When YOUTUBE_PROXY_URL is configured, the order is proxy, API Router, Apify, yt-dlp.
YOUTUBE_DOWNLOAD_PROVIDER=yt_dlp
# Residential proxy for yt-dlp. Empty keeps the existing provider chain.
# `{session}` is replaced with a per-job sticky id (one exit IP per job).
# `{country}` is optional and must be a two-letter code when set below.
# Example: http://user-country-{country}-session-{session}:pass@gw.example:823
YOUTUBE_PROXY_URL=
TWITCH_DOWNLOAD_PROVIDERS=proxy,direct,apify_twitch
KICK_DOWNLOAD_PROVIDERS=proxy,direct_retry,apify_kick_hls,apify_kick_mp4
APIFY_STREAM_PROVIDERS=true
APIFY_TWITCH_ACTOR=abotapi/twitch-scraper
APIFY_KICK_HLS_ACTOR=hipersoft/kick-downloader
APIFY_KICK_MP4_ACTOR=parsebird/kick-video-downloader
APIFY_STREAM_TIMEOUT_SECONDS=300
# Upper bound used by the last-resort full Kick download (minimum sent is 100 MB).
APIFY_KICK_MAX_VIDEO_SIZE_MB=2000
YOUTUBE_PROXY_COUNTRY=
YOUTUBE_PROXY_TIMEOUT_SECONDS=300
# bgutil PO-token sidecar. Empty skips it. In compose: http://bgutil:4416
YOUTUBE_POT_PROVIDER_URL=
# Per-job cap for audio + section bytes (and a full-file fallback). Default 2 GB.
YOUTUBE_DOWNLOAD_MAX_BYTES=2000000000
# Seconds of padding around each selected clip before ranges are merged.
YOUTUBE_SECTION_PADDING_SECONDS=10
# Video downloads never exceed 1080p. A lower value is honored.
YOUTUBE_MAX_HEIGHT=1080
# Keep audio and section files so edits do not download the source again.
YOUTUBE_SOURCE_CACHE=on
YOUTUBE_SOURCE_CACHE_TTL_SECONDS=604800
# RapidAPI download service (optional). Hosts stay in private configuration.
RAPIDAPI_YOUTUBE_API_KEY=
RAPIDAPI_YOUTUBE_HOST=
RAPIDAPI_YOUTUBE_RELAY_HOST=
RAPIDAPI_YOUTUBE_TIMEOUT_SECONDS=300
# YouTube metadata provider
# `yt_dlp` keeps the current behavior.
# `youtube_data_api` uses the official YouTube Data API first, then falls back to yt-dlp.
YOUTUBE_METADATA_PROVIDER=yt_dlp
# How long task creation waits for YouTube length metadata, in seconds.
# Default 30. Invalid values use 30; values above 180 are capped.
# Raise this (for example to 60) when valid links time out under amd64 emulation.
YOUTUBE_PREFLIGHT_TIMEOUT_SECONDS=30
# Preferred key for the YouTube Data API metadata path.
# If omitted, metadata requests fall back to GOOGLE_API_KEY when available.
YOUTUBE_DATA_API_KEY=
# ==============================================
# AI Model Configuration
# ==============================================
# Format: "provider:model-name"
# IMPORTANT: Hosted providers require the matching API key above.
# Ollama can run locally without an API key.
# Examples:
# - openai:gpt-5.2 (requires OPENAI_API_KEY) - latest, best reasoning
# - google-gla:gemini-3-flash-preview (requires GOOGLE_API_KEY) - fast, cost-effective
# - anthropic:claude-4-sonnet (requires ANTHROPIC_API_KEY)
# - openrouter:anthropic/claude-sonnet-5.5 (requires OPENROUTER_API_KEY)
# - nvidia:minimaxai/minimax-m3.1-flash (requires NVIDIA_API_KEY)
# - ollama:gpt-oss:20b (uses local Ollama by default, optional OLLAMA_BASE_URL)
LLM=openrouter:anthropic/claude-sonnet-5.5
# Optional editor-only model; defaults to Claude Sonnet. Local example:
# AI_EDIT_MODEL=ollama:qwen3.8:27b
# Hosted AI editing: Pro includes 10 requests/month, Creator includes 100.
# Self-hosted AI editing has no subscription allowance.
# Optional model for the cross-window rerank of clip candidates on long
# videos (same provider:model format). Empty = use LLM.
RERANK_LLM=
# Whisper model size: tiny, base, small, medium, large, large-v3
# Used when TRANSCRIPTION_PROVIDER=whisper. Larger = more accurate but slower.
WHISPER_MODEL_SIZE=medium
# Mark stale queued tasks as error after this many seconds
QUEUED_TASK_TIMEOUT_SECONDS=180
# Default target resolution requested from the Apify YouTube downloader when enabled
APIFY_YOUTUBE_DEFAULT_QUALITY=1080
# Maximum Apify actor run time before SupoClip gives up and falls back, in seconds
APIFY_RUN_TIMEOUT_SECONDS=3600
# Processing defaults
DEFAULT_PROCESSING_MODE=fast
# Hard cap on clips per task (all modes); fast mode can cap lower
MAX_CLIPS=10
FAST_MODE_MAX_CLIPS=10
FAST_MODE_TRANSCRIPT_MODEL=universal-3-5-pro
# Cut to the active speaker on multi-person wide shots (uses speaker labels)
SPEAKER_FRAMING=true
# Replay a later line before each clip. Off by default: the line plays twice
# and the real opening has to work on its own. Set true to opt into cold opens.
HOOK_FIRST_TEASER=false
# ==============================================
# Authentication
# ==============================================
# Better Auth secret (change this in production!)
# Generate a secure random string for production
BETTER_AUTH_SECRET=supoclip_dev_secret_change_in_production
# Set to true/1/yes to disable new user sign-ups.
DISABLE_SIGN_UP=false
# Set to true to disable all routes except the landing page.
NEXT_PUBLIC_LANDING_ONLY_MODE=false
# ==============================================
# Analytics (optional)
# ==============================================
# DataFast public website ID (example: dfid_xxxxxx)
NEXT_PUBLIC_DATAFAST_WEBSITE_ID=
# DataFast tracked domain without protocol (example: supoclip.com)
NEXT_PUBLIC_DATAFAST_DOMAIN=
# Set to true only when you want to test DataFast on localhost
NEXT_PUBLIC_DATAFAST_ALLOW_LOCALHOST=false
# Tilly analytics (optional, runs alongside DataFast). Website id from Tilly's site settings.
NEXT_PUBLIC_TILLY_WEBSITE_ID=
# ==============================================
# Error tracking and logs (optional, see docs/observability.md)
# ==============================================
# PostHog project token (phc_...). Empty disables error reporting from the
# backend and worker.
POSTHOG_PROJECT_TOKEN=
POSTHOG_HOST=https://eu.i.posthog.com
# Web analytics, session replay and error tracking. Baked in at build time;
# empty disables PostHog in the browser.
NEXT_PUBLIC_POSTHOG_KEY=
NEXT_PUBLIC_POSTHOG_HOST=https://eu.i.posthog.com
# Upload web source maps at build time (personal API key with error tracking
# write + organization read scopes, and the numeric project id).
POSTHOG_PERSONAL_API_KEY=
POSTHOG_PROJECT_ID=
# Ship container logs to Axiom: set COMPOSE_PROFILES=axiom and an ingest token.
# COMPOSE_PROFILES=axiom
AXIOM_TOKEN=
AXIOM_DATASET=supoclip-prod
# Amazon SES credentials for transactional emails; required to verify email and create API keys
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
SES_FROM_EMAIL="SupoClip <onboarding@example.com>"
# Docker host port. Existing deployments without this setting keep port 3001.
# Keep your existing port if a production reverse proxy depends on it.
FRONTEND_PORT=3107
NEXT_PUBLIC_APP_URL=http://localhost:3107
BETTER_AUTH_URL=http://localhost:3107
# Optional comma-separated browser origins for another hostname/custom port.
# Explicit HTTP(S) origins only; no wildcard or automatic request-host trust.
BETTER_AUTH_TRUSTED_ORIGINS=
# ==============================================
# Monetization (optional, disabled by default)
# ==============================================
# Open-source/self-host mode. Monetization is only enabled when SELF_HOST=false
SELF_HOST=true
BACKEND_AUTH_SECRET=change_me_backend_auth_secret
APP_SETTINGS_ENCRYPTION_KEY=change_me_settings_encryption_secret
ALLOW_UNSIGNED_BACKEND_AUTH=false
AUTH_SIGNATURE_TTL_SECONDS=300
# Include the frontend origin because browser video uploads go directly to the backend.
CORS_ORIGINS=http://localhost:3107,http://sp.localhost:3107,http://supoclip.localhost:3107
# Paid plan monthly allowance, in minutes of source video (0 = unlimited).
# Pro clips are delivered at 720p, Creator ("scale") clips at 1080p.
PRO_PLAN_MINUTE_LIMIT=600
SCALE_PLAN_MINUTE_LIMIT=1500
# Source-video duration limits, in seconds. Scale's longer allowance applies
# only to YouTube links from active or trialing Scale subscriptions.
MAX_VIDEO_DURATION=5400
PRO_YOUTUBE_MAX_VIDEO_DURATION=5400
SCALE_YOUTUBE_MAX_VIDEO_DURATION=10800
# Stripe settings (required only when SELF_HOST=false)
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
# Legacy fallback for the Pro price ID. Prefer STRIPE_PRO_PRICE_ID for new setups.
STRIPE_PRICE_ID=
STRIPE_PRO_PRICE_ID=
STRIPE_SCALE_PRICE_ID=
# Yearly prices (optional; the yearly option fails checkout until they are set)
STRIPE_PRO_ANNUAL_PRICE_ID=
STRIPE_SCALE_ANNUAL_PRICE_ID=
# Earlier prices existing subscribers still pay (comma-separated). They keep
# mapping to their plan; subscribers on an earlier Pro price keep 1080p.
STRIPE_PRO_LEGACY_PRICE_IDS=
STRIPE_SCALE_LEGACY_PRICE_IDS=
# Creator program: coupon that approved creators' promotion codes are attached to
# (20% off for the first 3 months).
STRIPE_CREATOR_COUPON_ID=creator-20-3mo
NEXT_PUBLIC_PRO_PRICE_MONTHLY=9.99
NEXT_PUBLIC_SCALE_PRICE_MONTHLY=24.99
NEXT_PUBLIC_PRO_PRICE_ANNUAL=99.90
NEXT_PUBLIC_SCALE_PRICE_ANNUAL=249.90
NEXT_PUBLIC_PRO_PLAN_MINUTE_LIMIT=600
NEXT_PUBLIC_SCALE_PLAN_MINUTE_LIMIT=1500
# Scheduled posting on the pricing pages: soon (default, "Coming soon" tag), live, or off
NEXT_PUBLIC_SOCIAL_PUBLISHING=soon
# Optional fallback links when Stripe sessions are not configured
STRIPE_CHECKOUT_URL=
STRIPE_CUSTOMER_PORTAL_URL=
# RevenueCat Apple IAP webhook settings (handled by the frontend Next.js route)
REVENUECAT_WEBHOOK_AUTH_HEADER=
# Optional comma-separated product ID overrides/additions. Defaults are:
# com.samihindi.supoclip.pro.monthly and com.samihindi.supoclip.scale.monthly
REVENUECAT_PRO_PRODUCT_IDS=
REVENUECAT_SCALE_PRODUCT_IDS=
# ==============================================
# Feedback (optional — posts to Discord)
# ==============================================
# Discord webhook URLs (each posts to a separate channel)
DISCORD_FEEDBACK_WEBHOOK_URL=
DISCORD_SALES_WEBHOOK_URL=
# ==============================================
# Social Publishing (optional)
# ==============================================
# Register one OAuth app per platform; users then connect their own accounts
# in Settings -> Social Accounts. All three platform APIs are free; each one
# gates public posting behind an app review (see docs/configuration.md).
#
# Redirect URI to register for every platform:
# ${NEXT_PUBLIC_APP_URL}/api/social/callback/<provider> (youtube | tiktok | instagram)
# Google Cloud -> OAuth client (Web application), YouTube Data API v3 enabled
YOUTUBE_OAUTH_CLIENT_ID=
YOUTUBE_OAUTH_CLIENT_SECRET=
# TikTok for Developers -> app with Login Kit + Content Posting API
TIKTOK_CLIENT_KEY=
TIKTOK_CLIENT_SECRET=
# Leave false until TikTok audits the app (unaudited: private posts from private accounts only).
TIKTOK_APP_AUDITED=false
# Meta for Developers -> app with "Instagram API with Instagram Login"
INSTAGRAM_APP_ID=
INSTAGRAM_APP_SECRET=
# Where OAuth callbacks and Instagram's public video fetch land. Both default
# to NEXT_PUBLIC_APP_URL; override only if the frontend is reachable elsewhere.
SOCIAL_OAUTH_REDIRECT_BASE_URL=
SOCIAL_PUBLIC_MEDIA_BASE_URL=
# Performance loop: how often to pull metrics, for how long after publishing,
# and how many measured posts are needed before clip selection is personalized.
SOCIAL_METRICS_REFRESH_HOURS=6
SOCIAL_METRICS_MAX_POST_AGE_DAYS=60
SOCIAL_PERFORMANCE_MIN_POSTS=3
# Rollout: "off" (default; Social and Analytics stay hidden), "admins"
# (admins plus the allowlist only) or "all".
SOCIAL_PUBLISHING_ACCESS=off
# Platforms available to users admitted by the rollout above. Empty disables all.
# For a YouTube-only admin trial: ACCESS=admins, PROVIDERS=youtube, no allowlist.
SOCIAL_PUBLISHING_PROVIDERS=youtube,tiktok,instagram
# Comma-separated emails that get access when SOCIAL_PUBLISHING_ACCESS=admins.
SOCIAL_PUBLISHING_ALLOWED_EMAILS=
# ==============================================
# Workflows (series, topic, recap, trailer)
# ==============================================
# Who can pick a workflow other than Highlights or add creator instructions:
# "admins" (default; admins plus the allowlist below), "all" or "off".
# Self-hosters usually want "all". Set it on the API and the worker.
WORKFLOWS_ACCESS=admins
# Comma-separated emails that get access when WORKFLOWS_ACCESS=admins (verified accounts only).
WORKFLOWS_ALLOWED_EMAILS=
# Comma-separated workflows open to everyone while access is admins, e.g. trailer,topic.
WORKFLOWS_PUBLIC=
# Most clips a topic run returns.
# WORKFLOW_TOPIC_MAX_CLIPS=15
# Wall-clock limit for planning one workflow, in seconds (max 6 hours).
# WORKFLOW_PLAN_TIMEOUT_SECONDS=1800
# Transcript size, in words, up to which the whole video is outlined in one
# model call; longer videos are outlined in windows. Empty uses the model default.
# WORKFLOW_FULL_CONTEXT_MAX_WORDS=
# ==============================================
# Database Configuration
# ==============================================
# PostgreSQL credentials (matches docker-compose.yml)
POSTGRES_DB=supoclip
POSTGRES_USER=supoclip
POSTGRES_PASSWORD=supoclip_password
# Redis password for Docker/local development.
# Leave blank to run Redis without AUTH, or set a value to require authentication.
REDIS_PASSWORD=
# ==============================================
# Docker Performance
# ==============================================
# Enable BuildKit for faster Docker builds
COMPOSE_DOCKER_CLI_BUILD=1
DOCKER_BUILDKIT=1
# Durable media: local for self-hosting, s3 for private object storage.
# IAM roles/default AWS credentials work when dedicated media keys are blank.
MEDIA_STORAGE=local
MEDIA_S3_BUCKET=
MEDIA_S3_PREFIX=media
MEDIA_S3_REGION=eu-central-1
MEDIA_S3_ENDPOINT=
MEDIA_S3_ACCESS_KEY_ID=
MEDIA_S3_SECRET_ACCESS_KEY=
MEDIA_S3_SESSION_TOKEN=
# Optional independent S3-compatible mirror (for example Cloudflare R2).
# Enable failover only after existing media has been copied and verified.
MEDIA_FALLBACK_BUCKET=
MEDIA_FALLBACK_ENDPOINT=
MEDIA_FALLBACK_REGION=auto
MEDIA_FALLBACK_ACCESS_KEY_ID=
MEDIA_FALLBACK_SECRET_ACCESS_KEY=
MEDIA_FAILOVER_ENABLED=false
MEDIA_URL_TTL_SECONDS=900
MEDIA_CACHE_TTL_SECONDS=86400
MEDIA_ORPHAN_GRACE_SECONDS=86400
MEDIA_UPLOAD_CONCURRENCY=3
MEDIA_UPLOAD_DAILY_LIMIT=20
# Explicit deployment configuration; no paid worker is selected by default.
APIFY_YOUTUBE_DOWNLOADER_ACTOR=
# Legacy input contracts: start_urls, progressive, kv_videos.
APIFY_YOUTUBE_INPUT_ADAPTER=start_urls
# Private provider pool: actor, pinned build, adapter, optional max_charge_usd
# and run_timeout_seconds. Adapters: kv_file, url_objects, signed_url,
# kv_media, private_s3. No paid worker is selected by default.
APIFY_YOUTUBE_PROVIDERS=[]
# Ordered actor IDs, comma separated; at most three providers including primary.
APIFY_YOUTUBE_FALLBACK_ACTORS=
# Legacy single fallback, used only when the ordered list is empty.
APIFY_YOUTUBE_FALLBACK_ACTOR=
# Shared per-download Apify spending allowance across all providers (USD, max 6).
APIFY_DOWNLOAD_MAX_CHARGE_USD=6
APIFY_FALLBACK_MAX_CHARGE_USD=6
# Fallback actors beyond the primary stay off (they can cost up to $6 per run).
# Set true only when those actors are an intentional, budgeted backup.
APIFY_EXPENSIVE_FALLBACKS=false
# Optional private delivery: versioning required; scope credentials to one bucket.
APIFY_STORAGE_BUCKET=
APIFY_STORAGE_REGION=
APIFY_STORAGE_WRITER_ACCESS_KEY_ID=
APIFY_STORAGE_WRITER_SECRET_ACCESS_KEY=
APIFY_STORAGE_READER_ACCESS_KEY_ID=
APIFY_STORAGE_READER_SECRET_ACCESS_KEY=
APIFY_STORAGE_KEY_TEMPLATE=