# ===========================================
# Chunked Upload Server Configuration
# ===========================================
# Required - Authentication
API_KEY=your-secret-api-key-here
JWT_SECRET=your-jwt-secret-key-here
# ===========================================
# Storage Configuration
# ===========================================
# Storage backend: "local", "smb", or "s3"
STORAGE_BACKEND=local
# Local storage path (used when STORAGE_BACKEND=local)
LOCAL_STORAGE_PATH=./uploads
# Temp storage path for chunked parts (fast local SSD recommended)
# Used by S3 and SMB backends to store parts before final assembly
# Defaults to system temp directory if not set
# TEMP_STORAGE_PATH=/tmp/chunked-uploads
# ===========================================
# SMB/NAS Configuration (used when STORAGE_BACKEND=smb)
# ===========================================
# Parts are stored locally, then final file is copied to SMB share
# Server connection
SMB_HOST=nas.local
SMB_PORT=445
SMB_USER=admin
SMB_PASS=your-password-here
SMB_SHARE=uploads
# Subdirectory within the share (optional)
SMB_PATH=
# Local mount point for the SMB share
SMB_MOUNT_POINT=/Volumes/uploads
# ===========================================
# S3 Configuration (used when STORAGE_BACKEND=s3)
# ===========================================
# Parts are stored locally, then final file is uploaded to S3
# S3 endpoint (optional, defaults to AWS)
# For MinIO: http://localhost:9000
# For Cloudflare R2: https://<account-id>.r2.cloudflarestorage.com
S3_ENDPOINT=https://s3.amazonaws.com
S3_BUCKET=my-uploads-bucket
S3_REGION=us-east-1
# AWS credentials (reads from environment or ~/.aws/credentials)
# AWS_ACCESS_KEY_ID=your-access-key
# AWS_SECRET_ACCESS_KEY=your-secret-key
# ===========================================
# Upload Settings
# ===========================================
# Chunk size in MB (default: 50MB for Cloudflare compatibility)
CHUNK_SIZE_MB=50
# How long uploads remain valid in hours (default: 24)
UPLOAD_TTL_HOURS=24
# Note: Custom paths can be specified in the filename during upload init
# e.g., "videos/2024/movie.mp4" -> stored at {backend}/videos/2024/uuid_movie.mp4
# ===========================================
# Server Settings
# ===========================================
# SQLite database path
DATABASE_PATH=./uploads.db
# Server port
SERVER_PORT=3000
# Logging level
RUST_LOG=chunked_uploader=info,tower_http=debug