github.com/mhsanaei/ to github.com/kolxz2/

This commit is contained in:
kolxz2Aorus 2026-04-09 10:46:57 +03:00
parent 0502796dab
commit d2468b2cd7
54 changed files with 186 additions and 186 deletions

View file

@ -25,7 +25,7 @@ jobs:
with: with:
images: | images: |
hsanaeii/3x-ui hsanaeii/3x-ui
ghcr.io/mhsanaei/3x-ui ghcr.io/kolxz2/3x-ui
tags: | tags: |
type=ref,event=branch type=ref,event=branch
type=ref,event=tag type=ref,event=tag

View file

@ -12,10 +12,10 @@ import (
"path" "path"
"slices" "slices"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/util/crypto" "github.com/kolxz2/3x-ui/v2/util/crypto"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
"gorm.io/driver/sqlite" "gorm.io/driver/sqlite"
"gorm.io/gorm" "gorm.io/gorm"

View file

@ -4,8 +4,8 @@ package model
import ( import (
"fmt" "fmt"
"github.com/mhsanaei/3x-ui/v2/util/json_util" "github.com/kolxz2/3x-ui/v2/util/json_util"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
) )
// Protocol represents the protocol type for Xray inbounds. // Protocol represents the protocol type for Xray inbounds.

2
go.mod
View file

@ -1,4 +1,4 @@
module github.com/mhsanaei/3x-ui/v2 module github.com/kolxz2/3x-ui/v2
go 1.26.1 go 1.26.1

View file

@ -766,17 +766,17 @@ install_x-ui() {
# Download resources # Download resources
if [ $# == 0 ]; then if [ $# == 0 ]; then
tag_version=$(curl -Ls "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') tag_version=$(curl -Ls "https://api.github.com/repos/kolxz2/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [[ ! -n "$tag_version" ]]; then if [[ ! -n "$tag_version" ]]; then
echo -e "${yellow}Trying to fetch version with IPv4...${plain}" echo -e "${yellow}Trying to fetch version with IPv4...${plain}"
tag_version=$(curl -4 -Ls "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') tag_version=$(curl -4 -Ls "https://api.github.com/repos/kolxz2/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [[ ! -n "$tag_version" ]]; then if [[ ! -n "$tag_version" ]]; then
echo -e "${red}Failed to fetch x-ui version, it may be due to GitHub API restrictions, please try it later${plain}" echo -e "${red}Failed to fetch x-ui version, it may be due to GitHub API restrictions, please try it later${plain}"
exit 1 exit 1
fi fi
fi fi
echo -e "Got x-ui latest version: ${tag_version}, beginning the installation..." echo -e "Got x-ui latest version: ${tag_version}, beginning the installation..."
curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/MHSanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/kolxz2/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo -e "${red}Downloading x-ui failed, please be sure that your server can access GitHub ${plain}" echo -e "${red}Downloading x-ui failed, please be sure that your server can access GitHub ${plain}"
exit 1 exit 1
@ -791,7 +791,7 @@ install_x-ui() {
exit 1 exit 1
fi fi
url="https://github.com/MHSanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz" url="https://github.com/kolxz2/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz"
echo -e "Beginning to install x-ui $1" echo -e "Beginning to install x-ui $1"
curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz ${url} curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz ${url}
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
@ -799,7 +799,7 @@ install_x-ui() {
exit 1 exit 1
fi fi
fi fi
curl -4fLRo /usr/bin/x-ui-temp https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.sh curl -4fLRo /usr/bin/x-ui-temp https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.sh
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo -e "${red}Failed to download x-ui.sh${plain}" echo -e "${red}Failed to download x-ui.sh${plain}"
exit 1 exit 1
@ -851,7 +851,7 @@ install_x-ui() {
fi fi
if [[ $release == "alpine" ]]; then if [[ $release == "alpine" ]]; then
curl -4fLRo /etc/init.d/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.rc curl -4fLRo /etc/init.d/x-ui https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.rc
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo -e "${red}Failed to download x-ui.rc${plain}" echo -e "${red}Failed to download x-ui.rc${plain}"
exit 1 exit 1
@ -908,13 +908,13 @@ install_x-ui() {
echo -e "${yellow}Service files not found in tar.gz, downloading from GitHub...${plain}" echo -e "${yellow}Service files not found in tar.gz, downloading from GitHub...${plain}"
case "${release}" in case "${release}" in
ubuntu | debian | armbian) ubuntu | debian | armbian)
curl -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.service.debian >/dev/null 2>&1 curl -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.service.debian >/dev/null 2>&1
;; ;;
arch | manjaro | parch) arch | manjaro | parch)
curl -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.service.arch >/dev/null 2>&1 curl -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.service.arch >/dev/null 2>&1
;; ;;
*) *)
curl -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.service.rhel >/dev/null 2>&1 curl -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.service.rhel >/dev/null 2>&1
;; ;;
esac esac

View file

@ -9,7 +9,7 @@ import (
"runtime" "runtime"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/op/go-logging" "github.com/op/go-logging"
) )

18
main.go
View file

@ -11,15 +11,15 @@ import (
"syscall" "syscall"
_ "unsafe" _ "unsafe"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/mhsanaei/3x-ui/v2/database" "github.com/kolxz2/3x-ui/v2/database"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/sub" "github.com/kolxz2/3x-ui/v2/sub"
"github.com/mhsanaei/3x-ui/v2/util/crypto" "github.com/kolxz2/3x-ui/v2/util/crypto"
"github.com/mhsanaei/3x-ui/v2/util/sys" "github.com/kolxz2/3x-ui/v2/util/sys"
"github.com/mhsanaei/3x-ui/v2/web" "github.com/kolxz2/3x-ui/v2/web"
"github.com/mhsanaei/3x-ui/v2/web/global" "github.com/kolxz2/3x-ui/v2/web/global"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/joho/godotenv" "github.com/joho/godotenv"
"github.com/op/go-logging" "github.com/op/go-logging"

View file

@ -15,13 +15,13 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
webpkg "github.com/mhsanaei/3x-ui/v2/web" webpkg "github.com/kolxz2/3x-ui/v2/web"
"github.com/mhsanaei/3x-ui/v2/web/locale" "github.com/kolxz2/3x-ui/v2/web/locale"
"github.com/mhsanaei/3x-ui/v2/web/middleware" "github.com/kolxz2/3x-ui/v2/web/middleware"
"github.com/mhsanaei/3x-ui/v2/web/network" "github.com/kolxz2/3x-ui/v2/web/network"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View file

@ -6,7 +6,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View file

@ -7,12 +7,12 @@ import (
"maps" "maps"
"strings" "strings"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/json_util" "github.com/kolxz2/3x-ui/v2/util/json_util"
"github.com/mhsanaei/3x-ui/v2/util/random" "github.com/kolxz2/3x-ui/v2/util/random"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
) )
//go:embed default.json //go:embed default.json

View file

@ -11,13 +11,13 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/goccy/go-json" "github.com/goccy/go-json"
"github.com/mhsanaei/3x-ui/v2/database" "github.com/kolxz2/3x-ui/v2/database"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/util/random" "github.com/kolxz2/3x-ui/v2/util/random"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
) )
// SubService provides business logic for generating subscription links and managing subscription data. // SubService provides business logic for generating subscription links and managing subscription data.

