v0.23.3

sleep3r/mtproto.zigv0.23.3May 13, 2026by sleep3r

Upgrading?

AI Summary

Patch release fixing installer failures on fresh Debian/Ubuntu hosts caused by `/usr/sbin` PATH issues and nginx conffile prompts during installation.

Key Highlights

  • Account commands now use fallback paths for `/usr/sbin`
  • Nginx install runs in non-interactive mode to avoid prompts
  • NFQWS setup verifies the IPv4 NFQUEUE rule actually exists
  • Build output is no longer hidden to aid debugging

Full Release Notes

## [0.23.3](https://github.com/sleep3r/mtproto.zig/compare/v0.23.2...v0.23.3) (2026-05-13)

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

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

`v0.23.3` - patch-релиз для fresh install на чистых Debian/Ubuntu хостах, особенно для minimized Debian 12 образов.

На чистой Debian 12 установка могла доходить до скачивания бинарника и генерации `config.toml`, а затем останавливаться на создании service account:

```text
Failed to create system group 'mtproto'
Failed to spawn command
```

Корень проблемы был в том, что installer вызывал `groupadd` / `useradd` как bare commands. На Debian эти утилиты обычно лежат в `/usr/sbin`, и при отличающемся `PATH` процесс мог не найти команду вообще. Из-за этого установка оставляла хост в полусобранном состоянии: бинарник и конфиг уже были в `/opt/mtproto-proxy`, но пользователя `mtproto`, владельцев файлов и запущенного systemd service ещё не было.

Во время проверки на живом clean Debian 12 всплыли ещё два слабых места:

1. `mtbuddy setup masking` мог заранее создать `/etc/nginx/sites-available/default`, а затем `apt` упирался в conffile prompt при установке `nginx`. В non-interactive запуске это оставляло `nginx` / `nginx-common` в half-configured состоянии и ломало последующую установку build dependencies для `nfqws`.
2. `mtbuddy setup nfqws` добавлял kernel rules best-effort и мог продолжить happy path без явной проверки, что IPv4 `NFQUEUE` rule реально появился.

Этот релиз делает install path более скучным и предсказуемым: если команда не найдена или package manager не смог завершиться, оператор видит конкретную ошибку, а не ложный успех.

> [!NOTE]
> Конфиг менять не нужно. Релиз чинит installer/control-plane поведение, а не runtime protocol.

> [!TIP]
> Если хост уже застрял после старого `Failed to create system group 'mtproto'`, обновите `mtbuddy` до `v0.23.3` и повторите установку. Installer сохранит существующий `/opt/mtproto-proxy/config.toml`.

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

### Account commands теперь устойчивы к `/usr/sbin` PATH ([#258](https://github.com/sleep3r/mtproto.zig/pull/258))

- Добавлен общий helper `sys.commandOrPath()`.
- `groupadd`, `useradd` и `userdel` теперь сначала ищутся в `PATH`, затем через fallback paths:
  - `/usr/sbin/<cmd>`;
  - `/sbin/<cmd>`.
- Ошибка запуска required command теперь показывает конкретный Zig error name, например `FileNotFound`, вместо голого `Failed to spawn command`.
- Это закрывает сценарий, где Debian-хост имеет нужные системные утилиты, но текущий процесс installer их не видит через `PATH`.

### Nginx install больше не ломается на conffile prompt ([#258](https://github.com/sleep3r/mtproto.zig/pull/258))

- `mtbuddy setup masking` больше не pre-creates packaged nginx default site до установки пакета.
- `apt-get` для nginx запускается с `DEBIAN_FRONTEND=noninteractive`.
- Добавлены dpkg options:
  - `--force-confdef`;
  - `--force-confold`.
- Ошибки установки nginx теперь логируются как настоящие failed steps, а не маскируются последующим summary.

### nfqws setup стал честнее про результат ([#258](https://github.com/sleep3r/mtproto.zig/pull/258))

- Установка build dependencies для `nfqws` теперь тоже идёт через noninteractive apt с теми же dpkg conffile options.
- IPv4 `NFQUEUE` rule теперь ставится через checked command path.
- После установки проверяется, что правило действительно присутствует в `iptables -t mangle -S OUTPUT`.
- Если rule не появился, setup останавливается с явной ошибкой вместо продолжения к misleading success summary.

## Проверено

- `zig fmt src/ctl/masking.zig src/ctl/nfqws.zig src/ctl/sys.zig src/ctl/install.zig src/ctl/uninstall.zig`
- `git diff --check`
- `zig build -Dtarget=x86_64-linux-musl`
- Manual clean Debian 12 VPS validation:
  - `mtproto-proxy` active/enabled;
  - `nginx` active/enabled;
  - `nfqws-mtproto` active/enabled;
  - `mtproto-mask-health.timer` active;
  - TCP `443` reachable externally;
  - local masking on `127.0.0.1:8443` returned HTTP 200;
  - IPv4/IPv6 `TCPMSS` and `NFQUEUE #200` rules present.

