.env.example 4.7 KB

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