π‘οΈ MTProxyMax v1.4.1-LTS Release Notes & Architectural Blueprint
Version: v1.4.1-LTS
Codename: Enterprise Hardening, Multi-Instance Isolation & Telemt 3.5.7
Status: Long Term Support (LTS) β Maintenance & Production Stability Release
π Executive Summary
MTProxyMax v1.4.1-LTS builds upon the enterprise foundation established in v1.4.0-LTS, delivering two months of rigorous stability hardening, multi-instance isolation, security enhancements, and core engine evolutions.
This release resolves critical deployment hurdles across container environmentsβincluding eliminating secondary instance port collision crash-loops (AddrInUse), ensuring seamless zero-downtime hot reloads via in-place config generation, enforcing strict Role-Based Access Control (RBAC) across reseller tiers in the Telegram bot, and providing native OpenRC init service support for lightweight environments such as Alpine Linux. Furthermore, the core Rust engine is upgraded to telemt 3.5.7, bringing enhanced TCP probe validation and resilient websocket connection recovery.
π Key Highlights & Enterprise Enhancements of v1.4.1 LTS
1. βοΈ Telemt Core Engine v3.5.7 (4ca7418)
- Upstream Integration: Pinned to the latest stable release of the high-performance Rust proxy engine (
telemt 3.5.7 Wirtschaftsvertreter). - Websocket Lane Recovery: Automatically recovers and cleans stale websocket connection lanes after proxy reloads/restarts (#923).
- Target Port Validation: Hardened target port probing to evaluate only TCP listeners (#919), avoiding false-negative UDP artifacts.
- Automated Multi-Arch Pipeline: Pre-built Docker images for
amd64andarm64published via GitHub Container Registry (ghcr.io/samnet-dev/mtproxymax-telemt:latest).
2. π Multi-Instance Port Pair Isolation (instance)
- Technology: Atomic pair reservation for telemetry listeners
[p, p + 1]. - Mechanism: In
telemt, each running proxy binds two distinct ports: a Prometheus scraper port (metrics_listen) and an internal stats port (stats_listen/internal_stats_listen=metrics + 1). Previously, candidate allocation checked only metrics ports, causing newly added instances to collide with the primary proxy's stats port (9091) and enter an immediateAddrInUse(code 98) crash loop. - Resolution:
_next_free_metrics_port()now treats every listener as an atomic pair[p, p + 1]. The first instance on a default installation is assigned9092(occupying9092&9093), leaving primary9090and9091collision-free. Subsequent instances cleanly advance (9094,9096, etc.), and port range exhaustion (9091-9199) is handled gracefully (#135). - CLI Command:
mtproxymax instance add <port> [label]
3. π‘οΈ Masking Backend Precedence & Routing Loop Defense (mask-backend)
- Precedence Guarantee: Explicit
MASKING_HOSTandMASKING_PORTconfigurations now take strict precedence ingenerate_telemt_config(), preserving custom backends even when Cover Shield is active (#128). - Bidirectional Synchronization: Full synchronization between
mtproxymax mask-backend <host:port>, Settings menu[m], andmtproxymax cover-shield target <url>. - Routing Loop Guard: Emits prominent warnings if the configured masking backend targets the proxy's own listen port on
127.0.0.1,localhost, or public IP (CUSTOM_IP), preventing TLS probe amplification loops. - Domain Secret Preservation: Changed FakeTLS domain rotation prompt to
[y/N](No by default), requiring an explicit--rotateflag in non-interactive CLI workflows to preserve active user secrets.
4. π In-Place Hot-Reload & Inode Preservation (reload)
- Technology: In-place configuration writes (
> "$CONFIG_DIR/config.toml") and directory bind mounts (-v "${CONFIG_DIR}:/etc/telemt:ro"). - Mechanism: Resolves container configuration detaching where
cpor atomic rename recreated the inode while the running container kept reading the unlinked original file (#134 / #133). - Live Engine Verification: Added
_engine_config_in_sync()to verify live container configuration matching via/proc/<pid>/root, falling back gracefully to a container restart if stale.
5. π Telegram Bot Reseller RBAC Hardening (telegram)
- Technology: Fail-closed Role-Based Access Control (RBAC) in
mtproxymax-telegram.sh. - Mechanism: Enforces documented privilege boundaries for
reselleraccounts (#132 / #131). Resellers are strictly isolated to/mp_vouchermanagement and public self-service commands, with all admin control plane commands (/mp_status,/mp_restart,/mp_secrets,/mp_link,/mp_add,/reply, etc.) blocked. - Security Auditing: Unauthorized access attempts trigger localized denial notices to the requester and record security violation notices to
/opt/mtproxymax/audit.log.
6. ποΈ Alpine Linux & OpenRC Service Management
- Technology: Supervised OpenRC init scripts under
/etc/init.d/. - Mechanism: Automatically generates
/etc/init.d/mtproxymax-telegramsupervised bysupervise-daemon(with auto-respawn and isolated.errlogs) and/etc/init.d/mtproxymaxfor autostart on non-systemd systems (#130 / #129). - CLI & Service Commands: Unified lifecycle management across
systemd,openrc, and standalone environments.
7. π LXC Virtualized RAM Detection & Resource Controls (resources)
- Multi-Tier Detection: Resolves low-memory crashes on LXC/Proxmox containers (#127) by prioritizing container memory ceilings (
/var/lib/lxcfs/proc/meminfo, cgroups v1memory.limit_in_bytes, cgroups v2memory.max) over the physical host's RAM. - Resource Controls: Added
mtproxymax resources status,mtproxymax resources set <cpus> <mem>, andmtproxymax resources clearwith interactive confirmation and non-interactive scripting flags.
8. π Upload Mechanism Diagnostics (upload-test)
- Technology: Comprehensive network socket and QoS queue inspection (#126).
- CLI Command:
mtproxymax upload-test - Coverage: Audits kernel
wmem_maxsocket buffers, BBR congestion control parameters, LinuxtcQoS upload shaping rules, and engineclient_mssclamping with actionable performance recommendations.
π οΈ Architecture & Compatibility Summary
| Component | Status / Version in v1.4.1-LTS | Notes |
|---|---|---|
| Core Engine | Telemt 3.5.7 (4ca7418) |
Multi-arch Docker (amd64, arm64) |
| Init Systems | systemd, openrc, standalone |
Auto-detected with supervised daemons |
| Multi-Instance | Pair-wise disjoint allocation | Metrics (p) & Stats (p + 1) collision-free |
| Hot Reload | In-place inode preservation | Validated via /proc/<pid>/root |
| Telegram RBAC | Strict dual-tier (Admin / Reseller) | Fail-closed with audit.log |
| RAM Auto-Tune | Multi-tier container ceiling detection | LXCFS, cgroups v1/v2, Proxmox aware |
π‘οΈ Comprehensive Audit & Bug Fix Summary
- Atomic Settings Changes (#125): Restart-requiring settings (port, IPv4/IPv6 bind addresses, FakeTLS domain) are grouped into atomic transactional prompts, preventing configuration divergence when a restart is declined.
- Traffic Accounting Synchronization (#121 / #123): Added
mtproxymax traffic reset-globaland synchronized reset signals with the Telegram background daemon. - Guest Access Hardening (#120): Fixed label preservation and access limit enforcement on temporary guest access secrets (
mtproxymax guest). - Telemt
client_mssTuning (#124 / #118 / #102): Added CLI controls (mtproxymax client-mss status|off|tspu|<bytes>) and normalized settings persistence. - Telegram Parser Resilience (#117): Added missing exception guards in Telegram JSON parsing routines to prevent daemon crashes on malformed updates.
- Container Health & Auto-Healer Hardening: Hardened drop_caches invocation against read-only target filesystems, sanitized socket counter formatting, and safeguarded D-Bus recovery routines.
π Verification & Testing Checklist
All changes in v1.4.1-LTS have been verified across 13 automated test suites:
tests/test_instance_metrics_ports.sh(17 assertions β port pair allocation & exhaustion)tests/test_masking_backend.sh(22 assertions β precedence & loop guards)tests/test_hot_reload_inode.sh(13 assertions β in-place config & reload sync)tests/test_telegram_reseller_rbac.sh(62 assertions β strict reseller RBAC)tests/test_telegram_service_openrc.sh(54 assertions β OpenRC service lifecycle)tests/test_traffic_reset.sh(24 assertions β global traffic reset & daemon sync)tests/test_replication.sh(112 assertions β multi-node replication & config integrity)tests/test_secret_command_status.sh(7 assertions β secret lifecycle error propagation)tests/test_settings_restart.sh(15 assertions β atomic settings confirmation)tests/test_upload_diagnostics.sh(8 assertions β upload audit pipeline)tests/test_guest.sh(13 assertions β guest duration & quota enforcement)tests/test_client_mss.sh(client_mss parsing & generation)tests/test_lxc_ram_and_resources.sh(LXC memory auto-tuning & CLI controls)
π₯ Quick Upgrade
To update an existing installation to v1.4.1-LTS:
mtproxymax updateOr re-run the universal one-line installer:
bash <(curl -sL https://raw.githubusercontent.com/SamNet-dev/MTProxyMax/main/mtproxymax.sh)