Configuration File
Create a.env file in the project root directory:
Environment Variables Reference
Processing Configuration
Maximum number of video processing jobs that can run simultaneously. Increase this value on powerful servers with multiple CPU cores and sufficient RAM.Recommended values:
- 2-4 cores:
3 - 8+ cores:
5-10 - 16+ cores:
10-15
AWS S3 Configuration (Optional)
Enable automatic backup of generated clips to AWS S3. All variables must be set for S3 upload to work.Your AWS access key ID with S3 write permissions.Example:
AKIAIOSFODNN7EXAMPLEYour AWS secret access key corresponding to the access key ID.Security: Never commit this value to version control. Use
.env file or environment-specific secrets management.AWS region where your S3 bucket is located.Common values:
us-east-1, us-west-2, eu-west-1, eu-west-3, ap-southeast-1Name of the S3 bucket where clips will be uploaded. Bucket must exist and be accessible with the provided credentials.Naming rules: Lowercase letters, numbers, hyphens only. No underscores or spaces.
YouTube Download Configuration
Netscape-format cookies file content for bypassing YouTube bot detection and download restrictions.How to get cookies:
- Install a browser extension like “Get cookies.txt”
- Visit YouTube while logged in
- Export cookies in Netscape format
- Paste the entire content as a single-line string
Production Deployment
Override the API URL used by the frontend in production builds.Example:
https://api.openshorts.appNote: Only needed when deploying frontend and backend to different domains. Development mode uses Vite proxy.Secret key for encrypting API keys stored in browser localStorage.Default:
"OpenShorts-Static-Salt-Change-Me"Security: Change this to a random string in production to prevent unauthorized decryption of stored API keys.Example: VITE_ENCRYPTION_KEY=my-super-secret-random-key-12345Loading Environment Variables
OpenShorts automatically loads environment variables from.env using python-dotenv:
app.py:29:
Docker Configuration
When using Docker Compose, pass environment variables via:Option 1: Environment File
Add todocker-compose.yml:
Option 2: Direct Environment Variables
Option 3: System Environment
Security Best Practices
Troubleshooting
S3 Upload Not Working
-
Verify credentials: Test AWS credentials with AWS CLI:
-
Check IAM permissions: Ensure your AWS user has
s3:PutObjectpermission - Bucket must exist: Create bucket before starting OpenShorts
Concurrent Jobs Not Limiting
- Check value type: Must be integer, not string
- Restart required: Changes require backend restart
- Verify in logs: Check startup logs for “Job Queue Worker started with X concurrent slots”