3x-ui/web/job
Rouzbeh† 9f31d7d056
feat: synchronize access.log client IPs across nodes (#5098)
* feat: synchronize access.log client IPs across nodes for global fail2ban limits

* fix(nodes): harden cross-node client-IP merge for cluster fail2ban

MergeInboundClientIps inserted new rows with the remote node's primary key,
which collides with the independently auto-incremented local id and rolled
back the whole sync batch — breaking exactly the node-only clients the
feature targets. It also never evicted stale IPs, so the 30-minute cutoff
was defeated cluster-wide (the master pushed its unpruned table back to
nodes, which re-added IPs they had just pruned) and the blobs grew unbounded.

- drop the remote id on create (Id=0) and guard the email-unique race with
  ON CONFLICT DO NOTHING; also fixes a latent Postgres sequence collision
- apply the same 30-minute stale cutoff inside the merge and skip creating
  node-only rows whose IPs are all stale
- throttle the IP fetch/merge/push to ~10s (data only refreshes every 10s)
  instead of running on every 5s traffic tick, cutting SQLite write churn
- log the load error on the push path and tidy the merge response message
- add unit tests for the merge (remote-id, dedup, stale-drop, skips)

---------

Co-authored-by: Rqzbeh <Rqzbeh@example.com>
Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
2026-06-09 00:59:50 +02:00
..
check_client_ip_job.go feat: synchronize access.log client IPs across nodes (#5098) 2026-06-09 00:59:50 +02:00
check_client_ip_job_integration_test.go fix(iplimit): skip stale access-log emails after client rename/delete 2026-06-06 02:20:39 +02:00
check_client_ip_job_test.go feat: synchronize access.log client IPs across nodes (#5098) 2026-06-09 00:59:50 +02:00
check_cpu_usage.go v3 2026-05-10 02:13:42 +02:00
check_hash_storage.go fix: address open bug reports (#4539, #4538, #4535, #4531, #4515) (#4545) 2026-05-25 00:08:06 +02:00
check_hash_storage_test.go fix: address open bug reports (#4539, #4538, #4535, #4531, #4515) (#4545) 2026-05-25 00:08:06 +02:00
check_xray_running_job.go v3 2026-05-10 02:13:42 +02:00
clear_logs_job.go v3 2026-05-10 02:13:42 +02:00
ldap_sync_job.go Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
mtproto_job.go feat(mtproto): add MTProto (FakeTLS) protocol via managed mtg sidecar (#5076) 2026-06-08 14:28:19 +02:00
node_heartbeat_job.go feat(nodes): multi-hop node attribution for chained sub-nodes (#4983) (#5005) 2026-06-06 12:33:39 +02:00
node_traffic_sync_job.go feat: synchronize access.log client IPs across nodes (#5098) 2026-06-09 00:59:50 +02:00
node_traffic_sync_job_test.go Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
outbound_subscription_job.go feat: add support for subscription-based outbounds with auto-update (#5037) 2026-06-08 18:09:53 +02:00
periodic_traffic_reset_job.go Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
stats_notify_job.go v3 2026-05-10 02:13:42 +02:00
xray_traffic_job.go feat(nodes): multi-hop node attribution for chained sub-nodes (#4983) (#5005) 2026-06-06 12:33:39 +02:00