Spaces:
Runtime error
Runtime error
| # =========================================== | |
| # NestJS Starter Template - Environment Config | |
| # =========================================== | |
| # Copy this file to .env and fill in your values | |
| # cp .env.example .env | |
| # Application | |
| APP_URL="http://localhost:3000" | |
| PORT=3000 | |
| NODE_ENV="development" | |
| # Render or Hugging Face Deployment (optional) | |
| # BRANCH_NAME=dev | |
| # Database (PostgreSQL) | |
| DATABASE_URL="postgresql://username:password@localhost:5432/database_name?schema=public" | |
| # JWT Configuration | |
| JWT_ACCESS_SECRET="your-super-secret-access-key-min-32-chars" | |
| JWT_REFRESH_SECRET="your-super-secret-refresh-key-min-32-chars" | |
| JWT_ACCESS_EXPIRES_IN="24h" | |
| JWT_REFRESH_EXPIRES_IN="7d" | |
| # Swagger Documentation | |
| SWAGGER_PASSWORD="admin123" | |
| # =========================================== | |
| # GLOBAL API TOKEN PROTECTION | |
| # =========================================== | |
| # Enable/Disable Global API Token Authentication | |
| # Set to "true" to require API token for all endpoints (useful for public deployments on Hugging Face/Render) | |
| # Set to "false" to disable (for local development or trusted environments) | |
| API_TOKEN_ENABLED="false" | |
| # The secret API token that clients must provide in the "x-api-token" header | |
| # Generate a strong random token: node -e "console.log(require('crypto').randomBytes(64).toString('hex'))" | |
| # Example: API_SECRET_TOKEN="a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6" | |
| API_SECRET_TOKEN="your-permanent-api-secret-token-min-64-chars" | |
| # Application | |
| PORT=3000 | |
| NODE_ENV="development" | |
| # Brevo Email Service | |
| BREVO_API_KEY="your-brevo-api-key" | |
| BREVO_OTP_EMAIL="noreply@aksharbhesaniya.dev" | |
| BREVO_OTP_TEMPLATE_ID="1" | |
| BREVO_WELCOME_EMAIL="welcome@aksharbhesaniya.dev" | |
| BREVO_WELCOME_TEMPLATE_ID="2" | |
| # Authkey SMS Service (Using Default Template) | |
| AUTHKEY_API_KEY="your-authkey-api-key" | |
| AUTHKEY_COMPANY_NAME="StreamFlix" | |
| # ImageKit.io Credentials | |
| IMAGEKIT_PUBLIC_KEY="your-imagekit-public-key" | |
| IMAGEKIT_PRIVATE_KEY="your-imagekit-private-key" | |
| IMAGEKIT_URL_ENDPOINT="https://ik.imagekit.io/your-imagekit-id" | |
| # Cloudinary Credentials | |
| CLOUDINARY_CLOUD_NAME="your-cloud-name" | |
| CLOUDINARY_API_KEY="your-api-key" | |
| CLOUDINARY_API_SECRET="your-api-secret" | |
| CLOUDINARY_UPLOAD_FOLDER="StreamFlix" | |
| # Uploadcare Storage Configuration | |
| # =========================== | |
| # Uploadcare projects for different file types with signed upload enabled | |
| # Get credentials from: https://app.uploadcare.com/ | |
| # Create separate projects for images, videos, and documents | |
| # Project 1: For Images | |
| UPLOADCARE_IMAGE_PUBLIC_KEY=your_image_project_public_key | |
| UPLOADCARE_IMAGE_PRIVATE_KEY=your_image_project_private_key | |
| # Project 2: For Videos | |
| UPLOADCARE_VIDEO_PUBLIC_KEY=your_video_project_public_key | |
| UPLOADCARE_VIDEO_PRIVATE_KEY=your_video_project_private_key | |
| # Project 3: For Documents | |
| UPLOADCARE_DOCUMENT_PUBLIC_KEY=your_document_project_public_key | |
| UPLOADCARE_DOCUMENT_PRIVATE_KEY=your_document_project_private_key | |
| # Supabase Storage Credentials | |
| SUPABASE_PROJECT_URL="https://your-project.supabase.co" | |
| SUPABASE_S3_URL="https://your-project.storage.supabase.co/storage/v1/s3" | |
| SUPABASE_S3_ACCESS_KEY="your-access-key" | |
| SUPABASE_S3_SECRET_KEY="your-secret-key" | |
| SUPABASE_BUCKET="Streamflix" | |
| # Backblaze B2 Storage Credentials | |
| B2_BUCKET_NAME="StreamflixAkshar" | |
| B2_REGION="us-west-004" | |
| B2_S3_ENDPOINT="https://s3.us-west-004.backblazeb2.com" | |
| B2_ACCESS_KEY_ID="your-access-key-id" | |
| B2_SECRET_ACCESS_KEY="your-secret-access-key" | |
| B2_CDN_URL="https://cdn.aksharbhesaniya.dev" | |
| # Cloudflare Cache Purge (for purging cache on delete) | |
| CLOUDFLARE_ZONE_ID="your-zone-id" | |
| CLOUDFLARE_API_TOKEN="your-api-token" | |
| # Filestack Credentials | |
| FILESTACK_API_KEY_DEV="your-filestack-api-key" | |
| FILESTACK_APP_SECRET_DEV="your-filestack-app-secret" | |
| # NewMinio Storage Credentials | |
| NEWMINIO_PROJECT_URL="https://your-minio-instance.com" | |
| NEWMINIO_S3_ENDPOINT="https://your-minio-instance.com" | |
| NEWMINIO_S3_ACCESS_KEY="your-access-key" | |
| NEWMINIO_S3_SECRET_KEY="your-secret-key" | |
| NEWMINIO_BUCKET="streamflix" | |
| NEWMINIO_REGION="us-east-1" | |
| # OldMinio Storage Credentials | |
| OLDMINIO_PROJECT_URL="https://your-old-minio-instance.com" | |
| OLDMINIO_S3_ENDPOINT="https://your-old-minio-instance.com" | |
| OLDMINIO_S3_ACCESS_KEY="your-access-key" | |
| OLDMINIO_S3_SECRET_KEY="your-secret-key" | |
| OLDMINIO_BUCKET="streamflix" | |
| OLDMINIO_REGION="us-east-1" | |
| # SeaweedFS Storage Credentials | |
| SEAWEEDFS_FILER_ENDPOINT="https://your-seaweedfs-instance.com/filer/buckets/your-bucket" | |
| SEAWEEDFS_PUBLIC_URL="https://your-seaweedfs-instance.com/your-bucket" | |
| SEAWEEDFS_ACCESS_KEY="your-access-key" | |
| SEAWEEDFS_SECRET_KEY="your-secret-key" | |
| # Garage Storage Credentials | |
| GARAGE_ENDPOINT="https://your-garage-instance.com" | |
| GARAGE_ACCESS_KEY="your-garage-access-key" | |
| GARAGE_SECRET_KEY="your-garage-secret-key" | |
| GARAGE_BUCKET="stremflix" | |
| # RustFS Storage Credentials (Hugging Face S3-compatible) | |
| RUSTFS_ENDPOINT="https://your-rustfs-instance.hf.space" | |
| RUSTFS_ACCESS_KEY="your-rustfs-access-key" | |
| RUSTFS_SECRET_KEY="your-rustfs-secret-key" | |
| RUSTFS_BUCKET="streamflix" | |
| RUSTFS_REGION="us-east-1" | |
| # IDrive e2 Storage Credentials | |
| IDRIVE_E2_ENDPOINT="https://s3.ap-southeast-1.idrivee2.com" | |
| IDRIVE_E2_REGION="ap-southeast-1" | |
| IDRIVE_E2_ACCESS_KEY="your-idrive-access-key" | |
| IDRIVE_E2_SECRET_KEY="your-idrive-secret-key" | |
| IDRIVE_E2_BUCKET="streamflix" | |
| IDRIVE_E2_CDN_URL="https://idrive-e2-ap-southeast.aksharbhesaniya.dev" | |
| # Wasabi Storage Credentials | |
| WASABI_ENDPOINT="https://s3.us-west-1.wasabisys.com" | |
| WASABI_REGION="us-west-1" | |
| WASABI_ACCESS_KEY_ID="your-wasabi-access-key" | |
| WASABI_SECRET_ACCESS_KEY="your-wasabi-secret-key" | |
| WASABI_BUCKET_NAME="streamflix-backed" | |
| # Dropbox Storage Credentials | |
| DROPBOX_ACCESS_TOKEN="your-dropbox-access-token" | |
| DROPBOX_APP_FOLDER="/StreamflixDev" | |
| # Box.com Storage Credentials (OAuth 2.0) | |
| # Setup: Create a Box Custom App with OAuth 2.0 User Authentication | |
| # Get credentials from: https://app.box.com/developers/console | |
| # Tokens are automatically stored in box-tokens.json after OAuth authorization | |
| BOX_CLIENT_ID="your-box-client-id" | |
| BOX_CLIENT_SECRET="your-box-client-secret" | |
| BOX_REDIRECT_URI="http://localhost:3000/box/oauth/callback" | |
| # To get tokens: Start your server and visit http://localhost:3000/box/oauth/authorize | |
| # Box Folder IDs for organizing uploads (automatically selected based on fileType) | |
| # Get folder IDs from Box.com URL: https://app.box.com/folder/123456789 | |
| BOX_STREAMFLIX_FOLDER_ID="358198319436" # Main Streamflix folder (default when no fileType) | |
| BOX_IMAGES_FOLDER_ID="358197066267" # Used when fileType=IMAGE | |
| BOX_VIDEOS_FOLDER_ID="358199692412" # Used when fileType=VIDEO | |
| BOX_DOCUMENTS_FOLDER_ID="358199056099" # Used when fileType=DOCUMENT | |
| # Google Drive Storage Credentials - OAuth2 (For Personal Accounts) | |
| # Follow setup guide in GOOGLE_DRIVE_OAUTH2_SETUP.md | |
| # Step 1: Create OAuth2 credentials in Google Cloud Console | |
| # Step 2: Get authorization by visiting: http://localhost:5119/google-drive/oauth2/authorize | |
| # Step 3: Copy the refresh token and paste it here | |
| GOOGLE_OAUTH2_CLIENT_ID="your-client-id.apps.googleusercontent.com" | |
| GOOGLE_OAUTH2_CLIENT_SECRET="your-client-secret" | |
| GOOGLE_OAUTH2_REDIRECT_URI="http://localhost:5119/google-drive/oauth2callback" | |
| GOOGLE_OAUTH2_REFRESH_TOKEN="your-refresh-token" | |
| GOOGLE_DRIVE_FOLDER_MAIN="your-main-folder-id" | |
| GOOGLE_DRIVE_FOLDER_IMAGES="your-images-folder-id" | |
| GOOGLE_DRIVE_FOLDER_VIDEOS="your-videos-folder-id" | |
| GOOGLE_DRIVE_FOLDER_DOCUMENTS="your-documents-folder-id" | |
| # ============================================ | |
| # TWO-FACTOR AUTHENTICATION (2FA) CONFIG | |
| # ============================================ | |
| # Brevo Email Template for 2FA Codes | |
| BREVO_2FA_CODE_TEMPLATE_ID="4" | |
| # General 2FA Settings | |
| TWO_FA_CODE_EXPIRY_MINUTES=10 | |
| TWO_FA_MAX_ATTEMPTS=5 | |
| TWO_FA_CODE_LENGTH=6 | |
| # Pending 2FA Token (short-lived JWT issued after password verification) | |
| # Generate: node -e "console.log(require('crypto').randomBytes(64).toString('hex'))" | |
| PENDING_2FA_TOKEN_SECRET="your_random_secret_min_64_chars_change_this_use_command_above" | |
| PENDING_2FA_TOKEN_EXPIRY="10m" | |
| # TOTP/Authenticator App Configuration | |
| TOTP_APP_NAME="Streamflix Admin" | |
| TOTP_ISSUER="Streamflix" | |
| # Secret encryption key for storing TOTP secrets in DB (AES-256 needs 32 bytes) | |
| # Generate: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" | |
| TOTP_ENCRYPTION_KEY="your_encryption_key_64_chars_hex_change_this_use_command_above" | |
| # Recovery Codes | |
| RECOVERY_CODES_COUNT=10 | |
| RECOVERY_CODE_LENGTH=8 | |
| # Trusted Device Token (long-lived token to skip 2FA on known devices) | |
| # Generate: node -e "console.log(require('crypto').randomBytes(64).toString('hex'))" | |
| TRUSTED_DEVICE_TOKEN_SECRET="another_random_secret_min_64_chars_change_this_use_command_above" | |
| TRUSTED_DEVICE_TOKEN_EXPIRY="30d" | |
| # Email Template URLs (for template variables) | |
| SUPPORT_URL="https://support.streamflix.com" | |
| SECURITY_URL="https://streamflix.com/security" | |
| PRIVACY_URL="https://streamflix.com/privacy" | |
| COMPANY_ADDRESS="Mumbai, Maharashtra, India" | |
| # WebAuthn/Passkey Configuration (Optional - for future) | |
| WEBAUTHN_RP_NAME="Streamflix Admin" | |
| WEBAUTHN_RP_ID="yourdomain.com" | |
| WEBAUTHN_ORIGIN="https://admin.yourdomain.com" | |
| # For development use localhost | |
| # WEBAUTHN_RP_ID="localhost" | |
| # WEBAUTHN_ORIGIN="http://localhost:3000" | |
| # Push Notification Configuration (Optional - for future) | |
| FCM_SERVER_KEY="your_fcm_server_key_here" | |
| FCM_PROJECT_ID="your_firebase_project_id" | |
| PUSH_APPROVAL_TIMEOUT_MINUTES=2 | |
| # Discord Logging via n8n | |
| # =========================== | |
| # These webhook URLs should point to your n8n instance | |
| # Enable/Disable Discord Logging | |
| DISCORD_LOGGING_ENABLED=false | |
| # Webhook for successful API calls (status 200-399) | |
| N8N_DISCORD_LOOGING_WEBHOOK_SUCCESS_URL=https://your-n8n-instance.com/webhook/api-success-log | |
| # Webhook for error API calls (status 400+) | |
| N8N_DISCORD_LOOGING_WEBHOOK_ERROR_URL=https://your-n8n-instance.com/webhook/api-error-log | |
| # Webhook for HLS video processing completion | |
| N8N_DISCORD_HLS_COMPLETE_WEBHOOK_URL=https://your-n8n-instance.com/webhook/hls-processing-complete | |
| # Shlink URL Shortener Configuration | |
| # =========================== | |
| # Shlink instance URL and API key for URL shortening service | |
| SHLINK_URL=https://sasuke734-shlink-shortener.hf.space | |
| SHLINK_API_KEY=33707705d3fc4449b5b468fe4829d6c95cee1e70889a45f39d265a1b654c860a7927ea0b6d234181b46f1cb8232d791f611c35bf681c415895e | |
| # Trim Kutt URL Shortener Configuration | |
| # =========================== | |
| # Kutt instance URL and API key for URL shortening service | |
| TRIM_KUTT_URL=https://trim.aksharbhesaniya.dev | |
| TRIM_KUTT_API_KEY=ABC | |