Files
cbc2027/.env.example
renato97 6058dc642e feat: Integración automática con Notion + análisis completo del código
- Instalado notion-client SDK oficial para integración robusta
- Refactorizado services/notion_service.py con SDK oficial de Notion
  - Rate limiting con retry y exponential backoff
  - Parser Markdown → Notion blocks (headings, bullets, paragraphs)
  - Soporte para pages y databases
  - Manejo robusto de errores

- Integración automática en document/generators.py
  - PDFs se suben automáticamente a Notion después de generarse
  - Contenido completo del resumen formateado con bloques
  - Metadata rica (tipo de archivo, path, fecha)

- Configuración de Notion en main.py
  - Inicialización automática al arrancar el servicio
  - Validación de credenciales

- Actualizado config/settings.py
  - Agregado load_dotenv() para cargar variables de .env
  - Configuración de Notion (NOTION_API, NOTION_DATABASE_ID)

- Scripts de utilidad creados:
  - test_notion_integration.py: Test de subida a Notion
  - test_pipeline_notion.py: Test del pipeline completo
  - verify_notion_permissions.py: Verificación de permisos
  - list_notion_pages.py: Listar páginas accesibles
  - diagnose_notion.py: Diagnóstico completo
  - create_notion_database.py: Crear database automáticamente
  - restart_service.sh: Script de reinicio del servicio

- Documentación completa en opus.md:
  - Análisis exhaustivo del codebase (42 archivos Python)
  - Bugs críticos identificados y soluciones
  - Mejoras de seguridad (autenticación, rate limiting, CORS, CSP)
  - Optimizaciones de rendimiento (Celery, Redis, PostgreSQL, WebSockets)
  - Plan de testing (estructura, ejemplos, 80% coverage goal)
  - Roadmap de implementación (6 sprints detallados)
  - Integración avanzada con Notion documentada

Estado: Notion funcionando correctamente, PDFs se suben automáticamente
2026-01-26 17:31:17 +00:00

85 lines
3.8 KiB
Plaintext

# =============================================================================
# CBCFacil Configuration Template
# =============================================================================
# Copy this file to .env.secrets and fill in your actual values
# NEVER commit .env.secrets to version control
# =============================================================================
# =============================================================================
# Application Configuration
# =============================================================================
DEBUG=false
LOG_LEVEL=INFO
# =============================================================================
# Nextcloud/WebDAV Configuration (Required for file sync)
# =============================================================================
NEXTCLOUD_URL=https://your-nextcloud.example.com/remote.php/webdav
NEXTCLOUD_USER=your_username
NEXTCLOUD_PASSWORD=your_secure_password
# =============================================================================
# AI Providers Configuration (Required for summarization)
# =============================================================================
# Option 1: Claude/Anthropic
ANTHROPIC_AUTH_TOKEN=your_claude_api_token_here
ZAI_BASE_URL=https://api.z.ai/api/anthropic
# Option 2: Google Gemini
GEMINI_API_KEY=your_gemini_api_key_here
# =============================================================================
# CLI Tools (Optional - for local AI tools)
# =============================================================================
CLAUDE_CLI_PATH=/path/to/claude # or leave empty
GEMINI_CLI_PATH=/path/to/gemini # or leave empty
# =============================================================================
# Telegram Notifications (Optional)
# =============================================================================
TELEGRAM_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
# =============================================================================
# Notion Integration (Optional - for automatic PDF uploads)
# =============================================================================
# Get your token from: https://developers.notion.com/docs/create-a-notion-integration
NOTION_API=ntn_YOUR_NOTION_INTEGRATION_TOKEN_HERE
# Get your database ID from the database URL in Notion
NOTION_DATABASE_ID=your_database_id_here
# =============================================================================
# Dashboard Configuration (Required for production)
# =============================================================================
# Generate a secure key with: python -c "import os; print(os.urandom(24).hex())"
DASHBOARD_SECRET_KEY=generate_a_secure_random_key_here
DASHBOARD_HOST=0.0.0.0
DASHBOARD_PORT=5000
# =============================================================================
# GPU Configuration (Optional)
# =============================================================================
# Use specific GPU: CUDA_VISIBLE_DEVICES=0
# Use all GPUs: CUDA_VISIBLE_DEVICES=all
CUDA_VISIBLE_DEVICES=all
PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512
# =============================================================================
# Performance Tuning (Optional)
# =============================================================================
OMP_NUM_THREADS=4
MKL_NUM_THREADS=4
# =============================================================================
# Processing Configuration (Optional)
# =============================================================================
POLL_INTERVAL=5
HTTP_TIMEOUT=30
WEBDAV_MAX_RETRIES=3
DOWNLOAD_CHUNK_SIZE=65536
# =============================================================================
# Logging (Optional)
# =============================================================================
LOG_FILE=logs/app.log