# ============================================================================= # Discord Gaming Automation Hub — Environment Configuration # ============================================================================= # Copy this file to `.env` and fill in your values. # Every setting is optional by default; defaults are defined in the application. # Do NOT commit real secrets to version control. # ============================================================================= # ----------------------------------------------------------------------------- # Core Application # ----------------------------------------------------------------------------- # Human-readable application name used in logs and embeds. APP_NAME="GamingHub" # Runtime mode: development | production | test. # In production, the bot connects to Discord and scheduled automations run. ENVIRONMENT="development" # Debug flag. When true, extra logging and verbose error responses are enabled. DEBUG="false" # Secret key used for internal webhook/API signature validation. # Generate a strong random value for production. SECRET_KEY="change-me-in-production" # Test mode — when true, publish every poster channel once on startup # without waiting for scheduled dates. Useful for testing without n8n. TEST_MODE="false" # Monthly force refresh — one-time utility. When true, deletes the existing # July 2026 Discord messages for post_major_updates and post_coming_soon, # regenerates them with the corrected collectors, and updates the stored # message IDs. Set back to false after the refresh runs. MONTHLY_FORCE_REFRESH="false" # ----------------------------------------------------------------------------- # Discord # ----------------------------------------------------------------------------- # Discord bot token from the Discord Developer Portal. # Required for any Discord functionality. DISCORD_TOKEN="" # ID of the target Discord guild (server) for slash command registration. # If empty, commands are registered globally (slower propagation). DISCORD_GUILD_ID="" # Comma-separated list of guild IDs for instant slash command registration. # Example: "123456789012345678,987654321098765432" DISCORD_GUILD_IDS="[]" # Prefix used for legacy/debug prefix commands (optional; slash commands are primary). DISCORD_PREFIX="!gh" # Default channel IDs for automatic postings (used by n8n-triggered posters). # Set each to the snowflake ID of the target channel. Leave empty to skip the # corresponding automatic poster. DISCORD_DEFAULT_CHANNEL_ID="" DISCORD_FREE_GAMES_CHANNEL_ID="" DISCORD_CRAZY_DISCOUNTS_CHANNEL_ID="" DISCORD_TOP_GAMES_CHANNEL_ID="" DISCORD_MAJOR_UPDATES_CHANNEL_ID="" DISCORD_COMING_SOON_CHANNEL_ID="" # Role ID or user IDs allowed to run admin/debug commands (comma separated). DISCORD_ADMIN_IDS="[]" # ----------------------------------------------------------------------------- # Gaming Preferences # ----------------------------------------------------------------------------- # Comma-separated list of favorite genres used by /discount recommendations. # Example: "RPG,Action,Strategy,Indie" FAVORITE_GENRES='["RPG","Action","Indie"]' # Minimum discount percentage (0-100) for a deal to be considered "crazy". CRAZY_DISCOUNT_THRESHOLD="80" # Number of days the /new command should look back for releases. NEW_RELEASE_DAYS="7" # Default number of results returned by search and listing commands. DEFAULT_PAGE_SIZE="10" # Maximum page size allowed across the application. MAX_PAGE_SIZE="50" # Number of historical suggestions to remember to avoid repeats in /surprise. SURPRISE_HISTORY_SIZE="50" # Number of days ahead to look for upcoming releases in #coming-soon. UPCOMING_DAYS_AHEAD="30" # ----------------------------------------------------------------------------- # External Providers # ----------------------------------------------------------------------------- # CheapShark API base URL. Change only if the provider moves endpoints. CHEAPSHARK_BASE_URL="https://www.cheapshark.com/api/1.0" # Epic Games Catalog / Store API base URL. EPIC_BASE_URL="https://store-site-backend-static.ak.epicgames.com" # Epic Games GraphQL URL (used for promotions and free games when required). EPIC_GRAPHQL_URL="https://graphql.epicgames.com/graphql" # Steam Community base URL. STEAM_COMMUNITY_BASE_URL="https://steamcommunity.com" # Steam Store base URL. STEAM_STORE_BASE_URL="https://store.steampowered.com" # IsThereAnyDeal API base URL. ISTHEREANYDEAL_BASE_URL="https://api.isthereanydeal.com" # IsThereAnyDeal API key (free; optional but recommended). # Some endpoints work without a key; check provider documentation. ISTHEREANYDEAL_API_KEY="" # RAWG API base URL. RAWG_BASE_URL="https://api.rawg.io/api" # RAWG video game database API key (free; required). # Sign up at https://rawg.io/register/developer to get a key. # Free tier: 20 000 requests / month, no credit card needed. RAWG_API_KEY="" # ----------------------------------------------------------------------------- # HTTP & Caching # ----------------------------------------------------------------------------- # Default timeout in seconds for outbound HTTP requests. HTTP_TIMEOUT="30" # Number of retries for flaky provider requests before giving up. HTTP_MAX_RETRIES="3" # Cache backend: memory | sqlite | redis. # Redis is allowed but optional; the project aims for zero-cost local hosting. CACHE_BACKEND="memory" # Cache TTL in seconds for provider responses. CACHE_TTL_SECONDS="300" # ----------------------------------------------------------------------------- # Database # ----------------------------------------------------------------------------- # SQLite database URI. Absolute path recommended for Docker. DATABASE_URL="sqlite+aiosqlite:///data/gaming_hub.db" # Echo SQL statements in logs (useful for debugging, noisy in production). DATABASE_ECHO="false" # ----------------------------------------------------------------------------- # Web API (used by n8n / internal automations) # ----------------------------------------------------------------------------- # Host and port the internal FastAPI application binds to. API_HOST="0.0.0.0" API_PORT="8000" # Comma-separated list of trusted IP ranges for automation webhooks. # n8n container IP should be included here in Docker mode. API_TRUSTED_HOSTS='["127.0.0.1","::1","172.0.0.0/8"]' # ----------------------------------------------------------------------------- # Automation / n8n # ----------------------------------------------------------------------------- # Enable or disable scheduled automations (n8n triggers and internal scheduler). AUTOMATION_ENABLED="true" # Webhook path prefix for n8n-triggered actions. N8N_WEBHOOK_PREFIX="/webhooks/n8n" # Shared secret used to sign requests from n8n to the hub API. N8N_WEBHOOK_SECRET= # ----------------------------------------------------------------------------- # Google Calendar # ----------------------------------------------------------------------------- # Master toggle. When false the CalendarService is never instantiated. ENABLE_GOOGLE_CALENDAR="false" # Path to service account JSON file relative to project root. # Leave empty to disable Google Calendar integration. GOOGLE_CALENDAR_CREDENTIALS_PATH="" # Service account JSON key as a (single-line) string. # Takes precedence over GOOGLE_CALENDAR_CREDENTIALS_PATH when set. GOOGLE_SERVICE_ACCOUNT_JSON="" # Target calendar ID (email format) for event creation. GOOGLE_CALENDAR_ID="" # Default reminder minutes before a calendar event (0 = no reminder). GOOGLE_CALENDAR_DEFAULT_REMINDER_MINUTES="60" # Number of years ahead to synchronise on startup (default 1). GOOGLE_SYNC_YEARS_AHEAD="1" # Full sync when the bot starts. Requires ENABLE_GOOGLE_CALENDAR=true. GOOGLE_SYNC_ON_STARTUP="false" # Delete past events from the calendar during sync. GOOGLE_DELETE_OLD_EVENTS="false" # Google Calendar colour ID for game-release events (1-11). GOOGLE_EVENT_COLOR_RELEASES="9" # Google Calendar colour ID for major-update events (1-11). GOOGLE_EVENT_COLOR_UPDATES="10" # ----------------------------------------------------------------------------- # Free Games # ----------------------------------------------------------------------------- # Hours before a free game expires to flag as "expiring soon" (default 48). FREE_GAMES_EXPIRY_HOURS="48" # ----------------------------------------------------------------------------- # Logging # ----------------------------------------------------------------------------- # Log level: DEBUG | INFO | WARNING | ERROR | CRITICAL. LOG_LEVEL="INFO" # Structured JSON logs when true; human-readable logs when false. LOG_JSON="false" # Log file path. Leave empty to log only to stdout. LOG_FILE_PATH="" # Enable file log rotation (max 5 MB, keeps 3 backups). LOG_ROTATION="false"