[PR #4321] [CLOSED] Preserve clients' IP history #5654

Closed
opened 2026-10-31 20:48:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4321
Author: @vahellame
Created: 5/12/2026
Status: ❌ Closed

Base: main ← Head: fix/preserve-client-ip-history


📝 Commits (1)

  • 89f904b Preserve clients' IP history

📊 Changes

1 file changed (+41 additions, -41 deletions)

View changed files

📝 web/job/check_client_ip_job.go (+41 -41)

📄 Description

What is the pull request?

This PR preserves historical client IP records in inbound_client_ips while keeping IP Limit enforcement based only on IPs observed in the current access-log scan.

The previous stale IP eviction was introduced to fix the continuous Fail2Ban loop described in https://github.com/MHSanaei/3x-ui/issues/4077. A related regression was later tracked in https://github.com/MHSanaei/3x-ui/issues/4091, where db-only IPs could still affect ban decisions before partitionLiveIps() separated live IPs from historical ones.

This PR keeps that protection intact:

  • partitionLiveIps() still ensures that only IPs observed in the current scan are counted toward LimitIP
  • historical db-only IPs remain excluded from Fail2Ban decisions
  • all live IPs, including IPs queued for Fail2Ban, are preserved in the database for visibility/history

The only behavior changed here is retention: client IP history is no longer removed from inbound_client_ips after 30 minutes.

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

Screenshots

Not applicable.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/4321 **Author:** [@vahellame](https://github.com/vahellame) **Created:** 5/12/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/preserve-client-ip-history` --- ### 📝 Commits (1) - [`89f904b`](https://github.com/MHSanaei/3x-ui/commit/89f904b976a1149fc61b25eca65f287c3c275c12) Preserve clients' IP history ### 📊 Changes **1 file changed** (+41 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `web/job/check_client_ip_job.go` (+41 -41) </details> ### 📄 Description ## What is the pull request? This PR preserves historical client IP records in `inbound_client_ips` while keeping IP Limit enforcement based only on IPs observed in the current access-log scan. The previous stale IP eviction was introduced to fix the continuous Fail2Ban loop described in https://github.com/MHSanaei/3x-ui/issues/4077. A related regression was later tracked in https://github.com/MHSanaei/3x-ui/issues/4091, where db-only IPs could still affect ban decisions before `partitionLiveIps()` separated live IPs from historical ones. This PR keeps that protection intact: - `partitionLiveIps()` still ensures that only IPs observed in the current scan are counted toward `LimitIP` - historical db-only IPs remain excluded from Fail2Ban decisions - all live IPs, including IPs queued for Fail2Ban, are preserved in the database for visibility/history The only behavior changed here is retention: client IP history is no longer removed from `inbound_client_ips` after 30 minutes. ## Which part of the application is affected by the change? - [ ] Frontend - [x] Backend ## Type of Changes - [x] Bug fix - [ ] New feature - [ ] Refactoring - [ ] Other ## Screenshots Not applicable. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:48:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5654
No description provided.