Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
74 lines (64 loc) · 2.34 KB
/
Copy path.env.example
File metadata and controls
74 lines (64 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copia este archivo como .env para ejecutar la API en local (go run ./cmd/api).
# Servidor
PORT=8091
# Detrás de nginx u otro proxy: true para tomar la IP del cliente de X-Forwarded-For (si no, el límite de tasa
# sería uno solo para todos). Solo se confía en la cabecera si la conexión llega desde TRUSTED_PROXY_CIDRS
# (vacío = redes privadas, loopback y link-local). Sin proxy, déjalo en false.
TRUST_PROXY=false
TRUSTED_PROXY_CIDRS=
LOG_LEVEL=INFO
WEB_BASE_URL=http://localhost:5173
PUBLIC_API_URL=http://localhost:8091
CORS_ALLOWED_ORIGINS=http://localhost:5173
API_DOCS_ENABLED=true
# Secretos: JWT de al menos 32 caracteres y AES-256 en Base64 (openssl rand -base64 32)
SMARTPOT_JWT_SECRET=<JWT_SECRET_MIN_32_CHARS>
SMARTPOT_AES_KEY=<BASE64_32_BYTES>
JWT_EXPIRATION=P7D
# PostgreSQL + TimescaleDB
DATABASE_URL=postgres://smartpot:<DB_PASSWORD>@localhost:5432/smartpot?sslmode=disable
DATABASE_MAX_CONNS=10
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=<REDIS_PASSWORD>
# Correo (Mailpit en local)
MAIL_ENABLED=true
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=<MAIL_USERNAME>
MAIL_PASSWORD=<MAIL_PASSWORD>
MAIL_SMTP_AUTH=true
MAIL_SMTP_STARTTLS=false
# MQTT: la API es la cuenta administradora del broker
MQTT_ENABLED=true
MQTT_BROKER_URI=tcp://localhost:1883
MQTT_ADMIN_USERNAME=smartpot-api
MQTT_ADMIN_PASSWORD=<MQTT_ADMIN_PASSWORD>
MQTT_PUBLIC_HOST=localhost
MQTT_PUBLIC_PORT=1883
MQTT_PUBLIC_TLS=false
MQTT_WEBSOCKET_URL=ws://localhost:9001
# Asistente de IA (servicio interno)
AI_ENABLED=true
AI_BASE_URL=http://localhost:8000
SMARTPOT_AI_TOKEN=<AI_SERVICE_TOKEN>
AI_EVALUATION_INTERVAL=PT5M
AI_AUTOMATION_COOLDOWN=PT10M
# Aprendizaje continuo: cada cuánto se envían las lecturas reales a la IA
AI_LEARNING_ENABLED=true
AI_LEARNING_FLUSH_INTERVAL=PT1M
# Telegram (opcional): crea el bot con @BotFather. polling en local; webhook en producción.
TELEGRAM_BOT_TOKEN=
TELEGRAM_BOT_USERNAME=
TELEGRAM_MODE=polling
TELEGRAM_WEBHOOK_SECRET=
# Cultivos virtuales (SmartPot-DataGenerator con su API de control); sin token no se pueden crear
SIMULATOR_ENABLED=true
SIMULATOR_BASE_URL=http://localhost:8081
SIMULATOR_TOKEN=<SIMULATOR_SERVICE_TOKEN>
# Cuotas por cuenta de usuario (defaults: 20 cultivos, 5 virtuales, 10 conexiones MCP)
MAX_CROPS_PER_USER=20
MAX_VIRTUAL_CROPS_PER_USER=5
MAX_CONNECTIONS_PER_USER=10