Repository navigation
v2.7.0
ser2net v2.7.0 — connection lifecycle & optional login (#24)
Fixed
- Dead TCP clients no longer stay
ESTABLISHEDforever. A client that vanished without closing (power cut, cable pull, Wi-Fi/VPN/NAT drop) kept its slot on a quiet raw bridge — and withmax_connections = 1every reconnect was refused withBusy. Every TCP data socket (server, connect-out, Modbus gateway) now uses TCP keepalive, on by default: a dead peer is dropped in ≈ 90 s (60 s idle + 3 × 10 s probes; configurable per mapping), also while the device keeps sending (LinuxTCP_USER_TIMEOUT, when shorter than the kernel's ~15 min); pre-1709 Windows (e.g. Server 2016) is supported viaSIO_KEEPALIVE_VALS. Verified with real half-open connections on Linux and Windows in CI. - Viewers can no longer open the mapping edit form or the mappings export, which expose stored MQTT credentials (now operator+); a viewer API token gets the MQTT password redacted.
- 2.6.x configs with an unvalidated
idle_timeout_s(-1,"300") keep booting (Docker/headless re-saves the config on start); such values are normalised.
New
- Connect timeout for connect-out mappings (default 10 s, 0 = OS default) — covers the TCP and TLS handshake.
- Max connection time per mapping (0 = unlimited, e.g. 86400 = 24 h).
- Idle timeout now also applies to the Modbus gateway.
- Every disconnect is logged with its reason (closed by peer, peer stopped responding, idle timeout, max connection time, kicked, …).
- Optional web login: Settings → Web UI access — switch "Require login" off on trusted networks and choose the role visitors get (viewer / operator / admin). Signing in still works, the REST API still needs its token, open access applies only when the UI is reached by IP /
localhost/ its own host name (DNS-rebinding guard; behind a reverse proxy passX-Forwarded-Host), other cluster nodes still need a real login, and open consoles close when access is revoked. Login stays required by default. - All of the above in the mapping form, REST API and JSON import.
Upgrading from 2.6.x
No config migration and no new dependencies: config.json (mappings, users, API token, cluster, TLS) is read as-is; new settings take their defaults. Back up the data/ folder, replace the program, restart:
- Standalone binary: stop it/the service, replace
ser2net(.exe), keepdata/next to it, start. - Source install / systemd:
git pull(or unpack the new source) over the old one, thensystemctl restart ser2net. - Docker:
git pull && docker compose up -d --build— the/datavolume is kept. - LAN cluster: upgrade every node; mixed versions keep working meanwhile.
Behaviour changes to be aware of:
- TCP keepalive is on for every TCP mapping (that is the fix): a vanished peer is dropped after ≈ 90 s. To restore the old behaviour for a mapping, untick TCP keepalive (or
"tcp_keepalive": false); for faster detection lower idle/interval/count. - Connect-out gives up a hanging attempt after 10 s and retries (was the OS default: ~21 s Windows / ~2 min Linux). For very slow links raise Connect timeout, or set 0.
- Modbus gateway now honours Idle timeout — it was ignored there before; if a Modbus mapping has one set, masters that stay silent longer get disconnected.
- Linux: a client that stops reading for longer than idle + interval × count while the device keeps sending is disconnected (
TCP_USER_TIMEOUT). - Viewer role: no longer opens the mapping form or the export (403); a viewer API token sees the MQTT password as
********. - Log format: disconnect lines now end with
— <reason>, and the startup line shows the keepalive setting — adjust any log parsers. - Login is still required by default; open access only if an admin turns it on.
- Rolling back to 2.6.x is safe: it ignores the new keys (and drops them on its next save).
Türkçe özet
FIN/RST göndermeden kaybolan istemcilerin bağlantısı artık sonsuza dek ESTABLISHED kalmıyor: tüm TCP soketlerinde TCP keepalive varsayılan olarak açık (~90 sn'de temizlenir). Bunun yanında connect timeout, maksimum bağlantı süresi, Modbus gateway için idle timeout, kopma nedeni loglama ve isteğe bağlı web girişi (Ayarlar → Web UI access) geldi. Ayrıca viewer rolü artık MQTT parolası içeren düzenleme formunu ve dışa aktarmayı göremiyor.
Downloads: ser2net-windows-x64.exe · ser2net-linux-x64 (standalone, no Python needed).