Commit Graph

117 Commits

Author SHA1 Message Date
MHSanaei 9f0055d193 bug fix 2026-04-20 19:46:21 +02:00
MHSanaei ae5ad505d0 add hysteria inbound
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2026-04-20 16:05:27 +02:00
Andrew Smirnov e986a133f8 Add new hourly reset traffic (#3966)
* Add new hourly reset traffic

* fix
2026-04-19 21:37:34 +02:00
Alimpo 7f7ae0c547 fix: stop overwriting client_traffics.enable with JSON enable in GetClientTrafficByEmail (#3931)
When a client hit traffic/expiry limit, disableInvalidClients sets
client_traffics.enable=false and removes the user from Xray. GetClientTrafficByEmail
was overwriting that with settings.clients[].enable (admin config), so
ResetClientTraffic never saw the client as disabled and did not re-add
the user. Clients could not connect until manually disabled/re-enabled.
Now the DB runtime enable flag is preserved; reset correctly re-adds
the user to Xray.
2026-03-17 21:20:24 +01:00
MHSanaei 5b796672e9 Improve telego client robustness and retries
Add a createRobustFastHTTPClient helper to configure fasthttp.Client with better timeouts, connection limits, retries and optional SOCKS5 proxy dialing. Validate and sanitize proxy and API server URLs instead of returning early on invalid values, and build telego.Bot options dynamically. Reduce long-polling timeout to detect connection issues faster and adjust update retrieval comments. Implement exponential-backoff retry logic for SendMessage calls to handle transient connection/timeouts and improve delivery reliability; also reduce inter-message delay for better throughput.
2026-02-14 22:49:19 +01:00
MHSanaei e5c0fe3edf bug fix #3785 2026-02-11 22:21:09 +01:00
lolka1333 4800f8fb70 feat: Real-time Outbound Traffic, UI Improvements & Fix (#3629)
* Refactor HTML and JavaScript for improved UI and functionality

- Cleaned up JavaScript methods in subscription.js for better readability.
- Updated inbounds.html to clarify traffic update handling and removed unnecessary comments.
- Enhanced xray.html by correcting casing in routingDomainStrategies.
- Added mobile touch scrolling styles in page.html for better tab navigation on small screens.
- Streamlined vless.html by removing redundant line breaks and improving form layout.
- Refined subscription subpage.html for better structure and user experience.
- Adjusted outbounds.html to improve button visibility and functionality.
- Updated xray_traffic_job.go to ensure accurate traffic updates and real-time UI refresh.

* Refactor client traffic handling in InboundService

- Updated addClientTraffic method to initialize onlineClients as an empty slice instead of nil.
- Improved clarity and consistency in handling empty onlineUsers scenario.

* Add WebSocket support for outbounds traffic updates

- Implemented WebSocket connection in xray.html to handle real-time updates for outbounds traffic.
- Enhanced xray_traffic_job.go to retrieve and broadcast outbounds traffic updates.
- Introduced MessageTypeOutbounds in hub.go for managing outbounds messages.
- Added BroadcastOutbounds function in notifier.go to facilitate broadcasting outbounds updates to connected clients.

---------

Co-authored-by: lolka1333 <test123@gmail.com>
2026-01-05 05:50:40 +01:00
mhsanaei 713a7328f6 gofmt 2025-10-21 13:02:55 +02:00
konstpic 28a17a80ec feat: add ldap component (#3568)
* 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 26c6438ec2 fix api : subid, uuid from inbound settings 2025-09-23 11:52:40 +02:00
mhsanaei b45e63a14a API: UUID for getClientTraffics 2025-09-21 19:16:54 +02:00
mhsanaei 6ced549dea docs: add comments for all functions 2025-09-20 09:35:50 +02:00
mhsanaei f60682a6b7 new: VACUUM database 2025-09-19 17:14:39 +02:00
mhsanaei 7447cec17e go package correction v2 2025-09-19 10:05:43 +02:00
mhsanaei 0ffd27c0aa v2.8.2 2025-09-19 00:22:15 +02:00
mhsanaei 054cb1dea0 go package correction 2025-09-18 23:12:14 +02:00
RahGozar fcdeb1fc79 feat: add UUID to ClientTraffic (#3491)
* Update client_traffic.go

* Update inbound.go
2025-09-17 17:45:28 +02:00
mhsanaei 299572a4c2 API: subid to getClientTraffics
/getClientTraffics/:email
/getClientTrafficsById/:id
2025-09-17 01:29:22 +02:00
mhsanaei dc21f41932 bug fix: del Depleted 2025-09-16 18:28:02 +02:00
mhsanaei f137b1af76 bug fix: enable 2025-09-16 14:57:31 +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 2f36a4047c API: delClientByEmail 2025-09-10 16:36:12 +02:00
Ali Golzar ed2a0a0bcf fix: prevent client updated_at from resetting when parent inbound is updated 2025-09-02 13:30:41 +03:30
Ali Golzar 4a0914cb1e feat: add "Last Online" column to client list and modal (Closes #3402) (#3405)
* feat: persist client last online and expose API

* feat(ui): show client last online in table and info modal

* i18n: add “Last Online” across locales

* chore: format timestamps as HH:mm:ss
2025-08-31 18:33:50 +02:00
mhsanaei 0c7b59ed47 removed: Allocate 2025-08-28 10:15:04 +02:00
Ali Golzar 3087c1b123 Add all-time traffic for inbounds and clients (#3387)
* feat(db): add allTime field to Inbound and ClientTraffic models

* feat(inbound): increment all_time for inbounds and clients on traffic updates

calculate correct all_time traffic on migrate command

* feat(ui): show all-time traffic column for inbounds and its clients

* i18n: add pages.inbounds.allTimeTraffic label across locales

* Add All Time Traffic Usage in inbounds page top banner
2025-08-28 01:10:50 +02:00
Ali Golzar 2198397197 Created / Updated fields for clients (#3384)
* feat(backend): add created_at/updated_at to clients and maintain on create/update
backfill existing clients and set updated_at on mutations

* feat(frontend): carry created_at/updated_at in client models and round-trip via JSON

* feat(frontend): display Created and Updated columns in client table with proper date formatting

* i18n: add pages.inbounds.createdAt/updatedAt across all locales

* Update inbound.go

Remove duplicate code
2025-08-27 19:30:49 +02:00
mhsanaei 6b23b416a7 minor changes 2025-08-17 13:37:49 +02:00
Azavax b1ab156e42 Endpoint for updating client traffic by email (#3259)
* Update api.go

* Update inbound.go

* Update inbound.go
2025-07-22 23:43:48 +02:00
nistootsin d39ccf4b8f Added 3 new buttons to telegram bot (#2965)
* Add a new button to but : Reset All Clients

* handel translation for `Reset All Clients` button

* refactoring

* add a new button to telegram bot >> `Sorted Traffic Usage Report`

* - refactoring

* add ip limit conifg on new client adding time
2025-05-06 18:27:17 +02:00
mhsanaei 0bde51b91e Refactor: Use any instead of interface{} 2025-03-12 20:43:43 +01:00
Alireza Ahmadi 2ce9c3cc81 fix core restart on client change (#2603) 2024-11-16 17:05:23 +03:30
MHSanaei 1c2b6095c9 fix core restart on traffic reset of disabled client
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2024-10-15 20:54:23 +02:00
Alireza Ahmadi 1454c4ebc5 [bug] fix restarting core on disabling depleted user 2024-10-10 17:37:06 +02:00
Alireza Ahmadi 4b1c76e972 [refactor] email verification method 2024-10-10 17:32:50 +02:00
mhsanaei 4f2f855c04 validate Email - non-English Pattern 2024-10-09 10:49:05 +02:00
mhsanaei 566cd9e9c4 New - Allocate 2024-09-16 11:41:21 +02:00
mhsanaei 3e7c7831bc Email Validation - new pattern
@ included
2024-09-12 10:07:53 +02:00
mhsanaei b4baf35ed8 Update Email Validation 2024-09-05 15:16:15 +02:00
mhsanaei 2dc59a601c fix restart after enabling user
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2024-09-02 10:26:19 +02:00
mhsanaei 93d52bc86c new - vmess security (inbound client side - outbound) 2024-08-11 00:47:44 +02:00
mhsanaei c7906e8598 API - Get client's traffic By ID
Co-Authored-By: Hassan Ali Gilani <mr.ajaxian@gmail.com>
2024-07-23 11:28:28 +02:00
mhsanaei f1500a5d31 improved - message logs 2024-07-08 23:47:49 +02:00
mhsanaei 7a51d2f2cc Typo fixed 2024-07-07 12:10:24 +02:00
mhsanaei 9ff7f14b6e unnecessary log 2024-07-04 00:28:37 +02:00
mhsanaei c3b42b8ea4 typo 2024-07-04 00:17:44 +02:00
mhsanaei 33082a271f check error in remove by core-api
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2024-06-17 21:55:09 +02:00
mhsanaei e794d3d87f fix empty client ID on request
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2024-04-21 00:58:37 +03:30
somebodywashere 7118d92980 Convert string tgId to int64 on Migrate 2024-04-05 12:24:18 +03:00
mhsanaei eb382cd5b4 tgbot - fix chatid 2024-04-02 15:04:44 +03:30