</details>

---

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

## What this release addresses

`v0.23.3` is a patch release for fresh installs on clean Debian/Ubuntu hosts, especially minimized Debian 12 images.

On a clean Debian 12 machine, installation could download the proxy binary and generate `config.toml`, then stop while creating the service account:

```text
Failed to create system group 'mtproto'
Failed to spawn command
```

The root cause was that the installer invoked `groupadd` / `useradd` as bare commands. On Debian these utilities normally live under `/usr/sbin`, and a different `PATH` could make the installer fail to spawn them at all. That left the host half-installed: the binary and config existed under `/opt/mtproto-proxy`, but the `mtproto` account, ownership, and running systemd service were not set up yet.

A live clean-Debian-12 validation pass also exposed two follow-up installer weaknesses:

1. `mtbuddy setup masking` could pre-create `/etc/nginx/sites-available/default`, then `apt` hit a conffile prompt while installing `nginx`. In a non-interactive run this left `nginx` / `nginx-common` half-configured and broke the later `nfqws` dependency install.
2. `mtbuddy setup nfqws` added kernel rules best-effort and could continue down the happy path without verifying that the IPv4 `NFQUEUE` rule was actually present.

This release makes the install path more boring and predictable: if a command is missing or the package manager cannot finish, the operator gets a concrete failure instead of a misleading success path.

> [!NOTE]
> No config changes are required. This release fixes installer/control-plane behavior, not the runtime protocol.

> [!TIP]
> If a host is already stuck after the old `Failed to create system group 'mtproto'` failure, update `mtbuddy` to `v0.23.3` and rerun the install. The installer keeps the existing `/opt/mtproto-proxy/config.toml`.

## What changed

### Account commands now tolerate `/usr/sbin` PATH differences ([#258](https://github.com/sleep3r/mtproto.zig/pull/258))

- Added a shared `sys.commandOrPath()` helper.
- `groupadd`, `useradd`, and `userdel` are resolved through `PATH` first, then fallback paths:
  - `/usr/sbin/<cmd>`;
  - `/sbin/<cmd>`.
- Required command spawn failures now include the Zig error name, for example `FileNotFound`, instead of only `Failed to spawn command`.
- This covers Debian hosts where the system tools exist but the installer process cannot see them through `PATH`.

### Nginx install no longer trips over conffile prompts ([#258](https://github.com/sleep3r/mtproto.zig/pull/258))

- `mtbuddy setup masking` no longer pre-creates nginx's packaged default site before installing the package.
- nginx `apt-get` runs with `DEBIAN_FRONTEND=noninteractive`.
- Added dpkg options:
  - `--force-confdef`;
  - `--force-confold`.
- nginx install errors are now logged as real failed steps instead of being hidden behind a later summary.

### nfqws setup now verifies the important kernel rule ([#258](https://github.com/sleep3r/mtproto.zig/pull/258))

- `nfqws` build dependency installation also uses noninteractive apt with the same dpkg conffile options.
- The IPv4 `NFQUEUE` rule is installed through a checked command path.
- Setup verifies that the rule is present in `iptables -t mangle -S OUTPUT`.
- If the rule is missing, setup stops with a clear error instead of continuing to a misleading success summary.

## Verified

- `zig fmt src/ctl/masking.zig src/ctl/nfqws.zig src/ctl/sys.zig src/ctl/install.zig src/ctl/uninstall.zig`
- `git diff --check`
- `zig build -Dtarget=x86_64-linux-musl`
- Manual clean Debian 12 VPS validation:
  - `mtproto-proxy` active/enabled;
  - `nginx` active/enabled;
  - `nfqws-mtproto` active/enabled;
  - `mtproto-mask-health.timer` active;
  - TCP `443` reachable externally;
  - local masking on `127.0.0.1:8443` returned HTTP 200;
  - IPv4/IPv6 `TCPMSS` and `NFQUEUE #200` rules present.

</details>

## Changelog

* fix: harden Debian installer commands ([#258](https://github.com/sleep3r/mtproto.zig/pull/258)) ([685aa12](https://github.com/sleep3r/mtproto.zig/commit/685aa125ef5c549dd787e415139b076bed63347a))
* chore(main): release 0.23.3 ([#259](https://github.com/sleep3r/mtproto.zig/pull/259)) ([b6a053b](https://github.com/sleep3r/mtproto.zig/commit/b6a053b5e345fcde13ef2da9cc78f41c9ed89c71))

Related Repositories