View file

@ -757,19 +757,19 @@ update_x-ui() {
echo -e "${green}Downloading new x-ui version...${plain}" echo -e "${green}Downloading new x-ui version...${plain}"
tag_version=$(${curl_bin} -Ls "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest" 2>/dev/null | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') tag_version=$(${curl_bin} -Ls "https://api.github.com/repos/kolxz2/3x-ui/releases/latest" 2>/dev/null | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [[ ! -n "$tag_version" ]]; then if [[ ! -n "$tag_version" ]]; then
echo -e "${yellow}Trying to fetch version with IPv4...${plain}" echo -e "${yellow}Trying to fetch version with IPv4...${plain}"
tag_version=$(${curl_bin} -4 -Ls "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') tag_version=$(${curl_bin} -4 -Ls "https://api.github.com/repos/kolxz2/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [[ ! -n "$tag_version" ]]; then if [[ ! -n "$tag_version" ]]; then
_fail "ERROR: Failed to fetch x-ui version, it may be due to GitHub API restrictions, please try it later" _fail "ERROR: Failed to fetch x-ui version, it may be due to GitHub API restrictions, please try it later"
fi fi
fi fi
echo -e "Got x-ui latest version: ${tag_version}, beginning the installation..." echo -e "Got x-ui latest version: ${tag_version}, beginning the installation..."
${curl_bin} -fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/MHSanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz 2>/dev/null ${curl_bin} -fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/kolxz2/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz 2>/dev/null
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo -e "${yellow}Trying to fetch version with IPv4...${plain}" echo -e "${yellow}Trying to fetch version with IPv4...${plain}"
${curl_bin} -4fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/MHSanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz 2>/dev/null ${curl_bin} -4fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/kolxz2/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz 2>/dev/null
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_fail "ERROR: Failed to download x-ui, please be sure that your server can access GitHub" _fail "ERROR: Failed to download x-ui, please be sure that your server can access GitHub"
fi fi
@ -832,10 +832,10 @@ update_x-ui() {
chmod +x x-ui bin/xray-linux-$(arch) >/dev/null 2>&1 chmod +x x-ui bin/xray-linux-$(arch) >/dev/null 2>&1
echo -e "${green}Downloading and installing x-ui.sh script...${plain}" echo -e "${green}Downloading and installing x-ui.sh script...${plain}"
${curl_bin} -fLRo /usr/bin/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.sh >/dev/null 2>&1 ${curl_bin} -fLRo /usr/bin/x-ui https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.sh >/dev/null 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo -e "${yellow}Trying to fetch x-ui with IPv4...${plain}" echo -e "${yellow}Trying to fetch x-ui with IPv4...${plain}"
${curl_bin} -4fLRo /usr/bin/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.sh >/dev/null 2>&1 ${curl_bin} -4fLRo /usr/bin/x-ui https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.sh >/dev/null 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_fail "ERROR: Failed to download x-ui.sh script, please be sure that your server can access GitHub" _fail "ERROR: Failed to download x-ui.sh script, please be sure that your server can access GitHub"
fi fi
@ -855,9 +855,9 @@ update_x-ui() {
if [[ $release == "alpine" ]]; then if [[ $release == "alpine" ]]; then
echo -e "${green}Downloading and installing startup unit x-ui.rc...${plain}" echo -e "${green}Downloading and installing startup unit x-ui.rc...${plain}"
${curl_bin} -fLRo /etc/init.d/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.rc >/dev/null 2>&1 ${curl_bin} -fLRo /etc/init.d/x-ui https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.rc >/dev/null 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
${curl_bin} -4fLRo /etc/init.d/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.rc >/dev/null 2>&1 ${curl_bin} -4fLRo /etc/init.d/x-ui https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.rc >/dev/null 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_fail "ERROR: Failed to download startup unit x-ui.rc, please be sure that your server can access GitHub" _fail "ERROR: Failed to download startup unit x-ui.rc, please be sure that your server can access GitHub"
fi fi
@ -911,13 +911,13 @@ update_x-ui() {
echo -e "${yellow}Service files not found in tar.gz, downloading from GitHub...${plain}" echo -e "${yellow}Service files not found in tar.gz, downloading from GitHub...${plain}"
case "${release}" in case "${release}" in
ubuntu | debian | armbian) ubuntu | debian | armbian)
${curl_bin} -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.service.debian >/dev/null 2>&1 ${curl_bin} -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.service.debian >/dev/null 2>&1
;; ;;
arch | manjaro | parch) arch | manjaro | parch)
${curl_bin} -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.service.arch >/dev/null 2>&1 ${curl_bin} -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.service.arch >/dev/null 2>&1
;; ;;
*) *)
${curl_bin} -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.service.rhel >/dev/null 2>&1 ${curl_bin} -4fLRo ${xui_service}/x-ui.service https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.service.rhel >/dev/null 2>&1
;; ;;
esac esac

