v1.0.2

sleep3r/mtproto.zigv1.0.2Jun 7, 2026by sleep3r

Upgrading?

AI Summary

Fixes critical CLI safety issues where `--help` would execute commands instead of showing help, and resolves a systemd unit issue where the `update` command would fail due to a missing service user.

Key Highlights

  • Subcommands now correctly display help (`--help`/`-h`) without executing the command.
  • The `update` command now creates the `mtproto` service user, preventing `status=217/USER` errors.
  • README translations added for Chinese, Persian, and Vietnamese.
  • Internal planning documents (ROADMAP, PRODUCT_VISION) removed from the repository.

Full Release Notes

<details open>
<summary>🇷🇺 Что нового (RU)</summary>

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

`v1.0.2` убирает две операторские ловушки в `mtbuddy` (обе способны уронить прокси) и открывает проект для пользователей из стран, где Telegram блокируют, — на их родном языке.

Главное — **безопасность CLI**. Подкоманды `mtbuddy` молча игнорировали неизвестные флаги, поэтому `mtbuddy <подкоманда> --help` не показывал справку, а **выполнял** команду. Самый опасный случай — `sudo mtbuddy update --help`: оператор хотел прочитать справку перед обновлением, а получил **скачивание и установку** релиза (по [реальному отчёту #310](https://github.com/sleep3r/mtproto.zig/issues/310) это привело к двухминутному простою). К тому же `mtbuddy update` переписывал systemd-юнит на `User=mtproto`, но самого пользователя не создавал (это делал только `install`), так что на серверах, поставленных **до 1.0** (прокси работал от root), апдейт ронял сервис в `status=217/USER`. `v1.0.2` чинит оба сценария.

И второе — README теперь есть на **китайском, фарси и вьетнамском** (страны, где Telegram под блокировкой) плюс уже бывшие английский и русский, с крупным заметным переключателем языков.

> [!TIP]
> Теперь `mtbuddy <подкоманда> --help` (и `-h`) всегда показывает справку и **ничего не выполняет** — в том числе `sudo mtbuddy update --help` безопасно печатает справку.

> [!NOTE]
> Менять `config.toml` не нужно. Поведение обычных команд не изменилось — затронуты только обработка `--help` и создание сервисного пользователя при `update`.

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

### `--help`/`-h` после подкоманды показывает справку, а не выполняет команду ([#311](https://github.com/sleep3r/mtproto.zig/pull/311))

- Парсеры подкоманд молча отбрасывали неизвестные флаги, поэтому `--help`/`-h` после подкоманды игнорировался и действие выполнялось.
- Диспетчер теперь заранее сканирует аргументы подкоманды на `-h`/`--help` и печатает справку (для `install` — детальную, для остального — общую) **не выполняя** действие — как требует стандартное соглашение CLI (`apt`, `systemctl`, `docker`).
- `install` и раньше уважал свой `--help`; теперь это распространено на `update`, `status`, `config`, `links`, `setup` и остальные.

### `update` создаёт сервисного пользователя `mtproto` — больше нет `status=217/USER` ([#311](https://github.com/sleep3r/mtproto.zig/pull/311))

- `mtbuddy update` переписывает systemd-юнит на `User=mtproto`, но создавал этого пользователя только `install`.
- На хостах, впервые поставленных до 1.0 (прокси работал от root), `update` оставлял systemd с `status=217/USER`, а откат восстанавливал только бинарь, но не юнит — самоинициированный простой.
- Теперь `update` гарантирует наличие пользователя и группы `mtproto` (переиспользует идемпотентный `ensureServiceUser` из `install`) **до остановки сервиса** и аккуратно прерывается, если не может — отсутствие аккаунта больше не уронит прокси.

### README на китайском, фарси и вьетнамском ([#309](https://github.com/sleep3r/mtproto.zig/pull/309))

- Добавлены переводы README на языки трёх стран, где блокируют Telegram: 🇨🇳 упрощённый китайский (`README.zh.md`), 🇮🇷 фарси (`README.fa.md`), 🇻🇳 вьетнамский (`README.vi.md`).
- Каждый перевод 1:1 повторяет английский оригинал (та же структура заголовков, таблиц, кода и картинок); команды, пути, URL и технические имена собственные оставлены латиницей.
- Переключатель языков во всех пяти README переделан в крупный заметный центрированный ряд с флагами и нативными названиями (вместо мелких `<kbd>`-чипсов).

### Внутренние планировочные документы убраны из репозитория ([#309](https://github.com/sleep3r/mtproto.zig/pull/309))

- `ROADMAP_1.0.md` и `PRODUCT_VISION.md` — рабочие документы для команды, а не публичный справочник; они больше не публикуются в репозитории.

## Проверено

- `zig build test` и кросс-компиляция под `x86_64-linux` + `aarch64-linux` — зелёные; `zig fmt` чистый.
- GitHub Actions: `Test & Build`, `E2E Integration`, `Bench (No Soak)`, installer e2e `debian:12` и `ubuntu:24.04`.
- Поведение проверено на живом Linux (на throwaway-копии бинаря, установленный `mtbuddy` не тронут): `update --help` / `status --help` / `update -h` печатают справку и **не выполняются**; `install --help` показывает справку install; голый `update` по-прежнему обновляет.

</details>

---

<details>
<summary>🇬🇧 Release notes (EN)</summary>

## What this release addresses

`v1.0.2` removes two operator footguns in `mtbuddy` (both capable of taking the proxy down) and opens the project to users in countries that block Telegram — in their own language.

The headline is **CLI safety**. `mtbuddy` subcommands silently ignored unknown flags, so `mtbuddy <subcommand> --help` didn't show help — it **ran** the subcommand. The worst case is `sudo mtbuddy update --help`: an operator who wanted to read the help before updating instead triggered a **download + install** of the latest release ([per the real report in #310](https://github.com/sleep3r/mtproto.zig/issues/310) this caused a two-minute outage). On top of that, `mtbuddy update` rewrites the systemd unit to run as `User=mtproto` but never created that account (only `install` did), so on hosts first installed **before 1.0** (proxy ran as root) an update left systemd failing the service with `status=217/USER`. `v1.0.2` fixes both.

Second, the README is now available in **Chinese, Persian, and Vietnamese** (alongside English and Russian), with a bigger, clearer language switcher.

> [!TIP]
> `mtbuddy <subcommand> --help` (and `-h`) now always shows help and **never executes** — including `sudo mtbuddy update --help`, which now safely prints help.

> [!NOTE]
> No `config.toml` changes needed. Normal command behavior is unchanged — only `--help` handling and the service-user creation on `update` are affected.

## What changed

### `--help`/`-h` after a subcommand shows help instead of running it ([#311](https://github.com/sleep3r/mtproto.zig/pull/311))

- The per-subcommand parsers silently dropped unknown flags, so `--help`/`-h` after a subcommand was ignored and the action ran.
- The dispatcher now scans a subcommand's args for `-h`/`--help` up front and prints help (install's detailed help for `install`, the general help otherwise) **without executing** — the standard CLI convention (`apt`, `systemctl`, `docker`).
- `install` already honored its own `--help`; this generalizes it to `update`, `status`, `config`, `links`, `setup`, and the rest.

### `update` creates the `mtproto` service user — no more `status=217/USER` ([#311](https://github.com/sleep3r/mtproto.zig/pull/311))

- `mtbuddy update` rewrites the systemd unit to `User=mtproto`, but only `install` ever created that account.
- On hosts first installed before 1.0 (proxy ran as root), `update` left systemd at `status=217/USER`, and the rollback restored only the binary, not the unit — a self-inflicted outage.
- `update` now ensures the `mtproto` user and group exist (reusing install's idempotent `ensureServiceUser`) **before stopping the service**, and aborts cleanly if it can't — a missing account can no longer take the proxy down.

### README in Chinese, Persian, and Vietnamese ([#309](https://github.com/sleep3r/mtproto.zig/pull/309))

- Added README translations for the languages of three countries that block Telegram: 🇨🇳 Simplified Chinese (`README.zh.md`), 🇮🇷 Persian/Farsi (`README.fa.md`), 🇻🇳 Vietnamese (`README.vi.md`).
- Each mirrors the English source 1:1 (same heading/table/code/image structure); commands, paths, URLs, and technical proper nouns kept in Latin script.
- The language switcher in all five READMEs is now a bigger, clearer centered row of flag + native name (replacing the small inline `<kbd>` chips).

### Internal planning docs removed from the repo ([#309](https://github.com/sleep3r/mtproto.zig/pull/309))

- `ROADMAP_1.0.md` and `PRODUCT_VISION.md` are internal working documents, not public-facing reference; they are no longer published in the repository.

## Verified

- `zig build test` and cross-compilation for `x86_64-linux` + `aarch64-linux` — green; `zig fmt` clean.
- GitHub Actions: `Test & Build`, `E2E Integration`, `Bench (No Soak)`, installer e2e `debian:12` and `ubuntu:24.04`.
- Behavior verified on a live Linux host (throwaway binary copy, the installed `mtbuddy` untouched): `update --help` / `status --help` / `update -h` print help and do **not** execute; `install --help` shows install help; bare `update` still updates.

</details>

## Changelog

* fix(cli): honor --help on subcommands; create mtproto user on update ([#310](https://github.com/sleep3r/mtproto.zig/issues/310)) ([#311](https://github.com/sleep3r/mtproto.zig/pull/311)) ([8f1da4d](https://github.com/sleep3r/mtproto.zig/commit/8f1da4d2a62e4fde7433bb1e1ab6a8407d84e721))
* docs: remove internal planning docs + add zh/fa/vi README translations ([#309](https://github.com/sleep3r/mtproto.zig/pull/309)) ([e65cf52](https://github.com/sleep3r/mtproto.zig/commit/e65cf52))

Related Repositories