Files
mirror-3x-ui/internal/web
Sanaei 22fe0c4cd9 feat(mtproto): record client IPs and enforce the IP limit for MTProto clients
Every client the panel serves has its connected addresses recorded and its
IP limit applied, whichever process carries it. MTProto clients are served
by mtg, never by Xray, so the core's online list could not see them: their
IP log stayed empty and a configured limitIp never fired, although the form
offers both for every protocol.

mtg-multi 1.17.0 reports users.<name>.active_ips in /stats. The manager
keeps them from each scrape together with the time an address was first
seen connected, so the scan can keep the newest addresses and ban the
oldest, and the IP scan merges them the way it already merges kernel-mode
AmneziaWG peers. A failed scrape drops the addresses instead of leaving
them live, and loopback addresses (a relay in front of mtg) are skipped as
the core skips them.

Enforcement is the existing fail2ban path. The temporary credential drop
is Xray-only, so on Windows, where it is the only mechanism, an MTProto
limit is recorded but not enforced.
2026-11-29 12:13:19 +03:30
..