View file

@ -5,7 +5,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
) )
// NewErrorf creates a new error with formatted message. // NewErrorf creates a new error with formatted message.

View file

@ -3,8 +3,8 @@ package controller
import ( import (
"net/http" "net/http"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/mhsanaei/3x-ui/v2/web/session" "github.com/kolxz2/3x-ui/v2/web/session"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View file

@ -5,9 +5,9 @@ package controller
import ( import (
"net/http" "net/http"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/web/locale" "github.com/kolxz2/3x-ui/v2/web/locale"
"github.com/mhsanaei/3x-ui/v2/web/session" "github.com/kolxz2/3x-ui/v2/web/session"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View file

@ -6,10 +6,10 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/mhsanaei/3x-ui/v2/web/session" "github.com/kolxz2/3x-ui/v2/web/session"
"github.com/mhsanaei/3x-ui/v2/web/websocket" "github.com/kolxz2/3x-ui/v2/web/websocket"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View file

@ -6,9 +6,9 @@ import (
"text/template" "text/template"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/mhsanaei/3x-ui/v2/web/session" "github.com/kolxz2/3x-ui/v2/web/session"
"github.com/gin-contrib/sessions" "github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"

View file

@ -7,9 +7,9 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/web/global" "github.com/kolxz2/3x-ui/v2/web/global"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/mhsanaei/3x-ui/v2/web/websocket" "github.com/kolxz2/3x-ui/v2/web/websocket"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View file

@ -4,10 +4,10 @@ import (
"errors" "errors"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/util/crypto" "github.com/kolxz2/3x-ui/v2/util/crypto"
"github.com/mhsanaei/3x-ui/v2/web/entity" "github.com/kolxz2/3x-ui/v2/web/entity"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/mhsanaei/3x-ui/v2/web/session" "github.com/kolxz2/3x-ui/v2/web/session"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View file

@ -5,9 +5,9 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/web/entity" "github.com/kolxz2/3x-ui/v2/web/entity"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View file

@ -6,10 +6,10 @@ import (
"time" "time"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/web/session" "github.com/kolxz2/3x-ui/v2/web/session"
"github.com/mhsanaei/3x-ui/v2/web/websocket" "github.com/kolxz2/3x-ui/v2/web/websocket"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
ws "github.com/gorilla/websocket" ws "github.com/gorilla/websocket"

View file

@ -3,8 +3,8 @@ package controller
import ( import (
"encoding/json" "encoding/json"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View file

@ -8,7 +8,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
) )
// Msg represents a standard API response message with success status, message text, and optional data object. // Msg represents a standard API response message with success status, message text, and optional data object.

View file

@ -157,7 +157,7 @@
</a-col> </a-col>
<a-col :sm="24" :lg="12"> <a-col :sm="24" :lg="12">
<a-card title='3X-UI' hoverable> <a-card title='3X-UI' hoverable>
<a rel="noopener" href="https://github.com/MHSanaei/3x-ui/releases" target="_blank"> <a rel="noopener" href="https://github.com/kolxz2/3x-ui/releases" target="_blank">
<a-tag color="green"> <a-tag color="green">
<span>v{{ .cur_ver }}</span> <span>v{{ .cur_ver }}</span>
</a-tag> </a-tag>
@ -167,7 +167,7 @@
<span>@XrayUI</span> <span>@XrayUI</span>
</a-tag> </a-tag>
</a> </a>
<a rel="noopener" href="https://github.com/MHSanaei/3x-ui/wiki" target="_blank"> <a rel="noopener" href="https://github.com/kolxz2/3x-ui/wiki" target="_blank">
<a-tag color="purple"> <a-tag color="purple">
<span>{{ i18n "pages.index.documentation" }}</span> <span>{{ i18n "pages.index.documentation" }}</span>
</a-tag> </a-tag>

View file

@ -12,10 +12,10 @@ import (
"sort" "sort"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/database" "github.com/kolxz2/3x-ui/v2/database"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
) )
// IPWithTimestamp tracks an IP address with its last seen timestamp // IPWithTimestamp tracks an IP address with its last seen timestamp

View file

@ -4,7 +4,7 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/shirou/gopsutil/v4/cpu" "github.com/shirou/gopsutil/v4/cpu"
) )

View file

@ -1,7 +1,7 @@
package job package job
import ( import (
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
) )
// CheckHashStorageJob periodically cleans up expired hash entries from the Telegram bot's hash storage. // CheckHashStorageJob periodically cleans up expired hash entries from the Telegram bot's hash storage.

View file

@ -3,8 +3,8 @@
package job package job
import ( import (
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
) )
// CheckXrayRunningJob monitors Xray process health and restarts it if it crashes. // CheckXrayRunningJob monitors Xray process health and restarts it if it crashes.

View file

@ -5,8 +5,8 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
) )
// ClearLogsJob clears old log files to prevent disk space issues. // ClearLogsJob clears old log files to prevent disk space issues.

View file

@ -5,10 +5,10 @@ import (
"strings" "strings"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
ldaputil "github.com/mhsanaei/3x-ui/v2/util/ldap" ldaputil "github.com/kolxz2/3x-ui/v2/util/ldap"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"strconv" "strconv"

View file

@ -1,8 +1,8 @@
package job package job
import ( import (
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
) )
// Period represents the time period for traffic resets. // Period represents the time period for traffic resets.

View file

@ -1,7 +1,7 @@
package job package job
import ( import (
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
) )
// LoginStatus represents the status of a login attempt. // LoginStatus represents the status of a login attempt.

View file

@ -3,10 +3,10 @@ package job
import ( import (
"encoding/json" "encoding/json"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/mhsanaei/3x-ui/v2/web/websocket" "github.com/kolxz2/3x-ui/v2/web/websocket"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View file

@ -8,7 +8,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/nicksnyder/go-i18n/v2/i18n" "github.com/nicksnyder/go-i18n/v2/i18n"

View file

@ -10,11 +10,11 @@ import (
"strings" "strings"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/database" "github.com/kolxz2/3x-ui/v2/database"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
"gorm.io/gorm" "gorm.io/gorm"
) )

View file

@ -11,13 +11,13 @@ import (
"sync" "sync"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/mhsanaei/3x-ui/v2/database" "github.com/kolxz2/3x-ui/v2/database"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/util/json_util" "github.com/kolxz2/3x-ui/v2/util/json_util"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
"gorm.io/gorm" "gorm.io/gorm"
) )

View file

@ -5,7 +5,7 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
) )
// PanelService provides business logic for panel management operations. // PanelService provides business logic for panel management operations.

View file

@ -20,12 +20,12 @@ import (
"sync" "sync"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/mhsanaei/3x-ui/v2/database" "github.com/kolxz2/3x-ui/v2/database"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/util/sys" "github.com/kolxz2/3x-ui/v2/util/sys"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/shirou/gopsutil/v4/cpu" "github.com/shirou/gopsutil/v4/cpu"

View file

@ -11,14 +11,14 @@ import (
"strings" "strings"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/database" "github.com/kolxz2/3x-ui/v2/database"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/util/random" "github.com/kolxz2/3x-ui/v2/util/random"
"github.com/mhsanaei/3x-ui/v2/util/reflect_util" "github.com/kolxz2/3x-ui/v2/util/reflect_util"
"github.com/mhsanaei/3x-ui/v2/web/entity" "github.com/kolxz2/3x-ui/v2/web/entity"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
) )
//go:embed config.json //go:embed config.json

View file

@ -22,14 +22,14 @@ import (
"sync" "sync"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/mhsanaei/3x-ui/v2/database" "github.com/kolxz2/3x-ui/v2/database"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/web/global" "github.com/kolxz2/3x-ui/v2/web/global"
"github.com/mhsanaei/3x-ui/v2/web/locale" "github.com/kolxz2/3x-ui/v2/web/locale"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/mymmrac/telego" "github.com/mymmrac/telego"

View file

@ -3,11 +3,11 @@ package service
import ( import (
"errors" "errors"
"github.com/mhsanaei/3x-ui/v2/database" "github.com/kolxz2/3x-ui/v2/database"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/crypto" "github.com/kolxz2/3x-ui/v2/util/crypto"
ldaputil "github.com/mhsanaei/3x-ui/v2/util/ldap" ldaputil "github.com/kolxz2/3x-ui/v2/util/ldap"
"github.com/xlzd/gotp" "github.com/xlzd/gotp"
"gorm.io/gorm" "gorm.io/gorm"
) )

View file

@ -8,8 +8,8 @@ import (
"os" "os"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
) )
// WarpService provides business logic for Cloudflare WARP integration. // WarpService provides business logic for Cloudflare WARP integration.

View file

@ -6,8 +6,8 @@ import (
"runtime" "runtime"
"sync" "sync"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
"go.uber.org/atomic" "go.uber.org/atomic"
) )

