[PR #4699] [MERGED] Fix IP limit enforcement and clarify related comments #5734

Closed
opened 2026-11-02 04:03:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4699
Author: @xAlokyx
Created: 5/30/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @MHSanaei

Base: main ← Head: main


📝 Commits (4)

  • 074394a fix: keep latest IP for limit enforcement
  • 996d467 chore: clarify IP limit comment
  • 24f0e73 chore: clarify timestamp sorting comment
  • 5e1cf5b Merge pull request #1 from xAlokyx/copilot/fix-ip-limit-issue

📊 Changes

1 file changed (+13 additions, -14 deletions)

View changed files

📝 web/job/check_client_ip_job.go (+13 -14)

📄 Description

This pull request updates the logic for managing and banning excess client IPs to prioritize keeping the most recently active connections and banning older, inactive ones. This addresses an issue where stale or idle IPs were incorrectly prioritized, leading to active users being banned.

IP Ban Logic Improvements:

  • Updated comments and sorting logic to clarify and implement "newest wins, oldest loses" for excess-IP selection, ensuring the most recent connections are protected and older, inactive IPs are banned instead. [1] [2] [3]
  • Adjusted log messages to accurately reflect that old IPs are now queued for banning, rather than new ones.

🔄 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/4699 **Author:** [@xAlokyx](https://github.com/xAlokyx) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (4) - [`074394a`](https://github.com/MHSanaei/3x-ui/commit/074394a7197648939d361bcb527bdb151dbc7f91) fix: keep latest IP for limit enforcement - [`996d467`](https://github.com/MHSanaei/3x-ui/commit/996d467c506ed9b6c12be164a7841d74a62c902c) chore: clarify IP limit comment - [`24f0e73`](https://github.com/MHSanaei/3x-ui/commit/24f0e732462f939dfeea968089697961784b62b5) chore: clarify timestamp sorting comment - [`5e1cf5b`](https://github.com/MHSanaei/3x-ui/commit/5e1cf5b6d7d9c640083ffe349e4d01cfd4563396) Merge pull request #1 from xAlokyx/copilot/fix-ip-limit-issue ### 📊 Changes **1 file changed** (+13 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `web/job/check_client_ip_job.go` (+13 -14) </details> ### 📄 Description This pull request updates the logic for managing and banning excess client IPs to prioritize keeping the most recently active connections and banning older, inactive ones. This addresses an issue where stale or idle IPs were incorrectly prioritized, leading to active users being banned. **IP Ban Logic Improvements:** * Updated comments and sorting logic to clarify and implement "newest wins, oldest loses" for excess-IP selection, ensuring the most recent connections are protected and older, inactive IPs are banned instead. [[1]](diffhunk://#diff-4d3a1d4c24ecd79315cf03cf57fcdaacec1ec669bfb39b1f82d0b53a2e1e5c0fL44-R45) [[2]](diffhunk://#diff-4d3a1d4c24ecd79315cf03cf57fcdaacec1ec669bfb39b1f82d0b53a2e1e5c0fL258-R264) [[3]](diffhunk://#diff-4d3a1d4c24ecd79315cf03cf57fcdaacec1ec669bfb39b1f82d0b53a2e1e5c0fL411-R412) * Adjusted log messages to accurately reflect that old IPs are now queued for banning, rather than new ones. <!-- What does this PR do? One or two sentences. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:03:41 +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#5734
No description provided.