Commit graph

60 commits

Author SHA1 Message Date
mhsanaei
1c452cb40e Refactor: Use any instead of interface{} 2025-03-12 20:43:43 +01:00
UltraMegaPotato
2393010464 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
6f3856211e 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
7e64355f51 revert group management (#2656)
* Revert "json post base path bug fixed (#2647)"

This reverts commit 2c88e53ba0.

* 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 fc8cce9f90.

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

This reverts commit 13b1e4c7e6.

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

This reverts commit cb6ba20865.
2025-02-04 11:27:58 +01:00
Ali Rahimi
661ae0e671 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
23cc2e4cb8 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
1de6f9a2c5 improve iplimit 2024-12-16 14:26:47 +01:00
mhsanaei
ab093f9168 iplimit - accept all email format 2024-10-28 20:13:42 +01:00
mhsanaei
4317872184 Iplimit - warning improved 2024-09-24 13:24:10 +02:00
mhsanaei
6d9ec4d839 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
17c020e4f4 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
f83edc90b4 iplimit - ipv6 support 2024-09-05 13:59:30 +02:00
mhsanaei
2ce76ddd8e fix 2024-07-18 23:03:48 +02:00
mhsanaei
4ed0f6bfc8 improved - message logs 2024-07-08 23:47:49 +02:00
mhsanaei
e9e27c6ffa ensure file exists 2024-06-24 09:57:46 +02:00
mhsanaei
d5d53adc3c gopsutil v4 2024-06-17 21:48:49 +02:00
somebodywashere
d4433d73d0 Fix clear logs job (#2090) 2024-03-20 14:17:35 +03:30
Hamidreza
8970f8f1a6 [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
d503bff637 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
e0d863a957 [IPLimit] Added check for accessLogPath 2024-03-05 17:20:00 +03:00
somebodywashere
34335d12a4 [IPLimit] Optimize + Debian 12 compability 2024-03-05 16:39:20 +03:00
MHSanaei
5997b3484c Enhance CheckClientIpJob #1964 2024-03-02 21:16:28 +03:30
somebodywashere
50342799c7 Create directory for IPLimit files if needed (#1852) 2024-02-21 12:00:28 +03:30
MHSanaei
38431ba9af minor changes 2024-02-18 01:11:43 +03:30
somebodywashere
b2d753b80b some log changes (#1789)
* some logs changes

* removed some empty lines
2024-02-10 14:10:39 +03:30
MHSanaei
7cb36f2072 clear log hourly if !j.hasLimitIp and "./access.log" exist 2024-02-10 01:52:20 +03:30
MHSanaei
2d354eafa3 fix - Ensure logs are not null in show method #1763 2024-02-06 13:45:01 +03:30
MHSanaei
17646fd6be IPLimit - IPv4 Extraction Simplification 2024-02-04 01:51:31 +03:30
MHSanaei
759234d0c5 new - select option for loglevel & access log 2024-02-04 01:45:55 +03:30
Mehdi Khodayari
53b28ee354 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
23cf83c8f1 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
c5a27d27f1 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
071fd5d2ea 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
3982ea9da4 check fail2ban installed or not 2023-09-01 13:23:50 +03:30
MHSanaei
e6a98904e1 [db] Enbancement add traffic fully transactional
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-08-26 15:19:51 +03:30
MHSanaei
00762ef282 add panel usage to main page 2023-08-09 00:37:05 +03:30
somebodywashere
e9eca78515 IP Limit Tweaks to reduce false bans (#850)
* 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-08-02 00:28:16 +03:30
somebodywashere
172a5e5b85 No reason to write to BlockedIPs (#815) 2023-07-26 20:03:28 +03:30
MHSanaei
63ce333037 [feature] using xray API for inbound
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-07-18 02:40:22 +03:30
Hamidreza
b0209fb0f9 🚀 Some improvements for x-ui.sh and ip job (#665) 2023-07-01 15:56:43 +03:30
somebodywashere
b0a3bcad78 Added IP Limit Management to x-ui menu, Tweaked IP Limit to check every 20s (#615)
Co-authored-by: Hamidreza <70919649+hamid-gh98@users.noreply.github.com>
Co-authored-by: Ho3ein <ho3ein.sanaei@gmail.com>
2023-06-25 00:06:18 +03:30
Ho3ein
eb92c3d14c new - loglevel (#612) 2023-06-16 18:25:33 +03:30
MHSanaei
cb81ce9bf2 fix warning when there is no access.log
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-16 01:08:35 +03:30
somebodywashere
315dbe24e4 Removed ipLimit from the panel, changed the code to work with fail2ban (#580)
* 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-15 22:45:34 +03:30
MHSanaei
6897534eb9 access.log #571
access.log will be clear only when limitip is not 0
2023-06-08 13:50:35 +03:30
MHSanaei
54da8ad9bd [feature] using xray api and more
Improve DB performance
[api] backward compatibility: add client by update

Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-06-05 00:32:19 +03:30
MHSanaei
8d7199c678 some changes
ip limit method back to v1.6.0 method
remove event on getDBClientIps
better show ip on log (",\n")
2023-06-03 18:59:32 +03:30
MHSanaei
2af8dd908b change blockedips to AllowedIps
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
2023-05-25 03:21:31 +03:30
MHSanaei
a67fb4999b bug fix - limit ip 2023-05-23 17:54:15 +03:30
Hamidreza Ghavami
9b7c8cad28 Update tgbot locale + add I18nBot 2023-05-21 03:30:26 +04:30