View file

@ -4,8 +4,8 @@ import (
_ "embed" _ "embed"
"encoding/json" "encoding/json"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/xray" "github.com/kolxz2/3x-ui/v2/xray"
) )
// XraySettingService provides business logic for Xray configuration management. // XraySettingService provides business logic for Xray configuration management.

View file

@ -6,7 +6,7 @@ import (
"encoding/gob" "encoding/gob"
"net/http" "net/http"
"github.com/mhsanaei/3x-ui/v2/database/model" "github.com/kolxz2/3x-ui/v2/database/model"
"github.com/gin-contrib/sessions" "github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"

View file

@ -16,16 +16,16 @@ import (
"strings" "strings"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/mhsanaei/3x-ui/v2/web/controller" "github.com/kolxz2/3x-ui/v2/web/controller"
"github.com/mhsanaei/3x-ui/v2/web/job" "github.com/kolxz2/3x-ui/v2/web/job"
"github.com/mhsanaei/3x-ui/v2/web/locale" "github.com/kolxz2/3x-ui/v2/web/locale"
"github.com/mhsanaei/3x-ui/v2/web/middleware" "github.com/kolxz2/3x-ui/v2/web/middleware"
"github.com/mhsanaei/3x-ui/v2/web/network" "github.com/kolxz2/3x-ui/v2/web/network"
"github.com/mhsanaei/3x-ui/v2/web/service" "github.com/kolxz2/3x-ui/v2/web/service"
"github.com/mhsanaei/3x-ui/v2/web/websocket" "github.com/kolxz2/3x-ui/v2/web/websocket"
"github.com/gin-contrib/gzip" "github.com/gin-contrib/gzip"
"github.com/gin-contrib/sessions" "github.com/gin-contrib/sessions"

View file

@ -8,7 +8,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
) )
// MessageType represents the type of WebSocket message // MessageType represents the type of WebSocket message

