# Essential Configuration - Only these variables are required for basic setup
# Authentication token for all interfaces (REST API, MCP server, Web UI)
AUTH_TOKEN=your-secret-token-here
# Database password (required for security)
DB_PASSWORD=your-database-password-here
# Optional Configuration - Uncomment and modify if needed
# Application settings
# PORT=5000
# NODE_ENV=production
# MCP_SERVER_ENABLED=true
# Base path/URL for nginx subpath deployment
#
# Runtime Configuration Support:
# The application supports runtime base path configuration, allowing the same built
# frontend assets to work with different deployment paths without rebuilding.
#
# Configuration Options:
# - BASE_URL: Full URL including protocol and domain (e.g., "https://example.com/md")
# When set, the path portion is extracted and used as the base path
# - BASE_PATH: Path-only configuration (e.g., "/md", "md", "/app/articles")
# BASE_URL takes precedence if both are set
#
# Path Normalization:
# - Leading slash is automatically added if missing
# - Trailing slash is automatically removed
# - Invalid characters are rejected with fallback to root path
# - Empty or unset values default to root path ("/") deployment
#
# Docker Container Support:
# These variables can be set in docker-compose.yml environment section
# or passed as environment variables when running containers
#
# Examples:
# BASE_URL=https://example.com/md # Full URL (path "/md" extracted)
# BASE_PATH=/md # Path only
# BASE_PATH=articles # Normalized to "/articles"
# BASE_PATH=/app/docs/ # Normalized to "/app/docs"
#
# Leave empty or unset for root path deployment:
# BASE_URL=
# BASE_PATH=
# Database settings (defaults work for most setups)
# DB_HOST=localhost
# DB_PORT=5432
# DB_NAME=article_manager
# DB_USER=article_user
# DB_SSL=false
# Semantic search (disabled by default)
# SEMANTIC_SEARCH_ENABLED=false
# EMBEDDING_PROVIDER=ollama
# EMBEDDING_MODEL=nomic-embed-text
# OLLAMA_BASE_URL=http://host.docker.internal:11434
# OPENAI_API_KEY=
# MCP_MULTI_SEARCH_LIMIT=10
# Background embedding queue configuration
# EMBEDDING_QUEUE_ENABLED=true
# EMBEDDING_QUEUE_WORKER_INTERVAL=5000
# EMBEDDING_QUEUE_MAX_RETRIES=3
# EMBEDDING_QUEUE_RETRY_BACKOFF_BASE=1000
# EMBEDDING_QUEUE_BATCH_SIZE=1
# EMBEDDING_QUEUE_CLEANUP_INTERVAL=24
# EMBEDDING_QUEUE_CLEANUP_RETENTION_DAYS=30
# EMBEDDING_QUEUE_HEARTBEAT_INTERVAL=30000
# EMBEDDING_QUEUE_METRICS_INTERVAL=60000
# EMBEDDING_QUEUE_MAX_PROCESSING_TIME=1800000
# EMBEDDING_QUEUE_STUCK_TASK_CLEANUP_ENABLED=true
# Advanced Configuration - For production tuning and customization
# Database performance tuning
# DB_MAX_CONNECTIONS=100
# APP_DB_MAX_CONNECTIONS=20
# DB_IDLE_TIMEOUT=30000
# DB_CONNECTION_TIMEOUT=2000
# DB_SHARED_BUFFERS=256MB
# DB_EFFECTIVE_CACHE_SIZE=1GB
# Backup settings
# BACKUP_DIR=./backups
# RETENTION_DAYS=30
# COMPRESS_BACKUPS=true
# Container customization
# POSTGRES_IMAGE=pgvector/pgvector:pg16
# APP_IMAGE=ghcr.io/joelmnz/mcp-markdown-manager:latest
# RESTART_POLICY=unless-stopped
# Health check intervals
# HEALTH_CHECK_INTERVAL=10s
# APP_HEALTH_CHECK_INTERVAL=30s