.env.example 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. # Set to 1 only for a private AdGuard instance with a self-signed certificate.
  28. ADGUARD_INSECURE_SKIP_VERIFY=0
  29. # Interfaz(es) WireGuard a sondear (#713). "auto" (o vacío) descubre TODAS
  30. # las interfaces del router y agrega sus peers. Un valor explícito (una
  31. # interfaz o una lista separada por comas, p. ej. "wg0" o "wg0,wg1") actúa
  32. # como filtro y solo sondea esas interfaces.
  33. WG_INTERFACE=auto
  34. # Reverse DNS fallback for device names: a device nothing else named (no DHCP
  35. # hostname, reservation, alias or mDNS) takes its forward-confirmed PTR name.
  36. # Private and link-local addresses only. 0 = off.
  37. # NETPULSE_RDNS=1
  38. # --- Auto-rearme de agentes (Fase 6.1+) ---
  39. # 1 = el supervisor rearma automáticamente los agentes cuyo último push
  40. # expiró (TTL). Opt-in: nada autónomo sobre equipamiento de red sin
  41. # confirmación explícita. Cooldown entre intentos automáticos por slug.
  42. NETPULSE_AUTO_REARM=0
  43. NETPULSE_AUTO_REARM_COOLDOWN_S=600
  44. # Escalado del supervisor (#457): reinstalar el agente completo cuando un
  45. # rearme no lo recupera (p. ej. binario perdido tras un sysupgrade).
  46. # Requiere NETPULSE_PUBLIC_URL (URL con la que los routers alcanzan al server).
  47. NETPULSE_AUTO_REINSTALL=0
  48. #NETPULSE_AUTO_REINSTALL_COOLDOWN_S=3600
  49. #NETPULSE_PUBLIC_URL=http://192.168.1.226:3000
  50. # --- Alertas de ghost port (#419) ---
  51. # 1 = activa alertas "Ghost port: X went silent". Default 0 (deshabilitado)
  52. # porque la deteccion sigue dando falsos positivos en algunos agentes.
  53. GHOST_PORT_ENABLED=0
  54. # 1 = servidor en el propio router: la config llega de /etc/config/netpulse
  55. # (sección server, mismas claves en minúscula: port, data_dir, auth_pass…),
  56. # AUTH_PASS es opcional (primer arranque: contraseña aleatoria en logread y
  57. # en netpulse.server.auth_pass) y la DB usa journal DELETE (sin -wal en
  58. # flash). Es configuración, no compilación: el mismo binario sirve para el
  59. # CT (sin la variable, todo funciona exactamente como hoy).
  60. NETPULSE_ONBOX=0
  61. # --- HTTPS adicional (#696) ---
  62. # 1 = servimos también HTTPS en un listener propio (NETPULSE_TLS_PORT),
  63. # manteniendo el HTTP de PORT intacto (los agentes y el updater siguen
  64. # hablando HTTP; la UI/PWA puede usar HTTPS sin romper la flota). Opt-in:
  65. # sin la variable, el arranque es idéntico al actual. El modo on-box ya
  66. # sirve HTTPS en PORT y no necesita esta variable.
  67. NETPULSE_TLS_ENABLED=0
  68. NETPULSE_TLS_PORT=3443
  69. # Certs del usuario (opcional, ambos o ninguno): se CARGAN tal cual para
  70. # servir HTTPS válido (p. ej. para instalar la PWA). Si no se configuran,
  71. # se genera un autofirmado en DATA_DIR/cert.pem + DATA_DIR/key.pem al
  72. # arrancar (con el aviso del navegador, sin validez de PWA).
  73. #NETPULSE_TLS_CERT=/ruta/a/fullchain.pem
  74. #NETPULSE_TLS_KEY=/ruta/a/privkey.pem
  75. # --- FORK: HTTPS with the server's own private CA (docs/https.md) ---
  76. # Usually turned on from Settings > HTTPS, with no restart; these only
  77. # matter to fix it here instead. With NETPULSE_TLS_ENABLED=1 and
  78. # NETPULSE_TLS_CA=1 the extra listener serves a certificate signed by the
  79. # server's own CA (DATA_DIR/tls), which you install once on your devices;
  80. # the switch in Settings is then locked on.
  81. #NETPULSE_TLS_CA=1
  82. # Extra names or addresses the certificate should cover, comma-separated
  83. # (the host's own addresses and names are found by themselves). Only
  84. # private addresses and local names can be covered.
  85. #NETPULSE_TLS_NAMES=
  86. # What plain HTTP on PORT may still do: full | migrate | redirect. Set it
  87. # to lock the mode - and set it to "full" to get plain HTTP back if HTTPS
  88. # ever becomes unreachable.
  89. #NETPULSE_HTTP_MODE=