mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5598
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/4092
Author: @pwnnex
Created: 4/23/2026
Status: ✅ Merged
Merged: 4/23/2026
Merged by: @pwnnex
Base:
main← Head:fix/iplimit-live-only-slot-count📝 Commits (1)
5f7c7c5iplimit: dont count idle db-only ips toward the per-client limit📊 Changes
3 files changed (+380 additions, -28 deletions)
View changed files
📝
web/job/check_client_ip_job.go(+61 -28)➕
web/job/check_client_ip_job_integration_test.go(+250 -0)📝
web/job/check_client_ip_job_test.go(+69 -0)📄 Description
closes #4091. followup to #4077 / #4083.
what still breaks after #4083
the 30min staleness cutoff wasnt enough. an ip that stopped connecting 5-20 minutes ago still looks fresh to
mergeClientIps. the over-limit picker sorts ascending and keeps the oldest, so those quiet-but-still-fresh db entries keep the protected slots. whichever ip is actually connecting right now gets classified as excess and banned every tick. it also never lands ininbound_client_ips.ips, so the panel doesnt show it until you hit the "clear log" button by hand (which is exactly the workaround the reporter found).fix
only count ips observed in the current access-log scan toward the per-client limit. db-only entries are still persisted so the panel keeps showing them, but they dont participate in the ban decision. the live subset still uses the "protect oldest, ban newcomer" policy.
pulled the split into a small
partitionLiveIpshelper so the policy is testable without the db.fail2ban log format is unchanged, so
filter.d/3x-ipl.confkeeps matching.tests
partitionLiveIpsupdateInboundClientIps:verified the regression test actually catches the bug. stashed the source fix, reran the integration test against pre-fix code:
TestUpdateInboundClientIps_LiveIpNotBannedByStillFreshHistoricalsfailed withshouldCleanLog must be false, nothing should have been banned with 1 live ip under limit 3(the exact user-reported symptom). popped the stash, all green.all existing tests still pass.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.