3x-ui/internal/web/job
MHSanaei 975b1f1acc
fix(iplimit): ban a dead connection once instead of every scan
When a client's connection drops without a clean TCP close, xray-core
keeps its online-map entry until the session context ends (idle policy),
minutes after the kernel socket is gone. The 10s IP-limit scan kept
seeing that stale IP as the oldest live one and re-emitted the same
[LIMIT_IP] Disconnecting OLD IP line plus a RemoveUser/AddUser cycle
every scan - operators measured 100+ repeats over ~1000s for a single
network switch, forcing absurd fail2ban maxretry values to avoid
banning legitimate mobile users.

The core refreshes an entry's lastSeen only when a new connection from
that IP is dispatched, never on traffic, so a frozen lastSeen across
scans is a dead connection, not a reconnect. Track the lastSeen of each
banned (email, ip) pair and skip the log line and disconnect until it
advances; a real reconnect moves lastSeen and is enforced exactly as
before, and an age cutoff that could misclassify long-lived active
tunnels is deliberately avoided.

Closes #5893
2026-07-11 22:48:58 +02:00
..
check_client_ip_frozen_ban_test.go fix(iplimit): ban a dead connection once instead of every scan 2026-07-11 22:48:58 +02:00
check_client_ip_job.go fix(iplimit): ban a dead connection once instead of every scan 2026-07-11 22:48:58 +02:00
check_client_ip_job_integration_test.go fix(job): batch ip-limit per-email lookups and persistence 2026-07-02 16:39:31 +02:00
check_client_ip_job_test.go fix(clients): parse only settings.clients across protocols (#5855) 2026-07-08 20:31:00 +02:00
check_client_ip_scale_test.go refactor: modernize Go with strings.SplitSeq and maps.Copy 2026-07-08 22:10:54 +02:00
check_cpu_usage.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
check_hash_storage.go
check_hash_storage_test.go
check_memory_usage.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
check_xray_running_job.go
clear_logs_job.go fix(logs): limit Xray log growth (#5840) 2026-07-08 00:33:34 +03:00
clear_logs_job_test.go fix(logs): limit Xray log growth (#5840) 2026-07-08 00:33:34 +03:00
free_os_memory.go perf(memory): report real RSS and cut footprint via GOGC + periodic release 2026-06-25 22:16:38 +02:00
ldap_sync_job.go fix(ldap): convert default total GB to bytes when auto-creating clients (#5854) 2026-07-08 20:24:21 +02:00
ldap_sync_job_test.go fix(ldap): convert default total GB to bytes when auto-creating clients (#5854) 2026-07-08 20:24:21 +02:00
mtproto_job.go fix(mtproto): stop dropping connections on client/inbound edits; add live updates + ad-tag (#5838) 2026-07-07 01:13:24 +02:00
node_heartbeat_job.go fix(jobs): isolate per-node background goroutines from panics (#5397) 2026-06-20 00:38:25 +02:00
node_traffic_sync_job.go fix(node): never sweep a node's inbounds before their first adoption 2026-07-11 22:48:57 +02:00
node_traffic_sync_job_test.go
outbound_subscription_job.go
periodic_traffic_reset_job.go
stats_notify_job.go
warp_ip_job.go
xray_traffic_job.go feat(web): broadcast delta client stats above a snapshot threshold 2026-07-02 16:34:01 +02:00