v0.17.1

sleep3r/mtproto.zigv0.17.1Apr 13, 2026by sleep3r

Upgrading?

AI Summary

Fixes dashboard tunnel health checks to accurately report dead VPN connections by validating handshake status and data transfer rather than just static configuration.

Key Highlights

  • Tunnel health check now verifies handshake and transfer data flow.
  • New `handshake_ok` field in API for external monitoring.
  • Clear failure reasons displayed for unreachable VPN servers.

New Features

  • Real-time tunnel liveness validation.
  • Enhanced API response for routing health status.

Full Release Notes

### 🇷🇺 Что нового (RU)

**Что решает этот релиз**

• Дашборд показывал `healthy: true` при мёртвом VPN-туннеле — теперь корректно определяет нерабочие соединения.

**Что изменено**

• **Tunnel health check**: добавлена проверка реального состояния WireGuard/AmneziaWG туннеля. Раньше дашборд считал туннель живым если endpoint был прописан в конфигурации (статическое значение). Теперь проверяется:
  - `latest-handshake` — был ли хотя бы один успешный хэндшейк
  - `transfer rx` — поступали ли данные через туннель
• **Новое поле `handshake_ok`** в API `/api/stats` → `routing.primary_tunnel` — показывает, прошёл ли хэндшейк с VPN-сервером.
• **Понятная причина отказа**: при недоступном VPN-сервере дашборд теперь возвращает `reason: "endpoint configured, no handshake (VPN server unreachable)"` вместо молчаливого `healthy: true`.
• **Хелперы**: `_parse_transfer_bytes()` для парсинга WG transfer (`5.69 KiB` → байты), `_has_valid_handshake()` для валидации хэндшейка.

> [!IMPORTANT]
> Если вы используете внешний мониторинг, проверяйте поле `routing.healthy` — теперь оно надёжно отражает реальное состояние upstream-туннеля.

**До / После**

| Сценарий | Было | Стало |
|---|---|---|
| VPN мёртв, handshake=0, rx=0 | `healthy: true` ❌ | `healthy: false` ✅ |
| VPN работает, handshake OK | `healthy: true` ✅ | `healthy: true` ✅ |
| Интерфейс не поднят | `healthy: false` ✅ | `healthy: false` ✅ |

---

### 🇬🇧 Release notes (EN)

**What this release addresses**

• The monitoring dashboard reported healthy tunnel status for dead VPN connections — the proxy appeared operational while unable to reach Telegram DCs.

**What changed**

• **Tunnel health check overhaul**: the dashboard now verifies actual WireGuard tunnel liveness, not just static configuration. Previously, a configured endpoint was enough to report `active: true` even when the VPN server was completely unreachable.
• **Handshake validation**: tunnels are only marked active when `latest-handshake` indicates a completed exchange (not `0` / `none` / `idle`).
• **Transfer verification**: `rx > 0` is checked to confirm data is actually flowing.
• **New `handshake_ok` field** in tunnel status API — exposes handshake state to external monitors.
• **Clear failure reason**: `"endpoint configured, no handshake (VPN server unreachable)"` instead of silent false-positive.

> [!IMPORTANT]
> If you poll the dashboard API for monitoring, the `routing.healthy` field now correctly reflects actual tunnel connectivity.

**Before / After**

| Scenario | Before | After |
|---|---|---|
| Dead VPN, handshake=0, rx=0 | `healthy: true` ❌ | `healthy: false` ✅ |
| Working VPN, handshake OK | `healthy: true` ✅ | `healthy: true` ✅ |
| Interface down | `healthy: false` ✅ | `healthy: false` ✅ |

---

### Changelog

• fix(dashboard): detect dead tunnels as unhealthy ([#180](https://github.com/sleep3r/mtproto.zig/issues/180)) ([b6e6b8c](https://github.com/sleep3r/mtproto.zig/commit/b6e6b8cd3ee634bdf905ea6e0ca931a876b86996))

Related Repositories