Commit graph

1247 commits

Author SHA1 Message Date
Дмитрий Саенко
e21080f843 Merge branch 'main' of https://github.com/dimasmir03/3x-ui into feature/multi-server-support 2025-11-01 16:08:12 +03:00
Дмитрий Саенко
2f0fe071cf Merge branch 'main' of https://github.com/dimasmir03/3x-ui into feature/multi-server-support 2025-11-01 16:06:58 +03:00
Дмитрий Олегович Саенко
4a75bd0a48
Feature: add setting certs for subscription while generating for panel (#3578)
Some checks are pending
Release 3X-UI / build (386) (push) Waiting to run
Release 3X-UI / build (amd64) (push) Waiting to run
Release 3X-UI / build (arm64) (push) Waiting to run
Release 3X-UI / build (armv5) (push) Waiting to run
Release 3X-UI / build (armv6) (push) Waiting to run
Release 3X-UI / build (armv7) (push) Waiting to run
Release 3X-UI / build (s390x) (push) Waiting to run
Release 3X-UI / Build for Windows (push) Waiting to run
2025-11-01 13:10:27 +01:00
Rashid Yusubov
b0c223c631
fix: improve russian localization (#3576)
* fix: improve russian localization

* fix: updating the Russian translation according to the suggestions
2025-11-01 13:07:49 +01:00
Denis Gorelov
313b51f96f
feat: Add random Reality Target/SNI selection from 52 popular services (#3577)
* feat: Add random Reality Target/SNI selection from 52 popular services

- Created reality_targets.js with list of 52 popular services
- Updated RealityStreamSettings to use random targets by default
- Added UI randomize buttons with sync icon in Reality settings form
- Implemented randomizeRealityTarget() method in inbound modal
- Replaces hardcoded google.com with diverse global services

* fix

---------

Co-authored-by: mhsanaei <ho3ein.sanaei@gmail.com>
2025-11-01 13:07:05 +01:00
OleksandrParshyn
020cd63e22
Fix: Graceful Telegram bot shutdown to prevent 409 Conflict (#3580)
* Fix: Graceful Telegram bot shutdown to prevent 409 Conflict

Introduces a `botCancel` context and a global `StopBot()` function to ensure the Telegram bot's Long Polling operation is safely terminated (via context cancellation) before the service restarts. This prevents the "Conflict: another update consumer is running" (409) error upon panel restart.

Changes:
- Added `botCancel context.CancelFunc` to manage context cancellation.
- Implemented global `StopBot()` function.
- Updated `Tgbot.Stop()` to call `StopBot()`.
- Modified `Tgbot.OnReceive()` to use the new cancellable context for `UpdatesViaLongPolling`.

* Fix: Prevent race condition and goroutine leak in TgBot

Addresses a critical race condition on the global `botCancel` variable, which could occur if `Tgbot.OnReceive()` was called concurrently (e.g., during rapid panel restarts or unexpected behavior).

Changes in tgbot.go:
- Added `tgBotMutex sync.Mutex` to ensure thread safety.
- Protected `botCancel` creation and assignment in `OnReceive()` using the mutex, and added a check to prevent overwriting an active context, which avoids goroutine leaks.
- Protected the cancellation and cleanup logic in `StopBot()` with the mutex.

* Refactor: Replace time.Sleep with sync.WaitGroup for reliable TgBot shutdown

Replaced the unreliable `time.Sleep(1 * time.Second)` in `service.StopBot()` with `sync.WaitGroup`. This ensures the Long Polling goroutine is explicitly waited for and reliably exits before the panel continues, preventing potential resource leaks and incomplete shutdowns during restarts.

Changes:
- Added `botWG sync.WaitGroup` variable.
- Updated `service.StopBot()` to call `botWG.Wait()` instead of `time.Sleep()`.
- Modified `Tgbot.OnReceive()` to correctly use `botWG.Add(1)` and `defer botWG.Done()` within the Long Polling goroutine.
- Corrected the goroutine structure in `OnReceive()` to properly encapsulate all message handling logic.
2025-11-01 13:01:44 +01:00
Дмитрий Саенко
2746bdcfa8 this feat for next patch 2025-10-31 22:21:21 +03:00
Дмитрий Саенко
34e244951e revert trash 2025-10-31 21:56:02 +03:00
Дмитрий Саенко
2ac59a6c46 fix 2025-10-31 21:29:38 +03:00
Дмитрий Саенко
b2efeec70f feat sync btn 2025-10-29 22:17:26 +03:00
Дмитрий Саенко
72109c040e fix bud with add new apikey every install 2025-10-28 09:30:41 +03:00
Дмитрий Саенко
97729cb3dc fix nil pointer 2025-10-28 09:16:00 +03:00
Дмитрий Саенко
5c25855635 fix error with null user when api throw apikey 2025-10-28 09:07:34 +03:00
Дмитрий Саенко
599686ea34 fix path endpoint 2025-10-26 23:03:46 +03:00
Дмитрий Саенко
0649a15c89 feature: setting certs for subscription whule generating 2025-10-26 15:43:34 +03:00
Дмитрий Саенко
d7d129ced5 fix path for endpoint 2025-10-26 14:49:53 +03:00
Дмитрий Саенко
4dbd9536ec fix type www-form-urlencoded -> x-www-form-urlencoded 2025-10-26 14:19:58 +03:00
Дмитрий Саенко
ac16c6c44d add middliware with debug log 2025-10-25 16:02:45 +03:00
Дмитрий Саенко
7bff382857 inbound.UserId = 1 if api if user == nil 2025-10-25 15:45:32 +03:00
Дмитрий Саенко
6b9005d1f2 try skip UserId if this nil 2025-10-25 15:28:00 +03:00
Дмитрий Саенко
f02bddd1fe add debug recover 2025-10-25 14:55:26 +03:00
Дмитрий Саенко
153f7e6053 add debug err log 2025-10-25 14:48:01 +03:00
Дмитрий Саенко
1503e5cf37 clear 2025-10-25 14:38:44 +03:00
Дмитрий Саенко
62825dc188 add in err log msg 2025-10-25 14:35:06 +03:00
Дмитрий Саенко
d3865bf4d1 try fix err with nil in body 2025-10-25 14:23:46 +03:00
Дмитрий Саенко
0a6e02cf18 change ShouldBind -> ShouldBindWith + binding.Form 2025-10-25 13:57:07 +03:00
Дмитрий Саенко
030adb5268 add mode debug for request 2025-10-23 21:48:15 +03:00
Дмитрий Саенко
5e98521fbb add debug log 2025-10-23 21:15:56 +03:00
Дмитрий Саенко
1f3a7c947a add debug log 2025-10-23 19:55:35 +03:00
Дмитрий Саенко
f8c2e90e44 fix any 2025-10-23 18:21:22 +03:00
Дмитрий Саенко
95a06100af fix path with / / 2025-10-23 18:08:52 +03:00
Дмитрий Саенко
5ea900ff48 add debug log 2025-10-23 18:00:37 +03:00
Дмитрий Саенко
f13165feea try fix err 2025-10-23 17:24:46 +03:00
Дмитрий Саенко
8fcb8c549a fix convert model.Inbound to form 2025-10-23 16:23:26 +03:00
Дмитрий Саенко
430b0f07cd fix 2025-10-23 15:50:29 +03:00
Дмитрий Саенко
7623f61ec7 fix 2025-10-23 15:38:00 +03:00
Дмитрий Саенко
0b0a71f55a fix 2025-10-23 15:17:53 +03:00
Дмитрий Саенко
149ab52057 fix error with this. 2025-10-23 14:38:45 +03:00
Дмитрий Саенко
56109965f4 fix secretwebpath 2025-10-23 14:14:45 +03:00
Дмитрий Саенко
62fccb7ea5 fix method 2025-10-23 13:28:11 +03:00
Дмитрий Саенко
1546109cef fix 2025-10-23 13:19:23 +03:00
Дмитрий Саенко
9d0f2c953f feature: получение онлайна с каждого сервера 2025-10-22 22:09:55 +03:00
Дмитрий Саенко
971513464e исправил работу с SecretWebPath 2025-10-22 14:21:22 +03:00
Дмитрий Саенко
b687487aff добавил secretWEbPath в UI и model.Server 2025-10-22 13:48:41 +03:00
Дмитрий Саенко
20efe2258c добавил синхронизацию и изменил функцию синхронизации 2025-10-22 13:41:20 +03:00
Дмитрий Саенко
773e770cee asd 2025-10-22 12:36:55 +03:00
Дмитрий Саенко
cccc9914a1 исправления пути для api 2025-10-22 10:56:59 +03:00
mhsanaei
713a7328f6
gofmt
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 (push) Has been cancelled
2025-10-21 13:02:55 +02:00
Дмитрий Саенко
2f033c8e01 0.1.1 исправил bug с basPath 2025-10-21 09:05:17 +03:00
Дмитрий Саенко
0b9b7ffa90 изменил middleware проверки Auth: добавил проверку ApiKey 2025-10-19 18:41:08 +03:00