Switch from Meta Business Cloud API to Evolution API for WhatsApp integration. Evolution API is self-hosted, free, and connects via WhatsApp Web QR code scan. - Add docker-compose for Evolution API deployment - Rewrite whatsapp_service.py for Evolution API endpoints - Add instance management (create, QR, status, logout) to blueprint - Add QR code scanning UI with connection status indicator - Add duplicate message prevention in webhook handler - Update config.py with EVOLUTION_API_URL/KEY (remove old Meta vars) - Add setup documentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
42 lines
1.4 KiB
Python
42 lines
1.4 KiB
Python
import os
|
|
|
|
MASTER_DB_URL = os.environ.get(
|
|
"MASTER_DB_URL",
|
|
"postgresql://nexus:nexus_autoparts_2026@localhost/nexus_autoparts"
|
|
)
|
|
|
|
TENANT_DB_URL_TEMPLATE = os.environ.get(
|
|
"TENANT_DB_URL_TEMPLATE",
|
|
"postgresql://nexus:nexus_autoparts_2026@localhost/{db_name}"
|
|
)
|
|
|
|
JWT_SECRET = os.environ.get("POS_JWT_SECRET", "nexus-pos-secret-change-in-prod-2026")
|
|
JWT_ACCESS_EXPIRES = 28800 # 8 hours (full shift)
|
|
JWT_REFRESH_EXPIRES = 2592000 # 30 days
|
|
|
|
PIN_MAX_ATTEMPTS_PER_MINUTE = 5
|
|
PIN_LOCKOUT_THRESHOLD = 10
|
|
PIN_LOCKOUT_MINUTES = 15
|
|
|
|
TENANT_TEMPLATE_DB = "tenant_template"
|
|
|
|
OPENROUTER_API_KEY = os.environ.get(
|
|
"OPENROUTER_API_KEY",
|
|
"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"
|
|
)
|
|
|
|
# SMTP for email quotations / notifications
|
|
SMTP_HOST = os.environ.get('SMTP_HOST', 'smtp.gmail.com')
|
|
SMTP_PORT = int(os.environ.get('SMTP_PORT', '587'))
|
|
SMTP_USER = os.environ.get('SMTP_USER', '')
|
|
SMTP_PASS = os.environ.get('SMTP_PASS', '')
|
|
SMTP_FROM = os.environ.get('SMTP_FROM', 'noreply@nexusautoparts.com')
|
|
|
|
# Evolution API (self-hosted WhatsApp via WhatsApp Web protocol)
|
|
EVOLUTION_API_URL = os.environ.get('EVOLUTION_API_URL', 'http://localhost:8080')
|
|
EVOLUTION_API_KEY = os.environ.get('EVOLUTION_API_KEY', 'nexus-evolution-key-2026')
|
|
|
|
# Multi-currency
|
|
DEFAULT_CURRENCY = os.environ.get('DEFAULT_CURRENCY', 'MXN')
|
|
EXCHANGE_RATE_USD_MXN = float(os.environ.get('EXCHANGE_RATE_USD_MXN', '17.5'))
|