# =============================================================================
# Marketing Parser — environment configuration template
# -----------------------------------------------------------------------------
# Copy to .env for local development, or to .env.production on the server.
# Both are gitignored. NEVER commit a filled-in copy.
#
#   REQUIRED — the application will not start without it.
#   OPTIONAL — has a working default in application.properties; override as needed.
#
# Load locally with:  set -a && source .env && set +a
# =============================================================================

# --- MongoDB -----------------------------------------------------------------
MONGODB_HOST=localhost                  # OPTIONAL (default: localhost)
MONGODB_PORT=27017                      # OPTIONAL (default: 27017)
MONGODB_DATABASE=parser_db              # OPTIONAL (default: parser_db)
MONGODB_AUTH_DATABASE=admin             # OPTIONAL (default: admin)
MONGODB_USERNAME=                       # REQUIRED
MONGODB_PASSWORD=                       # REQUIRED

# --- MinIO object storage (generated reports and images) ---------------------
MINIO_ENDPOINT=                         # REQUIRED e.g. http://minio.internal:9000
MINIO_ACCESS_KEY=                       # REQUIRED
MINIO_SECRET_KEY=                       # REQUIRED
MINIO_BUCKET_NAME=konturai              # OPTIONAL (default: konturai)

# --- Application security ----------------------------------------------------
# Both must be base64-encoded and at least 256 bits. Generate with:
#   openssl rand -base64 32
JWT_SECRET_BASE64=                      # REQUIRED — must match the issuing auth service
ENCRYPTION_SECRET_KEY=                  # REQUIRED — encrypts stored social media credentials

# --- OpenAI ------------------------------------------------------------------
OPENAI_API_KEY=                         # REQUIRED

# --- Ollama (self-hosted text model) -----------------------------------------
OLLAMA_HOST=http://localhost:11434      # OPTIONAL (default: http://localhost:11434)
OLLAMA_MODEL=gemma3:1b                  # OPTIONAL (default: gemma3:1b)

# --- Serper (Google search API) ----------------------------------------------
SERPER_API_KEY=                         # REQUIRED

# --- Deep research service ---------------------------------------------------
DEEP_RESEARCH_API_URL=                  # REQUIRED e.g. http://research.internal:3051

# --- Google Vertex AI (Imagen / Veo) -----------------------------------------
# Also requires the service-account JSON at src/main/resources/keys/google-key.json
GOOGLE_CLOUD_PROJECT_ID=                # REQUIRED
GOOGLE_CLOUD_LOCATION=us-central1       # OPTIONAL (default: us-central1)
IMAGE_GENERATION_PROVIDER=nano-banana   # OPTIONAL — nano-banana | openai

# --- Facebook posting --------------------------------------------------------
FACEBOOK_APP_ID=                        # REQUIRED
FACEBOOK_APP_SECRET=                    # REQUIRED
FACEBOOK_PAGE_ID=                       # REQUIRED
FACEBOOK_PAGE_TOKEN=                    # REQUIRED — long-lived page access token

# --- Facebook hot leads collector --------------------------------------------
FACEBOOK_LEADS_PAGE_ID=                 # REQUIRED
FACEBOOK_LEADS_ACCESS_TOKEN=            # REQUIRED
FACEBOOK_LEADS_CRON=0 */15 * * * *      # OPTIONAL (default: every 15 minutes)
FACEBOOK_LEADS_GRAPH_API_VERSION=v19.0  # OPTIONAL
FACEBOOK_LEADS_TIMEOUT_MS=30000         # OPTIONAL
FACEBOOK_LEADS_POSTS_PAGE_SIZE=25       # OPTIONAL
FACEBOOK_LEADS_COMMENTS_PAGE_SIZE=100   # OPTIONAL

# --- Facebook leads -> call centre sync --------------------------------------
FACEBOOK_LEADS_CALL_CENTER_ENABLED=true # OPTIONAL (default: true)
FACEBOOK_LEADS_CALL_CENTER_BASE_URL=    # OPTIONAL (default: http://localhost:8080)
FACEBOOK_LEADS_CALL_CENTER_AUTH_USERNAME=   # REQUIRED when the sync is enabled
FACEBOOK_LEADS_CALL_CENTER_AUTH_PASSWORD=   # REQUIRED when the sync is enabled
# Remaining FACEBOOK_LEADS_CALL_CENTER_* values (paths, actor, queue, timeout,
# subject prefix) have defaults in application.properties.

# --- Mail (report delivery) --------------------------------------------------
MAIL_HOST=smtp.gmail.com                # OPTIONAL (default: smtp.gmail.com)
MAIL_PORT=587                           # OPTIONAL (default: 587)
MAIL_USERNAME=                          # REQUIRED
MAIL_PASSWORD=                          # REQUIRED — Gmail app password, not the account password

# --- Schedulers --------------------------------------------------------------
PARSER_SCHEDULER_ENABLED=false          # OPTIONAL (default: false)
POSTING_SCHEDULER_ENABLED=true          # OPTIONAL (default: true)

# --- CORS --------------------------------------------------------------------
CORS_ALLOWED_ORIGINS=https://konturai.kz,https://www.konturai.kz   # OPTIONAL
CORS_ALLOWED_METHODS=GET,POST,PUT,PATCH,DELETE,OPTIONS             # OPTIONAL
CORS_ALLOWED_HEADERS=*                                            # OPTIONAL
CORS_EXPOSED_HEADERS=Location,Content-Disposition                 # OPTIONAL
CORS_ALLOW_CREDENTIALS=true                                       # OPTIONAL
CORS_MAX_AGE_SECONDS=3600                                         # OPTIONAL
