Commit Graph

48 Commits

Author SHA1 Message Date
Abdalrahman 033c5993e0 feat: add API token to install output (#4322)
* feat: add API token to install output

Add -getApiToken flag to the setting subcommand so shell scripts
can retrieve the panel API token. Include the token in the
install.sh completion banner for automation/deployment use.

* fix(install): adapt -getApiToken CLI to multi-token service

settingService.GetApiToken was removed when API tokens moved to a
multi-row ApiTokenService. Switch the install-time CLI to list tokens
and create one named "install" if none exist, preserving the
`apiToken: <value>` output the install.sh grep depends on.

---------

Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
2026-05-14 10:24:23 +02:00
Farhad H. P. Shirvan d86e87ed30 Fix: traffic writer restart freeze (#4265)
* feat(traffic_writer): enhance traffic writer with concurrency safety and state management

* Revert "feat(traffic_writer): enhance traffic writer with concurrency safety and state management"

This reverts commit e6760ae39629a592dec293197768f27ff0f5a578.

* feat(traffic_writer): enhance traffic writer with concurrency safety and state management

* feat(web): implement panel-only start/stop methods for in-process restarts
2026-05-12 11:36:05 +02:00
MHSanaei 6a90f98412 feat(inbounds): add sub/client link endpoints; hide panel version on login
- New GET /panel/api/inbounds/getSubLinks/:subId and /getClientLinks/:id/:email
  return the same protocol URLs the panel UI's Copy button emits, honouring
  X-Forwarded-Host / X-Forwarded-Proto. Documented in the API docs page.
- Refactor: sub package no longer imports web. The embedded dist FS is
  injected via sub.SetDistFS, and the link generator is registered with the
  service layer via service.RegisterSubLinkProvider, avoiding the circular
  import the new endpoints would otherwise introduce.
- Security: stop emitting window.X_UI_CUR_VER on login.html and drop the
  visible version chip from the login page, so the panel version is no
  longer pre-auth info disclosure. Authenticated pages still receive it.
- Bump config/version.
2026-05-11 15:03:47 +02:00
MHSanaei 7cd26a0583 v3 2026-05-10 02:13:42 +02:00
MHSanaei 0b5c239f98 v2.9.3 2026-04-27 15:31:32 +02:00
Alireza Ahmadi 3ec5b3589f fix windows build 2026-02-20 02:07:46 +01:00
Alireza Ahmadi 2b1d3e7347 [feat] restart xray-core from cli #3825 2026-02-20 00:03:16 +01:00
Ilya Kryuchkov 6041d10e3d Refactor code and fix linter warnings (#3627)
* refactor: use any instead of empty interface

* refactor: code cleanup
2026-01-05 05:54:56 +01:00
OleksandrParshyn 9936af80dd Fix: Invoke service.StopBot() in signal handlers (#3583)
Ensures the global Telegram bot stop function (`service.StopBot()`) is called upon receiving system signals (SIGHUP for restart, SIGINT/SIGTERM for shutdown). This complements the changes in `tgbot.go` to guarantee a clean shutdown of the Telegram bot's Long Polling operation, fully resolving the 409 Conflict issue during panel restarts or shutdowns.

Changes:
- Added `service.StopBot()` call to the `syscall.SIGHUP` handler.
- Added `service.StopBot()` call to the default shutdown handler.
2025-11-01 14:33:35 +01:00
Дмитрий Олегович Саенко 4a75bd0a48 Feature: add setting certs for subscription while generating for panel (#3578) 2025-11-01 13:10:27 +01:00
mhsanaei eacfbc86b5 security fix: Command built from user-controlled sources CWE-78
https://cwe.mitre.org/data/definitions/78.html
https://owasp.org/www-community/attacks/Command_Injection
2025-09-21 17:39:30 +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
Shishkevich D. 5d11e6e13f chore: reset two-factor authentication after changing admin credentials (#3029)
* chore: add `resetTwoFactor` argument for main.go

fixes #3025

* chore: reset two-factor authentication after changing admin credentials

* chore: reset two-factor authentication after changing admin credentials

---------

Co-authored-by: somebodywashere <68244480+somebodywashere@users.noreply.github.com>
Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
2025-07-02 11:25:25 +02:00
Ali Golzar 1b1cbfff42 feat: support .env file (#3013) 2025-05-17 12:33:22 +02:00
Shishkevich D. fe3b1c9b52 chore: implement 2fa auth (#2968)
* 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. 13cf7271d6 fix: check default credentials during a fresh installation 2025-05-06 09:05:32 +07:00
Shishkevich D. 63edc63ab0 chore: do not show the current login and password (#2969) 2025-05-03 18:00:25 +07:00
mhsanaei c158e6ec73 getListen & getCert 2024-10-31 01:10:17 +01:00
mhsanaei 5ae587ee81 bash - set or reset listenIP
we need this if we want to add SSH port forwarding
2024-10-30 16:35:36 +01:00
mhsanaei bda5c2c915 small changes 2024-08-08 17:40:26 +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 fdf805f264 minor changes 2024-05-28 16:28:20 +02:00
Maisam adcfccbe45 Add CLI to set panel cert (#2305)
* Add webBasePath update feature to CLI

* Add certificate setting update to CLI

* Revert "Add certificate setting update to CLI"

This reverts commit 2a937d59d7c1f3edeb66782a4b235bafc89dfff6.

* Add certificate setting update to CLI

(cherry picked from commit 2a937d59d7c1f3edeb66782a4b235bafc89dfff6)
2024-05-25 11:35:27 +02:00
Maisam c422214ae8 Add webBasePath update feature to CLI (#2300) 2024-05-25 10:15:06 +02:00
mhsanaei c0b5d5506f View Current Settings - show webBasePath 2024-05-24 11:08:16 +02:00
MHSanaei dd21bb2db7 bug fix - remove secret 2024-03-12 20:45:44 +03:30
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
Ho3ein 5188d516e3 new - loglevel (#612) 2023-06-16 18:25:33 +03:30
MHSanaei e4e0deeed4 removed - v2-ui migrate 2023-06-01 01:14:54 +03:30
MHSanaei 6f46f3e636 sub
remaining code
2023-05-22 21:51:52 +03:30
Hamidreza 6602c55f3c Update main.go 2023-05-06 00:00:56 +03:30
Hamidreza d405141ad0 Merge branch 'MHSanaei:main' into main 2023-05-05 23:57:06 +03:30
Ho3ein b2d70a2a9b Revert "feat: Adding Cobra to provide a more intuitive command line interface" 2023-05-05 23:34:38 +03:30
Hamidreza Ghavami 26f160fb89 add MigrateDB func for a single source of truth 2023-05-06 00:22:39 +04:30
kaveh-ahangar 83ffa25d6f feat: Rollback files (main.go , Makefile) 2023-05-05 12:40:20 +03:30
kaveh-ahangar 9e63b0e2b3 feat: add Makefile and improve building 2023-05-04 19:20:52 +03:30
MHSanaei 262e3c0985 Add database migration
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-04-24 14:13:25 +03:30
MHSanaei b0f974a94d secret token thanks to @HarlyquinForest 2023-04-21 19:00:14 +03:30
MHSanaei bbce1eb3f7 fix enabletgbot cli
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-04-20 15:49:48 +03:30
MHSanaei 204f73a692 main.go enhancements
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
2023-04-20 15:49:24 +03:30
MHSanaei 4fb060d25e fix typo 2 2023-04-14 17:22:49 +03:30
Hamidreza Ghavami 7f2ef94c7f update v2-ui.db path 2023-04-14 00:09:14 +04:30
MHSanaei 96786c9418 alireza 2023-03-17 19:37:49 +03:30
MHSanaei b73e4173a3 3x-ui 2023-02-09 22:48:06 +03:30