Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-05-05feat: add configurable auto-restart on client auto-disableMHSanaei
Add a configurable option to restart Xray when clients are auto-disabled and persist disable actions. Changes include: - New setting restartXrayOnClientDisable (default true), getters/setters in SettingService, UI toggle in general settings, and translations for multiple locales. - AddTraffic signature updated to return a third bool (clientsDisabled). disableInvalidClients now calls Xray API to remove users, marks client_traffics.enable=false, updates inbound.Settings JSON so clients appear disabled in stored settings, and returns appropriate counts/errors. - XrayTrafficJob now checks the clientsDisabled flag and restarts Xray when the setting is enabled (with fallback to mark Xray as needing restart on failure). - XrayService.GetXrayConfig call adjusted to ignore AddTraffic returns. - Subscription generation (subService/subJson/subClash) no longer filters clients by their enable flag when matching subId. - Minor fixes: check_client_ip_job now checks scanner.Err and improved API error handling/logging. These changes ensure auto-disabled clients are propagated to Xray and the stored inbound settings, and provide an option to restart Xray automatically after auto-disable events.
2026-04-23iplimit: dont count idle db-only ips toward the per-client limitpwnnex
after #4083 the staleness window is 30 minutes, which still lets an ip that stopped connecting a few minutes ago sit in the db blob and keep the protected slot on the ascending sort. the ip that is actually connecting right now gets classified as excess and sent to fail2ban, and never lands in inbound_client_ips.ips so the panel doesnt show it until you clear the log by hand. only count ips observed in the current scan toward the limit. db-only entries stay in the blob for display but dont participate in the ban decision. live subset still uses the "protect oldest, ban newcomer" rule. closes #4091. followup to #4077.
2026-04-22Fix IP Limit continuous ban loop from stale DB entries (#4077)pwnnex
After 60abeaa flipped the excess-IP selector to "oldest wins, newest loses" (to protect the original/current connections), the per-client IP table in `inbound_client_ips.ips` never evicted IPs that stopped connecting. Their stored timestamp stayed ancient, so on every subsequent run they counted as the "oldest protected" slot(s) and whichever IP was actually using the config now was classified as "new excess" and re-banned via fail2ban. This is exactly the #4077 scenario: two IPs connect once and get recorded, the ban lifts after the configured duration, the lone legitimate IP that reconnects gets banned again, and again, and again — a permanent 3xipl.log loop with no real abuser anywhere. Fix: when merging the persisted `old` list with the freshly observed `new` log lines, drop entries whose last-seen timestamp is older than `ipStaleAfterSeconds` (30 minutes). A client that's actually still active refreshes its timestamp any time xray emits a new `accepted` line for a fresh TCP, so the cutoff is far above even idle streaming sessions; a client that's genuinely gone falls out of the table in bounded time and frees its slot. Extracted the merge into `mergeClientIps` so it can be exercised by unit tests without spinning up the full DB-backed job. Tests cover: - stale old entry is dropped (the #4077 regression) - fresh old entries are still carried forward (access-log rotation is still backed by the persisted table) - newer timestamp wins when the same IP appears in both lists - a clock-skewed old `new` entry can't resurrect a stale IP - a zero cutoff never over-evicts Closes #4077
2026-04-19revert: Disconnect client due to exceeded IP limit (#3948)HamidReza Sadeghzadeh
* fix: Ban new IPs with fail2ban instead of disconnected the client. * fix: Remove unused strconv import * fix: Revert log fail2ban format * fix: Disconnect the client to remove the banned IPs connections * fix: Fix getting the xray inbound api port * fix: Run go formatter * fix: Disconnect only the supported protocols client * fix: Ensure the required "cipher" field is present in the shadowsocks protocol * fix: Log the errors in the resolveXrayAPIPort function * fix: Run go formatter
2026-03-17fix: Ban new IPs with fail2ban instead of disconnected the client. (#3919)HamidReza Sadeghzadeh
* fix: Ban new IPs with fail2ban instead of disconnected the client. * fix: Remove unused strconv import * fix: Revert log fail2ban format
2026-02-08fix : Uncontrolled data used in path expressionSanaei
Co-Authored-By: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-04feat: implement 'last IP wins' policy for IP limitation (#3735)Aung Ye Zaw
- Add timestamp tracking for each client IP address - Sort IPs by connection time (newest first) instead of alphabetically - Automatically disconnect old connections when IP limit exceeded - Keep only the most recent N IPs based on LimitIP setting - Force disconnection via Xray API (RemoveUser + AddUser) - Prevents account sharing while allowing legitimate network switching - Log format: [LIMIT_IP] Email = user@example.com || Disconnecting OLD IP = 1.2.3.4 || Timestamp = 1738521234 This ensures users can seamlessly switch between networks (mobile/WiFi) and the system maintains connections from their most recent IPs only. Fixes account sharing prevention for VPN providers selling per-IP licenses. Co-authored-by: Aung Ye Zaw <zaw.a.y@phluid.world>
2025-09-20docs: add comments for all functionsmhsanaei
2025-09-19go package correction v2mhsanaei
2025-09-19go package correctionmhsanaei
2025-09-11Update check_client_ip_job.gomhsanaei
2025-09-10Fixed: update Xray Core on Windowsmhsanaei
2025-08-17minor changesmhsanaei
2025-03-12Refactor: Use any instead of interface{}mhsanaei
2025-01-05iplimit: ipRegex improvedmhsanaei
When the client has MUX enabled, a TCP or UDP prefix appears before the IP address. We initially weren’t aware of this behavior, but we have now resolved the issue.
2024-12-16improve iplimitMHSanaei
2024-10-28iplimit - accept all email formatmhsanaei
2024-09-24Iplimit - warning improvedmhsanaei
2024-09-12Iplimit - improvedmhsanaei
Ensure accurate extraction of email. Access logs are needed when the IP limit feature is active.
2024-09-09remove warning for access logmhsanaei
because you can't see the iplimit when there is no path for access log :D
2024-09-05iplimit - ipv6 supportmhsanaei
2024-07-19fixmhsanaei
2024-07-09improved - message logsmhsanaei
2024-03-13[iplimit] fix access log path in settings service (#2044)Hamidreza
* [iplimit] fix access log path in settings service better to avoid hardcoding the access log path to enhance flexibility. not all users prefer the default './access.log' * [iplimit] fix iplimit
2024-03-11Some fixes and improvements (#1997)Hamidreza
* [refactor] api controller * [fix] access log path better to not hardcode the access log path, maybe some ppl dont want to use the default ./access.log * [fix] set select options from logs paths in xray settings * [update] .gitignore * [lint] all .go files * [update] use status code for jsonMsg and 401 to unauthorize * [update] handle response status code via axios * [fix] set correct value if log paths is set to 'none' we also use the default value for the paths if its set to none * [fix] iplimit - only warning access log if f2b is installed
2024-03-05[IPLimit] Added check for accessLogPathsomebodywashere
2024-03-05[IPLimit] Optimize + Debian 12 compabilitysomebodywashere
2024-03-02Enhance CheckClientIpJob #1964MHSanaei
2024-02-21Create directory for IPLimit files if needed (#1852)somebodywashere
2024-02-18minor changesMHSanaei
2024-02-10some log changes (#1789)somebodywashere
* some logs changes * removed some empty lines
2024-02-10clear log hourly if !j.hasLimitIp and "./access.log" existMHSanaei
2024-02-06fix - Ensure logs are not null in show method #1763MHSanaei
2024-02-04IPLimit - IPv4 Extraction SimplificationMHSanaei
2024-02-04new - select option for loglevel & access logMHSanaei
2024-02-03This modification uses a Scanner to read the file line by line, which can be ↵Mehdi Khodayari
more memory-efficient for large files. (#1736)
2024-01-21minor changesMHSanaei
disAllowedIps doesn't show on debug if there is no ip change copy to clipboard to export inbound
2024-01-01Major changes to tgbot, also small changes for panel (#1463)somebodywashere
* Reduce outage time on Xray errors * Improved logs clearing, added previous logs File name change: 3xipl-access-persistent.log -> 3xipl-ap.log All previous logs have .prev suffix * Preparations for tgbot additions * [tgbot] Improvements, Additions and Fixes * Changed interaction with Expire Date for Clients * Added more info and interactions with Online Clients * Added a way to get Ban Logs (also added them to backup) * Few fixes and optimizations in code * Fixed RU translation * [tgbot] More updates and fixes * [tgbot] Quick Fix * [tgbot] Quick Fix 2 * [tgbot] Big Updates Added Notifications for Clients throught Tgbot (when Expire) Added compability for Usernames both w/wo @ Added more buttons overall for admins * [tgbot] Fixes * [tbot] Fixes 2 * [tgbot] Removed usernames support for Notifications to work * [tgbot] Fix * [tgbot] Fix Notify * [tgbot] small fixes * [tgbot] replyMarkup only for last message on big messages * [tgbot] Fixed last message is empty * [tgbot] Fix messages split
2023-09-01check fail2ban installed or notMHSanaei
2023-08-09add panel usage to main pageMHSanaei
2023-08-01IP Limit Tweaks to reduce false bans (#850)somebodywashere
* IP Limit Tweaks to reduce false bans 1) Check IPs every 10s instead of 20s 2) F2B jail: maxretry 3 -> 4, findtime 100 -> 60 * USERS SHOULD UPDATE BANTIME ONCE AFTER UPDATE to recreate jail for Ip Limit
2023-07-26No reason to write to BlockedIPs (#815)somebodywashere
2023-07-01🚀 Some improvements for x-ui.sh and ip job (#665)Hamidreza
2023-06-24Added IP Limit Management to x-ui menu, Tweaked IP Limit to check every 20s ↵somebodywashere
(#615) Co-authored-by: Hamidreza <70919649+hamid-gh98@users.noreply.github.com> Co-authored-by: Ho3ein <ho3ein.sanaei@gmail.com>
2023-06-16new - loglevel (#612)Ho3ein
2023-06-16fix warning when there is no access.logMHSanaei
after this if limitip is 0 and there is no access.log on xray config you don't see this warning access.log doesn't exist in your config.json ------------- better view on ip log ------------- update dependencies
2023-06-15Removed ipLimit from the panel, changed the code to work with fail2ban (#580)somebodywashere
* Logging for fail2ban service Removed limitDevice and other unnecessary functions * Logging for fail2ban service Removed limitDevice and other unnecessary functions * fixed shouldCleanLog * last fix * reduced ip limit detection frequency to 30 sec (less logging, more precise) changed maxretry in fail2ban jail config to 2 to fit above * fixed check delay * added 5 seconds delay before cleaning logs
2023-06-08access.log #571MHSanaei
access.log will be clear only when limitip is not 0
2023-06-03some changesMHSanaei
ip limit method back to v1.6.0 method remove event on getDBClientIps better show ip on log (",\n")
2023-05-25change blockedips to AllowedIpsMHSanaei
now only those IPs that are allowed are able to establish a connection; other connections are dropped it will happen every 10 sec after user offline that IPs will be removed from AllowedIps