# =============================================================================
# RSS2 - Variables de entorno para despliegue Debian nativo
# Copiar a /opt/rss2/.env y editar valores antes de instalar
# =============================================================================

# --- PostgreSQL ---
POSTGRES_DB=rss
POSTGRES_USER=rss
POSTGRES_PASSWORD=CAMBIA_ESTO_postgres_password

# Usadas por workers Go (equivalente a DATABASE_URL)
DB_HOST=127.0.0.1
DB_PORT=5432
DB_NAME=rss
DB_USER=rss
DB_PASS=CAMBIA_ESTO_postgres_password

# URL completa para backend API Go
DATABASE_URL=postgres://rss:CAMBIA_ESTO_postgres_password@127.0.0.1:5432/rss?sslmode=disable

# --- Redis ---
REDIS_PASSWORD=CAMBIA_ESTO_redis_password
REDIS_URL=redis://:CAMBIA_ESTO_redis_password@127.0.0.1:6379

# --- JWT Secret (minimo 32 caracteres, aleatorio) ---
SECRET_KEY=CAMBIA_ESTO_jwt_secret_muy_largo_y_aleatorio

# --- Backend API ---
SERVER_PORT=8080

# --- Zona horaria ---
TZ=Europe/Madrid

# --- HuggingFace cache (modelos ML) ---
HF_HOME=/opt/rss2/hf_cache

# --- Endpoints ML opcionales (solo si corres Ollama o LibreTranslate por separado) ---
# Los workers Python van directo a BD; estos endpoints solo los usa el backend para
# llamadas on-demand desde el panel admin (NER, traduccion manual, etc.)
TRANSLATION_URL=http://127.0.0.1:7790
OLLAMA_URL=http://127.0.0.1:11434
SPACY_URL=http://127.0.0.1:8000

# --- Qdrant (local, sin Docker) ---
QDRANT_HOST=127.0.0.1
QDRANT_PORT=6333
QDRANT_COLLECTION=news_vectors

# --- Translator (NLLB-200 via CTranslate2) ---
TARGET_LANGS=es
TRANSLATOR_BATCH=32
CT2_MODEL_PATH=/opt/rss2/models/nllb-ct2
CT2_DEVICE=cpu
CT2_COMPUTE_TYPE=int8
UNIVERSAL_MODEL=facebook/nllb-200-distilled-600M

# --- Embeddings ---
EMB_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
EMB_BATCH=64
EMB_SLEEP_IDLE=5
EMB_LANGS=es
EMB_LIMIT=1000
DEVICE=cpu

# --- NER ---
NER_LANG=es
NER_BATCH=64

# --- Ingestor RSS ---
RSS_MAX_WORKERS=100
RSS_POKE_INTERVAL_MIN=15

# --- Scraper ---
SCRAPER_SLEEP=60
SCRAPER_BATCH=10

# --- Discovery ---
DISCOVERY_INTERVAL=900
DISCOVERY_BATCH=10
MAX_FEEDS_PER_URL=5

# --- Wiki Worker ---
WIKI_SLEEP=10

# --- Topics ---
TOPICS_SLEEP=10
TOPICS_BATCH=500

# --- Related ---
RELATED_SLEEP=10
RELATED_BATCH=200
RELATED_TOPK=10

# --- Cluster ---
EVENT_DIST_THRESHOLD=0.35

# --- Categorizer ---
CATEGORIZER_BATCH_SIZE=10
CATEGORIZER_SLEEP_IDLE=5

# --- Scheduler traduccion ---
SCHEDULER_BATCH=1000
SCHEDULER_SLEEP=30

# --- Lang Detect ---
LANG_DETECT_SLEEP=60
LANG_DETECT_BATCH=1000

# --- Qdrant Worker ---
QDRANT_SLEEP=30
QDRANT_BATCH=100
