# FastMCP2 Google Workspace Platform - Cloud Deployment Configuration
# Copy this file to your FastMCP Cloud environment variables

# ============================================
# DEPLOYMENT MODE CONFIGURATION
# ============================================
# For FastMCP Cloud deployment: FASTMCP_CLOUD=true
# For local HTTPS deployment: FASTMCP_CLOUD=false (or don't set at all)
FASTMCP_CLOUD=true

# ============================================
# GOOGLE OAUTH CONFIGURATION
# ============================================
# Get these from Google Cloud Console > APIs & Services > Credentials
GOOGLE_CLIENT_ID=your_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_client_secret

# OAuth redirect URI (replace 'your-project-name' with your actual project name)
OAUTH_REDIRECT_URI=https://your-project-name.fastmcp.app/oauth2callback

# ============================================
# SERVER CONFIGURATION
# ============================================
# FastMCP Cloud will override these, but they're needed for configuration
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
SERVER_NAME=FastMCP2 Google Workspace Platform

# ============================================
# CREDENTIAL STORAGE (CLOUD-OPTIMIZED)
# ============================================
# Use memory-based storage for cloud deployment
CREDENTIAL_STORAGE_MODE=MEMORY_WITH_BACKUP
CREDENTIALS_DIR=/tmp/credentials

# ============================================
# SSL/HTTPS (DISABLED FOR CLOUD)
# ============================================
# FastMCP Cloud handles SSL automatically
ENABLE_HTTPS=false

# ============================================
# QDRANT CLOUD CONFIGURATION
# ============================================
# Replace with your Qdrant Cloud cluster details
QDRANT_URL=https://your-cluster-id.qdrant.io:6333
QDRANT_API_KEY=your_qdrant_cloud_api_key

# ============================================
# AUTHENTICATION & SESSION MANAGEMENT
# ============================================
SESSION_TIMEOUT_MINUTES=60
USE_GOOGLE_OAUTH=true
ENABLE_JWT_AUTH=false

# ============================================
# GMAIL CONFIGURATION
# ============================================
# Comma-separated list of trusted email addresses (no elicitation needed)
GMAIL_ALLOW_LIST=trusted@example.com,team@company.com
GMAIL_ENABLE_ELICITATION=true
GMAIL_ELICITATION_FALLBACK=block

# ============================================
# OAUTH MIGRATION FEATURE FLAGS
# ============================================
ENABLE_UNIFIED_AUTH=true
LEGACY_COMPAT_MODE=true
CREDENTIAL_MIGRATION=true
SERVICE_CACHING=true
ENHANCED_LOGGING=true

# ============================================
# FASTMCP 2.12.0 GOOGLEPROVIDER
# ============================================
# For cloud server + localhost OAuth pattern:
FASTMCP_SERVER_AUTH=GOOGLE
FASTMCP_SERVER_AUTH_GOOGLE_CLIENT_ID=your_client_id.apps.googleusercontent.com
FASTMCP_SERVER_AUTH_GOOGLE_CLIENT_SECRET=your_client_secret
FASTMCP_SERVER_AUTH_GOOGLE_BASE_URL=https://your-project-name.fastmcp.app/mcp

# ============================================
# LOGGING CONFIGURATION
# ============================================
LOG_LEVEL=INFO

# ============================================
# TESTING CONFIGURATION (OPTIONAL)
# ============================================
# For testing purposes only - replace with your test accounts
TEST_USER_EMAIL=your.test@gmail.com
TEST_CHAT_WEBHOOK=https://chat.googleapis.com/v1/spaces/YOUR_SPACE/messages

# ============================================
# CHAT SERVICE ACCOUNT (OPTIONAL)
# ============================================
# Only needed if using Google Chat service account features
CHAT_SERVICE_ACCOUNT_FILE=

# ============================================
# CLOUD PLATFORM CONFIGURATION
# ============================================
# Base URL will be automatically set by FastMCP Cloud
BASE_URL=https://your-project-name.fastmcp.app

# ============================================
# INSTRUCTIONS FOR DEPLOYMENT
# ============================================
# 1. Replace 'your-project-name' with your actual FastMCP Cloud project name
# 2. Replace Google OAuth credentials with your actual values
# 3. Replace Qdrant Cloud URL and API key with your actual values
# 4. Update Gmail allow list with your trusted email addresses
# 5. Configure these variables in your FastMCP Cloud dashboard
# 6. Update OAuth redirect URIs in Google Cloud Console to include BOTH:
#    https://your-project-name.fastmcp.app/oauth2callback (backup/alternative)
#    http://localhost:8002/oauth2callback (desktop app pattern)
# 7. This enables cloud server with localhost OAuth redirects (like GitHub Desktop)