.env.example 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Mismo .env que la versión Node (mismas variables, mismo formato).
  2. # NODE_ENV no aplica al binario Go (se ignora si está presente).
  3. PORT=3000
  4. STATIC_DIR=../app/dist # opcional; tiene prioridad sobre el frontend embebido
  5. DATA_DIR=./data
  6. # DB_DIR=./data # opcional; directorio de la BD (por defecto DATA_DIR)
  7. SESSION_SECRET= # opcional; autogenerado y persistido en kv si falta
  8. AUTH_USER=admin
  9. AUTH_PASS=cambia-esto # hash bcrypt en kv tras primer login
  10. DEMO_MODE=0 # 1 = dataset de demostración (sin escribir en la BD)
  11. MAX_SSE_CLIENTS=10
  12. # --- Sondeo del poller (#715) ---
  13. # Cadencia del sondeo SSH de routers del poller, en segundos. Entero > 0.
  14. # Default 30 (antes 5 s hardcoded): sondeos muy frecuentes añaden carga SSH
  15. # visible en routers pequeños, inesperada para un monitor de solo lectura.
  16. NETPULSE_POLL_INTERVAL=30
  17. # --- Modo live ---
  18. # Routers: la tabla `routers` de SQLite es la fuente de verdad y nace VACÍA.
  19. # En el primer arranque se autodetecta la puerta de enlace (ip route + sondeo
  20. # SSH) y el resto se añade desde Ajustes. ROUTERS_JSON solo se usa como
  21. # semilla opcional si la tabla está vacía.
  22. # ROUTERS_JSON=[{"id":"flint2","name":"Gateway","host":"192.168.1.1","type":"glinet"},{"id":"living","host":"192.168.1.2","type":"openwrt"}]
  23. SSH_KEY_PATH=~/.ssh/id_ed25519
  24. ADGUARD_URL=http://192.168.1.1
  25. ADGUARD_USER=admin
  26. ADGUARD_PASS=
  27. # Interfaz(es) WireGuard a sondear (#713). "auto" (o vacío) descubre TODAS
  28. # las interfaces del router y agrega sus peers. Un valor explícito (una
  29. # interfaz o una lista separada por comas, p. ej. "wg0" o "wg0,wg1") actúa
  30. # como filtro y solo sondea esas interfaces.
  31. WG_INTERFACE=auto
  32. # Reverse DNS fallback for device names: a device nothing else named (no DHCP
  33. # hostname, reservation, alias or mDNS) takes its forward-confirmed PTR name.
  34. # Private and link-local addresses only. 0 = off.
  35. # NETPULSE_RDNS=1
  36. # --- Auto-rearme de agentes (Fase 6.1+) ---
  37. # 1 = el supervisor rearma automáticamente los agentes cuyo último push
  38. # expiró (TTL). Opt-in: nada autónomo sobre equipamiento de red sin
  39. # confirmación explícita. Cooldown entre intentos automáticos por slug.
  40. NETPULSE_AUTO_REARM=0
  41. NETPULSE_AUTO_REARM_COOLDOWN_S=600
  42. # Escalado del supervisor (#457): reinstalar el agente completo cuando un
  43. # rearme no lo recupera (p. ej. binario perdido tras un sysupgrade).
  44. # Requiere NETPULSE_PUBLIC_URL (URL con la que los routers alcanzan al server).
  45. NETPULSE_AUTO_REINSTALL=0
  46. #NETPULSE_AUTO_REINSTALL_COOLDOWN_S=3600
  47. #NETPULSE_PUBLIC_URL=http://192.168.1.226:3000
  48. # --- Alertas de ghost port (#419) ---
  49. # 1 = activa alertas "Ghost port: X went silent". Default 0 (deshabilitado)
  50. # porque la deteccion sigue dando falsos positivos en algunos agentes.
  51. GHOST_PORT_ENABLED=0
  52. # 1 = servidor en el propio router: la config llega de /etc/config/netpulse
  53. # (sección server, mismas claves en minúscula: port, data_dir, auth_pass…),
  54. # AUTH_PASS es opcional (primer arranque: contraseña aleatoria en logread y
  55. # en netpulse.server.auth_pass) y la DB usa journal DELETE (sin -wal en
  56. # flash). Es configuración, no compilación: el mismo binario sirve para el
  57. # CT (sin la variable, todo funciona exactamente como hoy).
  58. NETPULSE_ONBOX=0
  59. # --- HTTPS adicional (#696) ---
  60. # 1 = servimos también HTTPS en un listener propio (NETPULSE_TLS_PORT),
  61. # manteniendo el HTTP de PORT intacto (los agentes y el updater siguen
  62. # hablando HTTP; la UI/PWA puede usar HTTPS sin romper la flota). Opt-in:
  63. # sin la variable, el arranque es idéntico al actual. El modo on-box ya
  64. # sirve HTTPS en PORT y no necesita esta variable.
  65. NETPULSE_TLS_ENABLED=0
  66. NETPULSE_TLS_PORT=3443
  67. # Certs del usuario (opcional, ambos o ninguno): se CARGAN tal cual para
  68. # servir HTTPS válido (p. ej. para instalar la PWA). Si no se configuran,
  69. # se genera un autofirmado en DATA_DIR/cert.pem + DATA_DIR/key.pem al
  70. # arrancar (con el aviso del navegador, sin validez de PWA).
  71. #NETPULSE_TLS_CERT=/ruta/a/fullchain.pem
  72. #NETPULSE_TLS_KEY=/ruta/a/privkey.pem
  73. # --- FORK: HTTPS with the server's own private CA (docs/https.md) ---
  74. # Usually turned on from Settings > HTTPS, with no restart; these only
  75. # matter to fix it here instead. With NETPULSE_TLS_ENABLED=1 and
  76. # NETPULSE_TLS_CA=1 the extra listener serves a certificate signed by the
  77. # server's own CA (DATA_DIR/tls), which you install once on your devices;
  78. # the switch in Settings is then locked on.
  79. #NETPULSE_TLS_CA=1
  80. # Extra names or addresses the certificate should cover, comma-separated
  81. # (the host's own addresses and names are found by themselves). Only
  82. # private addresses and local names can be covered.
  83. #NETPULSE_TLS_NAMES=
  84. # What plain HTTP on PORT may still do: full | migrate | redirect. Set it
  85. # to lock the mode - and set it to "full" to get plain HTTP back if HTTPS
  86. # ever becomes unreachable.
  87. #NETPULSE_HTTP_MODE=