Commit graph

105 commits

Author SHA1 Message Date
google-labs-jules[bot]
11dc06863e feat: Add multi-server support for Sanai panel
This commit introduces a multi-server architecture to the Sanai panel, allowing you to manage clients across multiple servers from a central panel.

Key changes include:

- **Database Schema:** Added a `servers` table to store information about slave servers.
- **Server Management:** Implemented a new service and controller (`MultiServerService` and `MultiServerController`) for CRUD operations on servers.
- **Web UI:** Created a new web page for managing servers, accessible from the sidebar.
- **Client Synchronization:** Modified the `InboundService` to synchronize client additions, updates, and deletions across all active slave servers via a REST API.
- **API Security:** Added an API key authentication middleware to secure the communication between the master and slave panels.
- **Multi-Server Subscriptions:** Updated the subscription service to generate links that include configurations for all active servers.
- **Installation Script:** Modified the `install.sh` script to generate a random API key during installation.

**Known Issues:**

- The integration test for client synchronization (`TestInboundServiceSync`) is currently failing. It seems that the API request to the mock slave server is not being sent correctly or the API key is not being included in the request header. Further investigation is needed to resolve this issue.
2025-07-27 17:25:58 +02:00
Alireza Ahmadi
487ec74e0b add mldsa65 2025-07-25 01:22:01 +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
Shishkevich D.
c988d55256
fix: handle inbounds interaction errors (#3009)
eliminates messages like: “Inbound created successfully (Port 100 is already busy)”.
2025-05-16 23:56:56 +07:00
Shishkevich D.
1ddfe4aba3
chore: toasts translation refactoring
Some checks are pending
Build and Release 3X-UI / build (386) (push) Waiting to run
Build and Release 3X-UI / build (amd64) (push) Waiting to run
Build and Release 3X-UI / build (arm64) (push) Waiting to run
Build and Release 3X-UI / build (armv5) (push) Waiting to run
Build and Release 3X-UI / build (armv6) (push) Waiting to run
Build and Release 3X-UI / build (armv7) (push) Waiting to run
Build and Release 3X-UI / build (s390x) (push) Waiting to run
2025-05-09 10:46:29 +07:00
Shishkevich D.
fe3b1c9b52
chore: implement 2fa auth (#2968)
Some checks failed
Build and Release 3X-UI / build (386) (push) Has been cancelled
Build and Release 3X-UI / build (amd64) (push) Has been cancelled
Build and Release 3X-UI / build (arm64) (push) Has been cancelled
Build and Release 3X-UI / build (armv5) (push) Has been cancelled
Build and Release 3X-UI / build (armv6) (push) Has been cancelled
Build and Release 3X-UI / build (armv7) (push) Has been cancelled
Build and Release 3X-UI / build (s390x) (push) Has been cancelled
* chore: implement 2fa auth

from #2786

* chore: format code

* chore: replace two factor token input with qr-code

* chore: requesting confirmation of setting/removing two-factor authentication

otpauth library was taken from cdnjs

* chore: revert changes in `ClipboardManager`

don't need it.

* chore: removing twoFactor prop in settings page

* chore: remove `twoFactorQr` object in `mounted` function
2025-05-08 16:20:58 +02:00
Shishkevich D.
1aed2d8cdc
feat: implement geofiles update in panel (#2971)
solves #2672

Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
2025-05-06 18:10:58 +02:00
Columbiysky
85cbad3ef4
feat: hashing user passwords
solves problems #2944, #2783
2025-05-03 16:27:53 +07:00
mhsanaei
0bde51b91e
Refactor: Use any instead of interface{} 2025-03-12 20:43:43 +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
b29bd993d4
fix session
twice  set-cookie bug fixed
2024-12-16 14:24:59 +01:00
lexnake3
749a426a71
show IP on warning log when user pass is not correct (#2607) 2024-12-03 22:41:14 +01:00
Vyacheslav Scherbinin
27434f3235
Fix toasts (#2571)
* Add space to toast status messages

* Removed opening space from translations
2024-09-30 17:06:38 +02:00
mhsanaei
663cf5649f Session - default 60 minute (minimum) 2024-09-12 09:41:24 +02:00
mhsanaei
3e3ed4ed52 fix session 2024-08-06 13:44:48 +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
bb9b9100a8 [warp] enhanced + delete option
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2024-07-15 00:21:54 +02:00
mhsanaei
de985263f5 safe login
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2024-07-14 23:37:43 +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
02ae61fe6b change session name 2024-07-05 14:33:04 +02:00
mhsanaei
24b9e5bfa3 some changes 2024-07-04 15:04:04 +02:00
mhsanaei
21b64beb96 tgbot - login notify (show password for failed login) 2024-07-03 21:53:45 +02:00
Ahmad Thoriq Najahi
d070a82b3d
feat: Enhance host extraction from headers (#2292)
- Refactor SUBController subs and subJsons methods to extract host from X-Forwarded-Host header, falling back to X-Real-IP header and then to the request host if unavailable.
- Update html function to extract host from X-Forwarded-Host header, falling back to X-Real-IP header and then to the request host if unavailable.
- Update DomainValidatorMiddleware to first attempt to extract host from X-Forwarded-Host header, falling back to X-Real-IP header and then to the request host.

Fixes: #2284

Signed-off-by: Ahmad Thoriq Najahi <najahi@zephyrus.id>
2024-05-23 23:51:19 +02:00
mhsanaei
5ec16301a6 Add X-Real-IP Support for Client IP (login page) 2024-05-23 15:16:13 +02:00
mhsanaei
e7c59adc59 Ensure IPv6 compliant host
Co-Authored-By: vnxme <46669194+vnxme@users.noreply.github.com>
2024-05-22 20:06:49 +02:00
MHSanaei
6c73791cab [xray] add BurstObservatory + minor changes
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2024-03-11 11:46:54 +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
MHSanaei
c31882cb92 bug fix #1595 2024-02-21 22:20:51 +03:30
MHSanaei
03b7a34793 [sub] json + fragment
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2024-02-21 14:17:52 +03:30
surbiks
13de2c6ca0
add outbound traffic reset (#1767) 2024-02-07 11:25:31 +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
9fba92d879 v2.1.2
revert #1650 #1661 #1664 #1670
made panel full of bug
2024-01-27 00:32:19 +03:30
Ali Rahimi
538fc9b365
add single client bug fixed (#1664) 2024-01-23 13:30:21 +03:30
Ali Rahimi
b172d450e3 Group editing feature of users with the same subscription (#1661) 2024-01-22 15:08:36 +03:30
Ali Rahimi
5c695ca652
add group user with the same subscription id to all inbounds (#1650) 2024-01-21 17:56:19 +03:30
Amin
62f08e877d
Fix inbounds with the same port and different IPs (#1595) 2024-01-17 16:21:28 +03:30
MHSanaei
bee690429f WARP via wireguard
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2024-01-11 09:57:21 +03:30
Alireza Ahmadi
4cb67fd1c3 [xray] show xray errors #1300 2023-12-10 12:57:39 +01:00
Alireza Ahmadi
35feef650f import-export inbound #1300 2023-12-08 20:08:44 +01:00
Alireza Ahmadi
5e47b4e949 pagination and sub URI support #1300 2023-12-08 17:18:51 +01:00
Alireza Ahmadi
c419eadf15 xray setting enhancements #1286 2023-12-05 18:20:44 +01:00
MHSanaei
4d3bea48e1 [api] online users
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-12-05 14:40:16 +03:30
Alireza Ahmadi
2a8da2ba3c separate xray page #1286 2023-12-04 19:20:46 +01:00
Alireza Ahmadi
f734c821d6 online users backend #1286 2023-12-04 19:13:21 +01:00
MHSanaei
be4a68bd8b move restart cron to web.go
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-09-06 18:22:37 +03:30
MHSanaei
1c1f53267a Add encrypt subscription ON/OFF switch
Co-Authored-By: SudoSpace <79229394+sudospaes@users.noreply.github.com>
2023-08-26 16:54:01 +03:30
MHSanaei
38e1d0f94e [sub] improve usage info in Remark
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-08-26 15:11:12 +03:30
MHSanaei
bf971911d5 log level & syslog
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-07-31 20:11:47 +03:30