74 Commits

Author SHA1 Message Date
Борисов Семён
f000322a06 fix: handle CPU threshold error to prevent false notifications (#3603)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (amd64) (push) Has been cancelled
Previously, when GetTgCpu() failed, the error was ignored and threshold
defaulted to 0, causing notifications to be sent for any CPU usage.

Now the job properly checks for errors and skips notifications if:
- The threshold cannot be retrieved (error)
- The threshold is not set or is 0

This ensures notifications are only sent when CPU usage exceeds the
configured threshold value from settings.
2025-12-12 14:29:27 +01:00
mhsanaei
b578a33518 update dependencies 2025-10-07 13:49:08 +02:00
Vadim Iskuchekov
a824875c4f fix: improve error handling in periodic traffic reset job (#3572) 2025-10-01 23:12:09 +02:00
konstpic
b65ec83c39 fix: fix delete method (#3569)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (amd64) (push) Has been cancelled
Co-authored-by: Пичугин Константин <k.pichugin@comagic.dev>
2025-09-29 18:16:46 +02:00
konstpic
28a17a80ec feat: add ldap component (#3568)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (amd64) (push) Has been cancelled
* add ldap component

* fix: fix russian comments, tls cert verify default true

* feat: remove replaces go mod for local dev
2025-09-28 21:04:54 +02:00
mhsanaei
6ced549dea docs: add comments for all functions 2025-09-20 09:35:50 +02:00
mhsanaei
7447cec17e go package correction v2 2025-09-19 10:05:43 +02:00
mhsanaei
054cb1dea0 go package correction 2025-09-18 23:12:14 +02:00
mhsanaei
170d24499e fix PeriodicTrafficResetJob: log only when there are matching inbound 2025-09-18 11:41:11 +02:00
Vadim Iskuchekov
9623e87511 feat: Simple periodic traffic reset (for Inbounds) – daily | weekly | monthly (#3407)
* Add periodic traffic reset feature model and ui with localization support

* Remove periodic traffic reset fields from client

* fix: add periodicTrafficReset field to inbound data structure

* feat: implement periodic traffic reset job and integrate with cron scheduler

* feat: enhance periodic traffic reset functionality with scheduling and inbound filtering

* refactor: rename periodicTrafficReset to trafficReset and add lastTrafficResetTime field

* feat: add periodic client traffic reset job and schedule tasks

* Update web/job/periodic_traffic_reset_job.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update web/job/periodic_client_traffic_reset_job.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update web/service/inbound.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: rename periodicTrafficReset to trafficReset and add lastTrafficResetTime

* feat: add last traffic reset time display and update logic in inbound service

* fix: correct log message for completed periodic traffic reset

* refactor: update traffic reset fields in Inbound model and remove unused client traffic reset job

* refactor: remove unused traffic reset logic and clean up client model fields

* cleanup comments

* fix
2025-09-16 09:24:32 +02:00
mhsanaei
cbf316db31 Update check_client_ip_job.go 2025-09-11 11:10:17 +02:00
mhsanaei
82ddd10627 Fixed: update Xray Core on Windows
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (amd64) (push) Has been cancelled
2025-09-10 21:12:37 +02:00
mhsanaei
6b23b416a7 minor changes 2025-08-17 13:37:49 +02:00
fgsfds
ae08a29cde fix: Xray restarting after being manually stopped (#2896) (#3329)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
2025-08-07 23:35:11 +05:00
mhsanaei
0bde51b91e Refactor: Use any instead of interface{} 2025-03-12 20:43:43 +01:00
UltraMegaPotato
cf7fec1351 Change the cpu usage interval from second to minute (#2729)
feature(check_cpu_usage): Change the usage interval from second to minute
2025-03-06 20:38:58 +01:00
AAA
1bbf31df9f feat(externalTrafficJob): External Traffic Inform (#2660)
* Add Setting entity + GUI field in panel settings

* Add a missing 'Traffic' in InformEnabale field

* Add ExternalTrafficURL Post request call

* Add translation + cleanup

* Move options to General tab

---------

Co-authored-by: root <root@vm3562019.stark-industries.solutions>
Co-authored-by: root <root@vm3688062.stark-industries.solutions>
2025-02-22 10:45:14 +01:00
Sanaei
d18a1a37ce revert group management (#2656)
* Revert "json post base path bug fixed (#2647)"

This reverts commit 04cf250a54.

* Revert "Group Management of Subscription Clients"

* Revert "fix getSubGroupClients for enable/disable and edit clients."

* Revert "Enhance database initialization in db.go (#2645)"

This reverts commit 66fe84181b.

* Revert "Add checkpoint handling in CloseDB function (#2646)"

This reverts commit 4dd40f6f19.

* Revert "Improved database model migration and added indexing (#2655)"

This reverts commit b922d986d6.
2025-02-04 11:27:58 +01:00
Ali Rahimi
6e9180a665 Group Management of Subscription Clients (#2644)
* add group user with the same subscription id to all inbounds

* code format compare

* add await for reset client traffic

* en language changed

* added client traffic syncer job

* handle exist email duplicate in sub group

* multi reset and delete request for clients group

* add client traffic syncer setting option

* vi translate file updated

* auto open qr-modal bug fixed
2025-01-21 03:01:54 +01:00
mhsanaei
ee946ceab2 iplimit: ipRegex improved
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.
2025-01-05 18:58:51 +01:00
MHSanaei
f0f4f082ae improve iplimit 2024-12-16 14:26:47 +01:00
mhsanaei
569d99512c iplimit - accept all email format 2024-10-28 20:13:42 +01:00
mhsanaei
7c892ac051 Iplimit - warning improved 2024-09-24 13:24:10 +02:00
mhsanaei
374d49eb92 Iplimit - improved
Ensure accurate extraction of email.
Access logs are needed when the IP limit feature is active.
2024-09-12 09:44:17 +02:00
mhsanaei
2e1461e6dc remove warning for access log
because you can't see the iplimit when there is no path for access log :D
2024-09-09 09:57:30 +02:00
mhsanaei
2001d96148 iplimit - ipv6 support 2024-09-05 13:59:30 +02:00
mhsanaei
24b367b82f fix 2024-07-18 23:03:48 +02:00
mhsanaei
f1500a5d31 improved - message logs 2024-07-08 23:47:49 +02:00
mhsanaei
2486b5ff43 ensure file exists 2024-06-24 09:57:46 +02:00
mhsanaei
28ede36a10 gopsutil v4 2024-06-17 21:48:49 +02:00
somebodywashere
c5b30d6c6c Fix clear logs job (#2090) 2024-03-20 14:17:35 +03:30
Hamidreza
569c9428fb [iplimit] fix access log path in settings service (#2044)
* [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-13 11:24:41 +03:30
Hamidreza
64a5a9f1bc Some fixes and improvements (#1997)
* [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-11 01:01:24 +03:30
somebodywashere
34ab6ed7ee [IPLimit] Added check for accessLogPath 2024-03-05 17:20:00 +03:00
somebodywashere
5ba9d6e118 [IPLimit] Optimize + Debian 12 compability 2024-03-05 16:39:20 +03:00
MHSanaei
6563d23f38 Enhance CheckClientIpJob #1964 2024-03-02 21:16:28 +03:30
somebodywashere
c61575ac9a Create directory for IPLimit files if needed (#1852) 2024-02-21 12:00:28 +03:30
MHSanaei
2b4d6160c4 minor changes 2024-02-18 01:11:43 +03:30
somebodywashere
3a1be63a40 some log changes (#1789)
* some logs changes

* removed some empty lines
2024-02-10 14:10:39 +03:30
MHSanaei
4daaf0a647 clear log hourly if !j.hasLimitIp and "./access.log" exist 2024-02-10 01:52:20 +03:30
MHSanaei
6cf29d5145 fix - Ensure logs are not null in show method #1763 2024-02-06 13:45:01 +03:30
MHSanaei
d171850255 IPLimit - IPv4 Extraction Simplification 2024-02-04 01:51:31 +03:30
MHSanaei
618a566283 new - select option for loglevel & access log 2024-02-04 01:45:55 +03:30
Mehdi Khodayari
98dd6bb949 This modification uses a Scanner to read the file line by line, which can be more memory-efficient for large files. (#1736) 2024-02-03 14:11:57 +03:30
Saeid
6c0775b120 Show outbound traffic in outbounds table (#1711)
* store outbound traffic in database

* show outbound traffic in outbounds table

* add refresh button
2024-01-30 00:07:20 +03:30
MHSanaei
e7ce8c8ddb minor changes
disAllowedIps doesn't show on debug if there is no ip
change copy to clipboard to export inbound
2024-01-21 14:39:15 +03:30
somebodywashere
ceee1e4277 Major changes to tgbot, also small changes for panel (#1463)
* 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
2024-01-01 18:37:56 +03:30
MHSanaei
6765babe7b check fail2ban installed or not 2023-09-01 13:23:50 +03:30
MHSanaei
1277285d08 [db] Enbancement add traffic fully transactional
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-08-26 15:19:51 +03:30
MHSanaei
e00c3f1823 add panel usage to main page 2023-08-09 00:37:05 +03:30