Harden LLM access: secrets only in server .env, no URL in repo.

Require LLM_BASE_URL and LLM_API_KEY for automatic generation, add per-user rate limits, stop publishing backend/LLM settings in docker-compose, and document secure deployment.
This commit is contained in:
Mireya Cueto Garrido
2026-06-04 13:24:40 +02:00
parent 182eae1e36
commit 4d2ced85a3
11 changed files with 487 additions and 169 deletions
+7 -4
View File
@@ -48,10 +48,13 @@ JWT_EXPIRE_MINUTES=1440
# El frontend obtiene un id_token con Google Identity Services y lo envía a POST /auth/google.
GOOGLE_CLIENT_ID=123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com
# --- LLM (Sinbad2IA UJA — sin clave) ---
# URL base del servidor; el cliente llama a {LLM_BASE_URL}/api/chat
# --- LLM (solo servidor; NO commitear valores reales) ---
# Obligatorias para POST /exam/generate. Sin ellas, la generación automática queda desactivada.
# La URL no debe aparecer en el repositorio: configúrala solo en el .env del servidor.
LLM_BASE_URL=
LLM_API_KEY=
LLM_MODEL=qwen3.5:35b
LLM_TIMEOUT_SECONDS=180
# Opcional, solo si el servidor exige autenticación:
# LLM_API_KEY=
# Límite por usuario (generación automática)
LLM_GENERATE_RATE_LIMIT_REQUESTS=5
LLM_GENERATE_RATE_LIMIT_WINDOW_SECONDS=3600