v0.21.0
🇷🇺 Что нового (RU)
Что решает этот релиз
v0.21.0 — большой инженерный релиз про доверие к установке, поддержку Zig 0.16.0 и дальнейшее взросление proxy core.
После аудита проекта основной риск оказался не в MTProto data-plane, а вокруг эксплуатации: release artifacts, bootstrap/update, silent error handling, конфиг-валидация, lifecycle фоновых задач и отсутствие настоящего e2e harness. Этот релиз закрывает именно эти зоны: официальные сборки теперь проверяются по SHA-256 и minisign, mtbuddy несёт embedded public key, unsigned mode требует явного opt-in, а proxy получил более строгий startup/shutdown/reload path.
Параллельно мы продолжили разбирать огромный src/proxy/proxy.zig на небольшие модули. Это не косметика: теперь проще ревьюить relay, MiddleProxy, upstream failover, очереди, fd limits и сетевые helpers отдельно, не держа в голове весь event loop целиком.
[!NOTE]
Пользовательскийconfig.tomlменять не нужно. Если вы используете официальные release artifacts,mtbuddy install/updateиdeploy/bootstrap.shбудут проверять подписи автоматически.
[!IMPORTANT]
Для Docker/GHCR лучше использоватьv0.21.1илиlatest: patch-релиз исправляет Dockerfile default Zig version. Бинарные release assetsv0.21.0валидны и подписаны.
Что изменено
Release trust: подписи включены по умолчанию (#228, #229)
- Официальные
mtbuddybuilds теперь содержат pinned minisign public key. mtbuddy install,mtbuddy updateиdeploy/bootstrap.shпроверяют*.sha256и*.sha256.minisigперед распаковкой или запуском бинарника.- Release workflow публикует tarball, checksum и minisign signature для каждого artifact.
- Unsigned mode больше не включается “случайно”: нужен явный
--insecureилиMTPROTO_INSECURE=1. - Bootstrap тоже содержит pinned public key, так что checksum из того же GitHub Release больше не является единственной линией защиты.
Zig 0.16.0 и proxy refactor (#228)
- Кодовая база мигрирована на Zig 0.16.0 APIs.
src/proxy/proxy.zigзаметно разгружен: выделены модули для connection pool, connection phases, queue I/O, relay steps, MiddleProxy routing/frames/handshake/fallback, upstream handshake/failover, fd limits, network detection и socket helpers.ProxyState.initстал fallible и больше не может молча стартовать с пустым или частично собранным списком пользователей.- Detached MiddleProxy updater заменён на управляемый lifecycle с shutdown flag и
join(). - Runtime banner больше не печатает MTProto secrets и готовые proxy links в journald/stdout.
Control-plane hardening и config UX (#228, #229)
- Cloudflare DNS update path в
ipv6hopбольше не собирает shell-команды черезbash -c; curl вызывается через argv, ответы парсятся как JSON. - Добавлены
mtbuddy config validate,mtbuddy config doctorиmtbuddy config print-effective. - Исправлен false-positive warning про конфликт masking port для дефолтного
tls_domain:443. - Memory/capacity warnings учитывают фактическое использование MiddleProxy и
unsafe_override_limits. Lang.fromEnv()теперь читаетLANG/LC_ALL, а--langпоявился в help.- Dashboard uv installer больше не hard-code’ит x86_64 archive и выбирает artifact под текущую архитектуру.
Graceful operations (#229)
SIGTERMостанавливает accept, даёт активным соединениям drain window и затем принудительно закрывает хвост.SIGHUPперезагружает поддерживаемые runtime settings без полного restart.SIGUSR1печатает runtime stats.- Добавлен
mtbuddy reloadдля systemd reload path.
E2E, fuzz/property tests и CI (#229)
- Добавлен Linux e2e harness: fake Telegram DC, SOCKS5/HTTP CONNECT success/failure, MiddleProxy fallback, mask fallback, invalid handshakes, replay rejection, slowloris, 10k connection churn и SIGTERM во время active relay.
zig build e2eподключён к CI.- Добавлены fuzz/property-style тесты для TLS parser, MTProto obfuscation handshake, MiddleProxy frames, SOCKS5, HTTP CONNECT, config parser, replay cache и subnet limiter.
- Старый long-running soak больше не является единственной “интеграционной” проверкой.
Документация и trust docs (#229)
- Добавлены
SECURITY.md,THREAT_MODEL.md,CONTRIBUTING.md, CODEOWNERS и security issue template. - README синхронизирован с Zig 0.16.0, текущими Make targets, signed release flow, e2e/fuzz командами и known limitations.
- Документированы OS/kernel compatibility, Telegram client caveats и что может сломаться при изменениях Telegram/DC.
🇬🇧 Release notes (EN)
What this release addresses
v0.21.0 is a large engineering release focused on install/update trust, Zig 0.16.0 support, and continued proxy-core cleanup.
The latest audit showed that the biggest risks were not in the MTProto data-plane itself, but around operations: release artifacts, bootstrap/update, silent error handling, config validation, background task lifecycle, and the lack of a real e2e harness. This release addresses those areas directly: official builds now verify SHA-256 and minisign signatures, mtbuddy embeds the release public key, unsigned mode requires explicit opt-in, and the proxy has stricter startup/shutdown/reload behavior.
At the same time, the huge src/proxy/proxy.zig file has been split further into focused modules. This is not just tidying: relay, MiddleProxy, upstream failover, queues, fd limits, and socket helpers can now be reviewed and tested in smaller pieces.
[!NOTE]
No userconfig.tomlchanges are required. If you use official release artifacts,mtbuddy install/updateanddeploy/bootstrap.shverify signatures automatically.
[!IMPORTANT]
Docker/GHCR users should preferv0.21.1orlatest: the patch release fixes the Dockerfile default Zig version. The binaryv0.21.0release assets are valid and signed.
What changed
Release trust: signatures enforced by default (#228, #229)
- Official
mtbuddybuilds now embed the pinned minisign public key. mtbuddy install,mtbuddy update, anddeploy/bootstrap.shverify*.sha256and*.sha256.minisigbefore extracting or executing binaries.- The release workflow publishes a tarball, checksum, and minisign signature for every artifact.
- Unsigned mode is no longer accidental: it requires explicit
--insecureorMTPROTO_INSECURE=1. - Bootstrap also carries the pinned public key, so a checksum downloaded from the same GitHub Release is no longer the only protection layer.
Zig 0.16.0 and proxy refactor (#228)
- The codebase has been migrated to Zig 0.16.0 APIs.
src/proxy/proxy.zighas been reduced by extracting modules for connection pool, connection phases, queue I/O, relay steps, MiddleProxy routing/frames/handshake/fallback, upstream handshake/failover, fd limits, network detection, and socket helpers.ProxyState.initis now fallible and can no longer silently start with an empty or partially constructed user list.- The detached MiddleProxy updater has been replaced with an owned lifecycle using a shutdown flag and
join(). - The runtime banner no longer prints MTProto secrets or ready-to-use proxy links to journald/stdout.
Control-plane hardening and config UX (#228, #229)
- The Cloudflare DNS update path in
ipv6hopno longer builds shell commands throughbash -c; curl is called via argv and responses are parsed as JSON. - Added
mtbuddy config validate,mtbuddy config doctor, andmtbuddy config print-effective. - Fixed a false-positive masking port warning for the default
tls_domain:443path. - Memory/capacity warnings now account for effective MiddleProxy usage and
unsafe_override_limits. Lang.fromEnv()now readsLANG/LC_ALL, and--langis shown in help.- The dashboard uv installer no longer hard-codes the x86_64 archive and chooses the correct artifact for the current architecture.
Graceful operations (#229)
SIGTERMstops accepting new clients, drains active connections for the configured window, then force-closes the remaining tail.SIGHUPreloads supported runtime settings without a full restart.SIGUSR1dumps runtime stats.- Added
mtbuddy reloadfor the systemd reload path.
E2E, fuzz/property tests, and CI (#229)
- Added a Linux e2e harness covering fake Telegram DC, SOCKS5/HTTP CONNECT success/failure, MiddleProxy fallback, mask fallback, invalid handshakes, replay rejection, slowloris, 10k connection churn, and SIGTERM during active relay.
zig build e2eis now part of CI.- Added fuzz/property-style coverage for the TLS parser, MTProto obfuscation handshake, MiddleProxy frames, SOCKS5, HTTP CONNECT, config parser, replay cache, and subnet limiter.
- The old long-running soak is no longer the only integration-like safety net.
Documentation and trust docs (#229)
- Added
SECURITY.md,THREAT_MODEL.md,CONTRIBUTING.md, CODEOWNERS, and a security issue template. - README now matches Zig 0.16.0, current Make targets, the signed release flow, e2e/fuzz commands, and known limitations.
- Documented OS/kernel compatibility, Telegram client caveats, and what may break after Telegram/DC changes.