View file

@ -2,8 +2,8 @@
package websocket package websocket
import ( import (
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/web/global" "github.com/kolxz2/3x-ui/v2/web/global"
) )
// GetHub returns the global WebSocket hub instance // GetHub returns the global WebSocket hub instance

10
x-ui.sh
View file

@ -108,7 +108,7 @@ before_show_menu() {
} }
install() { install() {
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/main/install.sh) bash <(curl -Ls https://raw.githubusercontent.com/kolxz2/3x-ui/main/install.sh)
if [[ $? == 0 ]]; then if [[ $? == 0 ]]; then
if [[ $# == 0 ]]; then if [[ $# == 0 ]]; then
start start
@ -127,7 +127,7 @@ update() {
fi fi
return 0 return 0
fi fi
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/main/update.sh) bash <(curl -Ls https://raw.githubusercontent.com/kolxz2/3x-ui/main/update.sh)
if [[ $? == 0 ]]; then if [[ $? == 0 ]]; then
LOGI "Update is complete, Panel has automatically restarted " LOGI "Update is complete, Panel has automatically restarted "
before_show_menu before_show_menu
@ -145,7 +145,7 @@ update_menu() {
return 0 return 0
fi fi
curl -fLRo /usr/bin/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.sh curl -fLRo /usr/bin/x-ui https://raw.githubusercontent.com/kolxz2/3x-ui/main/x-ui.sh
chmod +x ${xui_folder}/x-ui.sh chmod +x ${xui_folder}/x-ui.sh
chmod +x /usr/bin/x-ui chmod +x /usr/bin/x-ui
@ -167,7 +167,7 @@ legacy_version() {
exit 1 exit 1
fi fi
# Use the entered panel version in the download link # Use the entered panel version in the download link
install_command="bash <(curl -Ls "https://raw.githubusercontent.com/mhsanaei/3x-ui/v$tag_version/install.sh") v$tag_version" install_command="bash <(curl -Ls "https://raw.githubusercontent.com/kolxz2/3x-ui/v$tag_version/install.sh") v$tag_version"
echo "Downloading and installing panel version $tag_version..." echo "Downloading and installing panel version $tag_version..."
eval $install_command eval $install_command
@ -206,7 +206,7 @@ uninstall() {
echo "" echo ""
echo -e "Uninstalled Successfully.\n" echo -e "Uninstalled Successfully.\n"
echo "If you need to install this panel again, you can use below command:" echo "If you need to install this panel again, you can use below command:"
echo -e "${green}bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)${plain}" echo -e "${green}bash <(curl -Ls https://raw.githubusercontent.com/kolxz2/3x-ui/master/install.sh)${plain}"
echo "" echo ""
# Trap the SIGTERM signal # Trap the SIGTERM signal
trap delete_script SIGTERM trap delete_script SIGTERM

View file

@ -11,8 +11,8 @@ import (
"regexp" "regexp"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
"github.com/xtls/xray-core/app/proxyman/command" "github.com/xtls/xray-core/app/proxyman/command"
statsService "github.com/xtls/xray-core/app/stats/command" statsService "github.com/xtls/xray-core/app/stats/command"

View file

@ -3,7 +3,7 @@ package xray
import ( import (
"bytes" "bytes"
"github.com/mhsanaei/3x-ui/v2/util/json_util" "github.com/kolxz2/3x-ui/v2/util/json_util"
) )
// Config represents the complete Xray configuration structure. // Config represents the complete Xray configuration structure.

View file

@ -3,7 +3,7 @@ package xray
import ( import (
"bytes" "bytes"
"github.com/mhsanaei/3x-ui/v2/util/json_util" "github.com/kolxz2/3x-ui/v2/util/json_util"
) )
// InboundConfig represents an Xray inbound configuration. // InboundConfig represents an Xray inbound configuration.

View file

@ -5,7 +5,7 @@ import (
"runtime" "runtime"
"strings" "strings"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
) )
// NewLogWriter returns a new LogWriter for processing Xray log output. // NewLogWriter returns a new LogWriter for processing Xray log output.

View file

@ -13,9 +13,9 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/mhsanaei/3x-ui/v2/config" "github.com/kolxz2/3x-ui/v2/config"
"github.com/mhsanaei/3x-ui/v2/logger" "github.com/kolxz2/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/util/common" "github.com/kolxz2/3x-ui/v2/util/common"
) )
// GetBinaryName returns the Xray binary filename for the current OS and architecture. // GetBinaryName returns the Xray binary filename for the current OS and architecture.