# Cloudflare Tunnel Configuration Template
# Copy this file to .env.cloudflare and fill in your values
# Run ./scripts/setup-cloudflare-tunnel.sh to automatically configure

# ============================================
# TUNNEL IDENTIFICATION
# ============================================
# Your unique tunnel ID from Cloudflare
# Get this by running: cloudflared tunnel list
# Or use the setup script to automatically configure
TUNNEL_ID=your-tunnel-id-here

# The name you gave your tunnel (must match Cloudflare)
TUNNEL_NAME=fastmcp-server

# The hostname/domain where your tunnel will be accessible
# Example: fastmcp.yourdomain.com or app.example.com
TUNNEL_HOSTNAME=your-hostname-here

# ============================================
# TUNNEL SETTINGS
# ============================================
# Metrics endpoint for monitoring tunnel health
# Default: 0.0.0.0:2000 (accessible in Docker network)
TUNNEL_METRICS=0.0.0.0:2000

# Logging level (debug, info, warn, error)
# Default: info
TUNNEL_LOGLEVEL=info

# ============================================
# SETUP INSTRUCTIONS
# ============================================
# 1. Install cloudflared:
#    - macOS: brew install cloudflared
#    - Linux: https://github.com/cloudflare/cloudflared/releases
#    - Windows: https://github.com/cloudflare/cloudflared/releases
#
# 2. Run the automated setup script:
#    ./scripts/setup-cloudflare-tunnel.sh
#
# 3. Or manually configure:
#    a. Login to Cloudflare:
#       cloudflared tunnel login
#    
#    b. Create a tunnel:
#       cloudflared tunnel create fastmcp-server
#    
#    c. Copy the tunnel credentials:
#       cp ~/.cloudflared/<tunnel-id>.json credentials/tunnel-credentials.json
#    
#    d. Configure DNS:
#       cloudflared tunnel route dns fastmcp-server your-hostname.com
#    
#    e. Update this file with your TUNNEL_ID and TUNNEL_HOSTNAME
#
# 4. Start your FastMCP server with tunnel:
#    docker-compose up -d
#
# 5. Access your server at:
#    https://your-hostname.com
#
# ============================================
# NOTES
# ============================================
# - The tunnel credentials file must exist at:
#   credentials/tunnel-credentials.json
#
# - DNS must be configured in Cloudflare for your hostname
#
# - Your FastMCP server will be accessible via HTTPS automatically
#   (Cloudflare provides SSL/TLS certificates)
#
# - No inbound firewall ports need to be opened (tunnel is outbound-only)
#
# - Monitor tunnel status:
#   docker-compose logs -f cloudflared
#
# - Check tunnel health:
#   curl http://localhost:2000/metrics