From 0b0be07a9c29e9e164fc1ed2ef8d1f2f300a2c09 Mon Sep 17 00:00:00 2001 From: Artymediys Date: Thu, 9 Apr 2026 01:12:27 +0300 Subject: [PATCH] docs: align LTO notes, API docs, and Fake-TLS guidance --- README.md | 7 +++-- README.ru.md | 26 ++++++------------- config.toml | 13 ++++++---- docs/Architecture/API/API.md | 8 +++--- docs/Config_params/CONFIG_PARAMS.en.md | 6 +++-- .../OPENBSD_QUICK_START_GUIDE.en.md | 3 ++- docs/Quick_start/QUICK_START_GUIDE.en.md | 20 +++++++------- docs/Quick_start/QUICK_START_GUIDE.ru.md | 26 +++++++++---------- 8 files changed, 52 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 50c1c59..a0ff873 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ ![telemt_scheme](docs/assets/telemt.png) +## Features Our implementation of **TLS-fronting** is one of the most deeply debugged, focused, advanced and *almost* **"behaviorally consistent to real"**: we are confident we have it right - [see evidence on our validation and traces](docs/FAQ.en.md#recognizability-for-dpi-and-crawler) Our ***Middle-End Pool*** is fastest by design in standard scenarios, compared to other implementations of connecting to the Middle-End Proxy: non dramatically, but usual @@ -59,7 +60,6 @@ See more in the [Quick Start Guide](docs/Quick_start/QUICK_START_GUIDE.en.md). - [Quick Start Guide EN](docs/Quick_start/QUICK_START_GUIDE.en.md) ## FAQ - - [FAQ RU](docs/FAQ.ru.md) - [FAQ EN](docs/FAQ.en.md) @@ -72,9 +72,8 @@ cd telemt # Starting Release Build cargo build --release -# Low-RAM devices (1 GB, e.g. NanoPi Neo3 / Raspberry Pi Zero 2): -# release profile uses lto = "thin" to reduce peak linker memory. -# If your custom toolchain overrides profiles, avoid enabling fat LTO. +# Current release profile uses lto = "fat" for maximum optimization (see Cargo.toml). +# On low-RAM systems (~1 GB) you can override it to "thin". # Move to /bin mv ./target/release/telemt /bin diff --git a/README.ru.md b/README.ru.md index 7a805de..5c7ce56 100644 --- a/README.ru.md +++ b/README.ru.md @@ -4,9 +4,12 @@ > [!NOTE] > -> Исправленный TLS ClientHello доступен в **Telegram Desktop** начиная с версии **6.7.2**: для работы с EE-MTProxy обновите клиент. +> Исправленный TLS ClientHello доступен: +> - в **Telegram Desktop** начиная с версии **6.7.2** +> - в **Telegram Android** начиная с версии **12.6.4** +> - **официальный релиз для iOS находится в процессе разработки**. > -> Исправленный TLS ClientHello доступен в **Telegram Android** начиная с версии **12.6.4**; **официальный релиз для iOS находится в процессе разработки**. +> Для работы с EE-MTProxy обновите клиент!

@@ -15,7 +18,6 @@

