# ========================= # Telegram Bot # ========================= # Get API_ID and API_HASH from: # https://my.telegram.org -> Development Tools API_ID=123456 API_HASH=your_api_hash # Create a bot and get BOT_TOKEN from: # https://t.me/BotFather BOT_TOKEN=your_bot_token # ========================= # Database & Cache # ========================= # PostgreSQL connection string # Railway: Add a PostgreSQL plugin and copy DATABASE_URL # Local: postgresql://user:password@localhost:5432/filelink DATABASE_URL=postgresql://user:password@localhost:5432/filelink # Redis connection string # Railway: Add a Redis plugin and copy REDIS_URL # Local: redis://localhost:6379 REDIS_URL=redis://localhost:6379 # ========================= # Public URL # ========================= # Publicly accessible base URL # # Local development: # BASE_URL=http://localhost:8000 # # Railway: # BASE_URL=${RAILWAY_PUBLIC_DOMAIN} # # Custom domain: # BASE_URL=https://files.example.com # # Note: # - If no scheme is provided, https:// is assumed. # - Railway public domains are always served over HTTPS. # BASE_URL=http://localhost:8000 # ========================= # Limits # ========================= # Maximum file size accepted by the bot (in MB) # Telegram limits still apply: # - Free account: up to 2 GB # - Telegram Premium: up to 4 GB MAX_FILE_MB=4096 # Maximum number of uploads processed at the same time # Prevents server overload and Telegram flood limits # # Recommended values: # 1 = Local testing / debugging # 2–3 = Railway or small VPS (recommended) # 4+ = Large VPS (advanced users only) # # Does NOT limit downloads MAX_CONCURRENT_TRANSFERS=3 # ========================= # Rate Limiting # ========================= # Maximum number of requests per IP GLOBAL_RATE_LIMIT_REQUESTS=60 # Time window in seconds GLOBAL_RATE_LIMIT_WINDOW=10 # ========================= # Access Control (Optional) # ========================= # Comma-separated Telegram user IDs allowed to use the bot # Example: 123456789,987654321 # Leave empty to allow everyone ALLOWED_USER_IDS=123456789 # ========================= # Admin Dashboard (Optional) # ========================= # Enable or disable admin dashboard entirely ADMIN_ENABLED=true # Admin login credentials # Used to access: /admin ADMIN_EMAIL=admin@example.com ADMIN_PASSWORD=change-me-now # Secret key used to sign admin session cookies # Generate with: # python -c "import secrets; print(secrets.token_urlsafe(32))" SESSION_SECRET=change-this-to-a-long-random-string # ========================= # Storage Backend (Optional) # ========================= # Storage backend to use for uploaded files # # Available options: # - local (default): store files in ./uploads # - s3: store files in an S3-compatible bucket # # To enable S3-compatible storage: STORAGE_BACKEND=local # ------------------------- # S3-Compatible Storage # ------------------------- # # This project supports S3-compatible object storage such as: # - Railway Storage Buckets (recommended on Railway) # - AWS S3 # - Cloudflare R2 # # IMPORTANT: # - On Railway, these variables are injected automatically # when you connect a Storage Bucket to the service. # - You do NOT need to set them manually on Railway. # # Uncomment and configure ONLY if you are using S3 outside Railway. # # AWS_ENDPOINT_URL=https://storage.example.com # AWS_S3_BUCKET_NAME=your-bucket-name # AWS_DEFAULT_REGION=auto # AWS_ACCESS_KEY_ID=your-access-key # AWS_SECRET_ACCESS_KEY=your-secret-key