# ThrillWiki Deployment Service Environment Configuration # This file is generated automatically by the deployment system and integrates # with deployment presets for consistent configuration across environments. # # Security Note: This file should have restricted permissions (600) as it may contain # sensitive information like GitHub Personal Access Tokens # ============================================================================ # PROJECT CONFIGURATION # ============================================================================ # Base project directory PROJECT_DIR=/home/thrillwiki/thrillwiki # Service name for systemd integration SERVICE_NAME=thrillwiki-deployment # Deployment mode (automated|manual|timer) DEPLOYMENT_MODE=automated # ============================================================================ # GITHUB REPOSITORY CONFIGURATION # ============================================================================ # GitHub repository remote name GITHUB_REPO=origin # Branch to pull from GITHUB_BRANCH=main # GitHub Personal Access Token (PAT) - Required for private repositories # This will be populated automatically during deployment setup # GITHUB_TOKEN= # GitHub token file location (alternative to GITHUB_TOKEN) GITHUB_TOKEN_FILE=/home/thrillwiki/thrillwiki/.github-pat # ============================================================================ # DEPLOYMENT PRESET CONFIGURATION # ============================================================================ # Deployment preset (dev, prod, demo, testing) # This determines the automation timing and behavior DEPLOYMENT_PRESET=dev # ============================================================================ # AUTOMATION TIMING CONFIGURATION (Preset-based) # ============================================================================ # Repository pull interval in seconds # Default values by preset: # - dev: 60s (1 minute) # - prod: 300s (5 minutes) # - demo: 120s (2 minutes) # - testing: 180s (3 minutes) PULL_INTERVAL=60 # Health check interval in seconds HEALTH_CHECK_INTERVAL=30 # Server startup timeout in seconds STARTUP_TIMEOUT=120 # Restart delay after failure in seconds RESTART_DELAY=10 # ============================================================================ # DEPLOYMENT BEHAVIOR CONFIGURATION (Preset-based) # ============================================================================ # Debug mode for troubleshooting DEBUG_MODE=true # Enable automatic dependency updates AUTO_UPDATE_DEPENDENCIES=true # Enable automatic migrations on code changes AUTO_MIGRATE=true # Enable automatic static file collection AUTO_COLLECTSTATIC=true # Log level (DEBUG|INFO|WARNING|ERROR) LOG_LEVEL=DEBUG # ============================================================================ # SECURITY CONFIGURATION (Preset-based) # ============================================================================ # Django debug mode DJANGO_DEBUG=true # SSL required SSL_REQUIRED=false # CORS allowed CORS_ALLOWED=true # Allowed hosts (comma-separated) ALLOWED_HOSTS=* # ============================================================================ # LOGGING CONFIGURATION # ============================================================================ # Log directory LOG_DIR=/home/thrillwiki/thrillwiki/logs # Log file path for deployment automation LOG_FILE=/home/thrillwiki/thrillwiki/logs/deployment-automation.log # Maximum log file size in bytes (10MB default) MAX_LOG_SIZE=10485760 # Lock file location to prevent multiple instances LOCK_FILE=/tmp/thrillwiki-deployment.lock # ============================================================================ # DEVELOPMENT SERVER CONFIGURATION # ============================================================================ # Server host address SERVER_HOST=0.0.0.0 # Server port SERVER_PORT=8000 # Health check URL HEALTH_CHECK_URL=http://localhost:8000/ # Health check timeout in seconds HEALTH_CHECK_TIMEOUT=30 # ============================================================================ # DJANGO CONFIGURATION # ============================================================================ # Django settings module DJANGO_SETTINGS_MODULE=thrillwiki.settings # Python path PYTHONPATH=/home/thrillwiki/thrillwiki # UV executable path UV_EXECUTABLE=/home/thrillwiki/.local/bin/uv # Django development server command (following .clinerules) DJANGO_RUNSERVER_CMD=lsof -ti :8000 | xargs kill -9; find . -type d -name '__pycache__' -exec rm -r {} +; uv run manage.py tailwind runserver # Enable development server auto-cleanup AUTO_CLEANUP_PROCESSES=true # ============================================================================ # SYSTEMD SERVICE CONFIGURATION # ============================================================================ # Service user and group SERVICE_USER=thrillwiki SERVICE_GROUP=thrillwiki # Service working directory SERVICE_WORKING_DIR=/home/thrillwiki/thrillwiki # Service restart policy SERVICE_RESTART=always SERVICE_RESTART_SEC=30 # Service timeout configuration SERVICE_TIMEOUT_START=180 SERVICE_TIMEOUT_STOP=120 # Maximum restart attempts MAX_RESTART_ATTEMPTS=3 # Restart cooldown period RESTART_COOLDOWN=300 # ============================================================================ # SMART DEPLOYMENT TIMER CONFIGURATION # ============================================================================ # Timer service configuration TIMER_ON_BOOT_SEC=5min TIMER_ON_UNIT_ACTIVE_SEC=5min TIMER_RANDOMIZED_DELAY_SEC=30sec TIMER_PERSISTENT=true # ============================================================================ # MONITORING AND HEALTH CHECKS # ============================================================================ # Enable system resource monitoring MONITOR_RESOURCES=true # Memory usage threshold for warnings (in MB) MEMORY_WARNING_THRESHOLD=512 # CPU usage threshold for warnings (percentage) CPU_WARNING_THRESHOLD=70 # Disk usage threshold for warnings (percentage) DISK_WARNING_THRESHOLD=85 # ============================================================================ # INTEGRATION SETTINGS # ============================================================================ # Integration with other services WEBHOOK_INTEGRATION=false # Email notifications for critical failures # NOTIFICATION_EMAIL= # Maximum consecutive failures before alerting MAX_CONSECUTIVE_FAILURES=5 # ============================================================================ # ADVANCED CONFIGURATION # ============================================================================ # Enable verbose logging VERBOSE_LOGGING=true # Custom git remote URL (overrides GITHUB_REPO if set) # CUSTOM_GIT_REMOTE= # GitHub authentication method (token|ssh|https) GITHUB_AUTH_METHOD=token # SSH key path for git operations (when using ssh auth method) # SSH_KEY_PATH=/home/thrillwiki/.ssh/id_rsa # Git user configuration for commits GIT_USER_NAME="ThrillWiki Deployment" GIT_USER_EMAIL="deployment@thrillwiki.local" # ============================================================================ # ENVIRONMENT AND SYSTEM CONFIGURATION # ============================================================================ # System PATH additions (for UV and other tools) ADDITIONAL_PATH=/home/thrillwiki/.local/bin:/home/thrillwiki/.cargo/bin # Python environment configuration PYTHON_EXECUTABLE=python3 # Service state and runtime directories SERVICE_LOGS_DIR=/var/log/thrillwiki-deployment SERVICE_STATE_DIR=/var/lib/thrillwiki-deployment SERVICE_RUNTIME_DIR=/run/thrillwiki-deployment # ============================================================================ # PRESET-SPECIFIC OVERRIDES # ============================================================================ # The following section contains preset-specific configurations that override # the defaults above based on the DEPLOYMENT_PRESET value. # These are automatically applied by the deployment system. # Development preset overrides (applied when DEPLOYMENT_PRESET=dev) # PULL_INTERVAL=60 # HEALTH_CHECK_INTERVAL=30 # DEBUG_MODE=true # AUTO_MIGRATE=true # AUTO_UPDATE_DEPENDENCIES=true # LOG_LEVEL=DEBUG # SSL_REQUIRED=false # CORS_ALLOWED=true # DJANGO_DEBUG=true # ALLOWED_HOSTS=* # Production preset overrides (applied when DEPLOYMENT_PRESET=prod) # PULL_INTERVAL=300 # HEALTH_CHECK_INTERVAL=60 # DEBUG_MODE=false # AUTO_MIGRATE=true # AUTO_UPDATE_DEPENDENCIES=false # LOG_LEVEL=WARNING # SSL_REQUIRED=true # CORS_ALLOWED=false # DJANGO_DEBUG=false # ALLOWED_HOSTS=production-host # Demo preset overrides (applied when DEPLOYMENT_PRESET=demo) # PULL_INTERVAL=120 # HEALTH_CHECK_INTERVAL=45 # DEBUG_MODE=false # AUTO_MIGRATE=true # AUTO_UPDATE_DEPENDENCIES=true # LOG_LEVEL=INFO # SSL_REQUIRED=false # CORS_ALLOWED=true # DJANGO_DEBUG=false # ALLOWED_HOSTS=demo-host # Testing preset overrides (applied when DEPLOYMENT_PRESET=testing) # PULL_INTERVAL=180 # HEALTH_CHECK_INTERVAL=30 # DEBUG_MODE=true # AUTO_MIGRATE=true # AUTO_UPDATE_DEPENDENCIES=true # LOG_LEVEL=DEBUG # SSL_REQUIRED=false # CORS_ALLOWED=true # DJANGO_DEBUG=true # ALLOWED_HOSTS=test-host # ============================================================================ # INSTALLATION AND SECURITY NOTES # ============================================================================ # For security, ensure only the thrillwiki user can read this file: # sudo chown thrillwiki:thrillwiki thrillwiki-deployment.env # sudo chmod 600 thrillwiki-deployment.env # Service management commands: # sudo systemctl enable thrillwiki-deployment.service # sudo systemctl enable thrillwiki-smart-deploy.timer # sudo systemctl start thrillwiki-deployment.service # sudo systemctl start thrillwiki-smart-deploy.timer # sudo systemctl status thrillwiki-deployment.service # sudo journalctl -u thrillwiki-deployment -f