**Telemt** — это быстрый, безопасный и функциональный сервер, написанный на Rust. Он полностью реализует официальный алгоритм прокси Telegram и добавляет множество улучшений для продакшена: - - [ME Pool + Reader/Writer + Registry + Refill + Adaptive Floor + Trio-State + жизненный цикл генераций](https://github.com/telemt/telemt/blob/main/docs/Architecture/Model/MODEL.en.md); - [Полноценный API с управлением](https://github.com/telemt/telemt/blob/main/docs/Architecture/API/API.md); - Защита от повторных атак (Anti-Replay on Sliding Window); @@ -25,7 +27,6 @@ ![telemt_scheme](docs/assets/telemt.png) ## Особенности - Реализация **TLS-fronting** максимально приближена к поведению реального HTTPS-трафика (подробнее - [FAQ](docs/FAQ.ru.md#распознаваемость-для-dpi-и-сканеров)). ***Middle-End Pool*** оптимизирован для высокой производительности. @@ -63,12 +64,10 @@ curl -fsSL https://raw.githubusercontent.com/telemt/telemt/main/install.sh | sh - [Quick Start Guide EN](docs/Quick_start/QUICK_START_GUIDE.en.md) ## FAQ - - [FAQ RU](docs/FAQ.ru.md) - [FAQ EN](docs/FAQ.en.md) ## Сборка - ```bash # Клонируйте репозиторий git clone https://github.com/telemt/telemt @@ -77,9 +76,8 @@ cd telemt # Начните процесс сборки cargo build --release -# Устройства с небольшим объёмом оперативной памяти (1 ГБ, например NanoPi Neo3 / Raspberry Pi Zero 2): -# используется параметр lto = «thin» для уменьшения пикового потребления памяти. -# Если ваш пользовательский набор инструментов переопределяет профили, не используйте Fat LTO. +# В текущем release-профиле используется lto = "fat" для максимальной оптимизации (см. Cargo.toml). +# На системах с малым объёмом RAM (~1 ГБ) можно переопределить это значение на "thin". # Перейдите в каталог /bin mv ./target/release/telemt /bin @@ -89,22 +87,14 @@ chmod +x /bin/telemt telemt config.toml ``` -### Устройства с малым объемом RAM -Для устройств с ~1 ГБ RAM (например Raspberry Pi): -- используется облегчённая оптимизация линковщика (thin LTO); -- не рекомендуется включать fat LTO. - -## OpenBSD - +### OpenBSD - Руководство по сборке и настройке на английском языке [OpenBSD Guide (EN)](docs/Quick_start/OPENBSD_QUICK_START_GUIDE.en.md); - Пример rc.d скрипта: [contrib/openbsd/telemt.rcd](contrib/openbsd/telemt.rcd); - Поддержка sandbox с `pledge(2)` и `unveil(2)` пока не реализована. ## Почему Rust? - - Надёжность для долгоживущих процессов; - Детерминированное управление ресурсами (RAII); - Отсутствие сборщика мусора; - Безопасность памяти; - Асинхронная архитектура Tokio. - diff --git a/config.toml b/config.toml index f4eb3ae..f8c554f 100644 --- a/config.toml +++ b/config.toml @@ -32,13 +32,13 @@ show = "*" port = 443 # proxy_protocol = false # Enable if behind HAProxy/nginx with PROXY protocol # metrics_port = 9090 -# metrics_listen = "0.0.0.0:9090" # Listen address for metrics (overrides metrics_port) -# metrics_whitelist = ["127.0.0.1", "::1", "0.0.0.0/0"] +# metrics_listen = "127.0.0.1:9090" # Listen address for metrics (overrides metrics_port) +# metrics_whitelist = ["127.0.0.1/32", "::1/128"] [server.api] enabled = true -listen = "0.0.0.0:9091" -whitelist = ["127.0.0.0/8"] +listen = "127.0.0.1:9091" +whitelist = ["127.0.0.1/32", "::1/128"] minimal_runtime_enabled = false minimal_runtime_cache_ttl_ms = 1000 @@ -48,9 +48,12 @@ ip = "0.0.0.0" # === Anti-Censorship & Masking === [censorship] +# Fake-TLS / SNI masking domain used in generated ee-links. +# Changing tls_domain invalidates previously generated TLS links. tls_domain = "petrovich.ru" + mask = true -tls_emulation = true # Fetch real cert lengths and emulate TLS records +tls_emulation = true # Fetch real cert lengths and emulate TLS records tls_front_dir = "tlsfront" # Cache directory for TLS emulation [access.users] diff --git a/docs/Architecture/API/API.md b/docs/Architecture/API/API.md index a1f0f4f..7177200 100644 --- a/docs/Architecture/API/API.md +++ b/docs/Architecture/API/API.md @@ -9,12 +9,12 @@ API runtime is configured in `[server.api]`. | Field | Type | Default | Description | | --- | --- | --- | --- | -| `enabled` | `bool` | `false` | Enables REST API listener. | -| `listen` | `string` (`IP:PORT`) | `127.0.0.1:9091` | API bind address. | -| `whitelist` | `CIDR[]` | `127.0.0.1/32, ::1/128` | Source IP allowlist. Empty list means allow all. | +| `enabled` | `bool` | `true` | Enables REST API listener. | +| `listen` | `string` (`IP:PORT`) | `0.0.0.0:9091` | API bind address. | +| `whitelist` | `CIDR[]` | `127.0.0.0/8` | Source IP allowlist. Empty list means allow all. | | `auth_header` | `string` | `""` | Exact value for `Authorization` header. Empty disables header auth. | | `request_body_limit_bytes` | `usize` | `65536` | Maximum request body size. Must be `> 0`. | -| `minimal_runtime_enabled` | `bool` | `false` | Enables runtime snapshot endpoints requiring ME pool read-lock aggregation. | +| `minimal_runtime_enabled` | `bool` | `true` | Enables runtime snapshot endpoints requiring ME pool read-lock aggregation. | | `minimal_runtime_cache_ttl_ms` | `u64` | `1000` | Cache TTL for minimal snapshots. `0` disables cache; valid range is `[0, 60000]`. | | `runtime_edge_enabled` | `bool` | `false` | Enables runtime edge endpoints with cached aggregation payloads. | | `runtime_edge_cache_ttl_ms` | `u64` | `1000` | Cache TTL for runtime edge summary payloads. `0` disables cache. | diff --git a/docs/Config_params/CONFIG_PARAMS.en.md b/docs/Config_params/CONFIG_PARAMS.en.md index 1222e89..36cca24 100644 --- a/docs/Config_params/CONFIG_PARAMS.en.md +++ b/docs/Config_params/CONFIG_PARAMS.en.md @@ -1942,7 +1942,8 @@ This document lists all configuration keys accepted by `config.toml`. - `proxy_protocol_trusted_cidrs` - **Constraints / validation**: `IpNetwork[]`. - - If omitted, defaults to trust-all CIDRs (`0.0.0.0/0` and `::/0`). + - If omitted, defaults to trust-all CIDRs (`0.0.0.0/0` and `::/0`). + > In production behind HAProxy/nginx, prefer setting explicit trusted CIDRs instead of relying on this fallback. - If explicitly set to an empty array, all PROXY headers are rejected. - **Description**: Trusted source CIDRs allowed to provide PROXY protocol headers (security control). - **Example**: @@ -2474,7 +2475,8 @@ Note: This section also accepts the legacy alias `[server.admin_api]` (same sche - `tls_domain` - **Constraints / validation**: Must be a non-empty domain name. Must not contain spaces or `/`. - - **Description**: Primary TLS domain used in FakeTLS handshake profile and as the default SNI domain. + - **Description**: Primary domain used for Fake-TLS masking / fronting profile and as the default SNI domain presented to clients. + This value becomes part of generated `ee` links, and changing it invalidates previously generated links. - **Example**: ```toml diff --git a/docs/Quick_start/OPENBSD_QUICK_START_GUIDE.en.md b/docs/Quick_start/OPENBSD_QUICK_START_GUIDE.en.md index 943e599..2117bcc 100644 --- a/docs/Quick_start/OPENBSD_QUICK_START_GUIDE.en.md +++ b/docs/Quick_start/OPENBSD_QUICK_START_GUIDE.en.md @@ -27,7 +27,8 @@ cargo build --release ./target/release/telemt --version ``` -For low-RAM systems, this repository already uses `lto = "thin"` in release profile. +For low-RAM systems, note that this repository currently uses `lto = "fat"` in release profile. +On constrained builders, a local override to `lto = "thin"` may be more practical. ## 3. Install binary and config diff --git a/docs/Quick_start/QUICK_START_GUIDE.en.md b/docs/Quick_start/QUICK_START_GUIDE.en.md index 24f106c..488db17 100644 --- a/docs/Quick_start/QUICK_START_GUIDE.en.md +++ b/docs/Quick_start/QUICK_START_GUIDE.en.md @@ -110,15 +110,15 @@ show = "*" # === Server Binding === [server] port = 443 -# proxy_protocol = false # Enable if behind HAProxy/nginx with PROXY protocol +# proxy_protocol = false # Enable if behind HAProxy/nginx with PROXY protocol # metrics_port = 9090 -# metrics_listen = "0.0.0.0:9090" # Listen address for metrics (overrides metrics_port) -# metrics_whitelist = ["127.0.0.1", "::1", "0.0.0.0/0"] +# metrics_listen = "127.0.0.1:9090" # Listen address for metrics (overrides metrics_port) +# metrics_whitelist = ["127.0.0.1/32", "::1/128"] [server.api] enabled = true -listen = "0.0.0.0:9091" -whitelist = ["127.0.0.0/8"] +listen = "127.0.0.1:9091" +whitelist = ["127.0.0.1/32", "::1/128"] minimal_runtime_enabled = false minimal_runtime_cache_ttl_ms = 1000 @@ -128,9 +128,9 @@ ip = "0.0.0.0" # === Anti-Censorship & Masking === [censorship] -tls_domain = "petrovich.ru" +tls_domain = "petrovich.ru" # Fake-TLS / SNI masking domain used in generated ee-links mask = true -tls_emulation = true # Fetch real cert lengths and emulate TLS records +tls_emulation = true # Fetch real cert lengths and emulate TLS records tls_front_dir = "tlsfront" # Cache directory for TLS emulation [access.users] @@ -141,9 +141,9 @@ hello = "00000000000000000000000000000000" then Ctrl+S -> Ctrl+X to save > [!WARNING] -> Replace the value of the hello parameter with the value you obtained in step 0. -> Additionally, change the value of the tls_domain parameter to a different website. -> Changing the tls_domain parameter will break all links that use the old domain! +> Replace the value of the `hello` parameter with the value you obtained in step 0. +> Additionally, change the value of the `tls_domain` parameter to a different website. +> Changing the `tls_domain` parameter will break all links that use the old domain! --- diff --git a/docs/Quick_start/QUICK_START_GUIDE.ru.md b/docs/Quick_start/QUICK_START_GUIDE.ru.md index eb6b12f..9cef988 100644 --- a/docs/Quick_start/QUICK_START_GUIDE.ru.md +++ b/docs/Quick_start/QUICK_START_GUIDE.ru.md @@ -103,22 +103,22 @@ tls = true [general.links] show = "*" # show = ["alice", "bob"] # Показывать ссылки только для alice и bob -# show = "*"              # Показывать ссылки для всех пользователей -# public_host = "proxy.example.com"  # Хост (IP-адрес или домен) для ссылок tg:// -# public_port = 443                  # Порт для ссылок tg:// (по умолчанию: server.port) +# show = "*" # Показывать ссылки для всех пользователей +# public_host = "proxy.example.com" # Хост (IP-адрес или домен) для ссылок tg:// +# public_port = 443 # Порт для ссылок tg:// (по умолчанию: server.port) # === Привязка сервера === [server] port = 443 -# proxy_protocol = false           # Включите, если сервер находится за HAProxy/nginx с протоколом PROXY +# proxy_protocol = false # Включите, если сервер находится за HAProxy/nginx с протоколом PROXY # metrics_port = 9090 -# metrics_listen = "0.0.0.0:9090"  # Адрес прослушивания для метрик (переопределяет metrics_port) -# metrics_whitelist = ["127.0.0.1", "::1", "0.0.0.0/0"] +# metrics_listen = "127.0.0.1:9090" # Адрес прослушивания для метрик (переопределяет metrics_port) +# metrics_whitelist = ["127.0.0.1/32", "::1/128"] [server.api] enabled = true -listen = "0.0.0.0:9091" -whitelist = ["127.0.0.0/8"] +listen = "127.0.0.1:9091" +whitelist = ["127.0.0.1/32", "::1/128"] minimal_runtime_enabled = false minimal_runtime_cache_ttl_ms = 1000 @@ -128,9 +128,9 @@ ip = "0.0.0.0" # === Обход блокировок и маскировка === [censorship] -tls_domain = "petrovich.ru" +tls_domain = "petrovich.ru" # Домен Fake-TLS / SNI, который будет использоваться в сгенерированных ee-ссылках mask = true -tls_emulation = true # Получить реальную длину сертификата и эмулировать запись TLS +tls_emulation = true # Получить реальную длину сертификата и эмулировать запись TLS tls_front_dir = "tlsfront" # Директория кэша для эмуляции TLS [access.users] @@ -141,9 +141,9 @@ hello = "00000000000000000000000000000000" Затем нажмите Ctrl+S -> Ctrl+X, чтобы сохранить > [!WARNING] -> Замените значение параметра hello на значение, которое вы получили в пункте 0. -> Так же замените значение параметра tls_domain на другой сайт. -> Изменение параметра tls_domain сделает нерабочими все ссылки, использующие старый домен! +> Замените значение параметра `hello` на значение, которое вы получили в пункте 0. +> Так же замените значение параметра `tls_domain` на другой сайт. +> Изменение параметра `tls_domain` сделает нерабочими все ссылки, использующие старый домен! ---