mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-10-28 10:52:51 +00:00
Compare commits
No commits in common. "20eb35414aeae078a4a4ee37b9a1019aab32a796" and "dbace1996e57ecd5171f9d72d6fe721eaa9383d9" have entirely different histories.
20eb35414a
...
dbace1996e
9 changed files with 12 additions and 17 deletions
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
لتثبيت المشروع أو تحديثه، نفذ الأمر ده:
|
لتثبيت المشروع أو تحديثه، نفذ الأمر ده:
|
||||||
```bash
|
```bash
|
||||||
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/refs/tags/v2.5.8/install.sh)
|
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
|
||||||
```
|
```
|
||||||
|
|
||||||
## تثبيت النسخة القديمة (مش موصى بيها)
|
## تثبيت النسخة القديمة (مش موصى بيها)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
## Instalar y Actualizar
|
## Instalar y Actualizar
|
||||||
|
|
||||||
```
|
```
|
||||||
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/refs/tags/v2.5.8/install.sh)
|
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Instalar versión antigua (no recomendamos)
|
## Instalar versión antigua (no recomendamos)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
## نصب و ارتقا
|
## نصب و ارتقا
|
||||||
|
|
||||||
```
|
```
|
||||||
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/refs/tags/v2.5.8/install.sh)
|
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
|
||||||
```
|
```
|
||||||
|
|
||||||
## نصب نسخههای قدیمی (توصیه نمیشود)
|
## نصب نسخههای قدیمی (توصیه نمیشود)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
## Install & Upgrade
|
## Install & Upgrade
|
||||||
|
|
||||||
```
|
```
|
||||||
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/refs/tags/v2.5.8/install.sh)
|
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install legacy Version (we don't recommend)
|
## Install legacy Version (we don't recommend)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
## Установка и обновление
|
## Установка и обновление
|
||||||
|
|
||||||
```
|
```
|
||||||
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/refs/tags/v2.5.8/install.sh)
|
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Установить старую версию (мы не рекомендуем)
|
## Установить старую версию (мы не рекомендуем)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
## 安装 & 升级
|
## 安装 & 升级
|
||||||
|
|
||||||
```
|
```
|
||||||
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/refs/tags/v2.5.8/install.sh)
|
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
|
||||||
```
|
```
|
||||||
|
|
||||||
## 安装旧版本 (我们不建议)
|
## 安装旧版本 (我们不建议)
|
||||||
|
|
|
||||||
|
|
@ -82,13 +82,14 @@ gen_random_string() {
|
||||||
}
|
}
|
||||||
|
|
||||||
config_after_install() {
|
config_after_install() {
|
||||||
local existing_hasDefaultCredential=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'hasDefaultCredential: .+' | awk '{print $2}')
|
local existing_username=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'username: .+' | awk '{print $2}')
|
||||||
|
local existing_password=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'password: .+' | awk '{print $2}')
|
||||||
local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: .+' | awk '{print $2}')
|
local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: .+' | awk '{print $2}')
|
||||||
local existing_port=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'port: .+' | awk '{print $2}')
|
local existing_port=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'port: .+' | awk '{print $2}')
|
||||||
local server_ip=$(curl -s https://api.ipify.org)
|
local server_ip=$(curl -s https://api.ipify.org)
|
||||||
|
|
||||||
if [[ ${#existing_webBasePath} -lt 4 ]]; then
|
if [[ ${#existing_webBasePath} -lt 4 ]]; then
|
||||||
if [[ "$existing_hasDefaultCredential" == "true" ]]; then
|
if [[ "$existing_username" == "admin" && "$existing_password" == "admin" ]]; then
|
||||||
local config_webBasePath=$(gen_random_string 15)
|
local config_webBasePath=$(gen_random_string 15)
|
||||||
local config_username=$(gen_random_string 10)
|
local config_username=$(gen_random_string 10)
|
||||||
local config_password=$(gen_random_string 10)
|
local config_password=$(gen_random_string 10)
|
||||||
|
|
@ -111,6 +112,7 @@ config_after_install() {
|
||||||
echo -e "${green}WebBasePath: ${config_webBasePath}${plain}"
|
echo -e "${green}WebBasePath: ${config_webBasePath}${plain}"
|
||||||
echo -e "${green}Access URL: http://${server_ip}:${config_port}/${config_webBasePath}${plain}"
|
echo -e "${green}Access URL: http://${server_ip}:${config_port}/${config_webBasePath}${plain}"
|
||||||
echo -e "###############################################"
|
echo -e "###############################################"
|
||||||
|
echo -e "${yellow}If you forgot your login info, you can type 'x-ui settings' to check${plain}"
|
||||||
else
|
else
|
||||||
local config_webBasePath=$(gen_random_string 15)
|
local config_webBasePath=$(gen_random_string 15)
|
||||||
echo -e "${yellow}WebBasePath is missing or too short. Generating a new one...${plain}"
|
echo -e "${yellow}WebBasePath is missing or too short. Generating a new one...${plain}"
|
||||||
|
|
@ -119,7 +121,7 @@ config_after_install() {
|
||||||
echo -e "${green}Access URL: http://${server_ip}:${existing_port}/${config_webBasePath}${plain}"
|
echo -e "${green}Access URL: http://${server_ip}:${existing_port}/${config_webBasePath}${plain}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ "$existing_hasDefaultCredential" == "true" ]]; then
|
if [[ "$existing_username" == "admin" && "$existing_password" == "admin" ]]; then
|
||||||
local config_username=$(gen_random_string 10)
|
local config_username=$(gen_random_string 10)
|
||||||
local config_password=$(gen_random_string 10)
|
local config_password=$(gen_random_string 10)
|
||||||
|
|
||||||
|
|
@ -130,6 +132,7 @@ config_after_install() {
|
||||||
echo -e "${green}Username: ${config_username}${plain}"
|
echo -e "${green}Username: ${config_username}${plain}"
|
||||||
echo -e "${green}Password: ${config_password}${plain}"
|
echo -e "${green}Password: ${config_password}${plain}"
|
||||||
echo -e "###############################################"
|
echo -e "###############################################"
|
||||||
|
echo -e "${yellow}If you forgot your login info, you can type 'x-ui settings' to check${plain}"
|
||||||
else
|
else
|
||||||
echo -e "${green}Username, Password, and WebBasePath are properly set. Exiting...${plain}"
|
echo -e "${green}Username, Password, and WebBasePath are properly set. Exiting...${plain}"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
7
main.go
7
main.go
|
|
@ -16,7 +16,6 @@ import (
|
||||||
"x-ui/web"
|
"x-ui/web"
|
||||||
"x-ui/web/global"
|
"x-ui/web/global"
|
||||||
"x-ui/web/service"
|
"x-ui/web/service"
|
||||||
"x-ui/util/crypto"
|
|
||||||
|
|
||||||
"github.com/op/go-logging"
|
"github.com/op/go-logging"
|
||||||
)
|
)
|
||||||
|
|
@ -162,12 +161,6 @@ func showSetting(show bool) {
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("Panel is secure with SSL")
|
fmt.Println("Panel is secure with SSL")
|
||||||
}
|
}
|
||||||
|
|
||||||
hasDefaultCredential := func() bool {
|
|
||||||
return userModel.Username == "admin" && crypto.CheckPasswordHash(userModel.Password, "admin")
|
|
||||||
}()
|
|
||||||
|
|
||||||
fmt.Println("hasDefaultCredential:", hasDefaultCredential)
|
|
||||||
fmt.Println("port:", port)
|
fmt.Println("port:", port)
|
||||||
fmt.Println("webBasePath:", webBasePath)
|
fmt.Println("webBasePath:", webBasePath)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,6 @@
|
||||||
{ label: 'Malware 🇮🇷', value: 'ext:geosite_IR.dat:malware' },
|
{ label: 'Malware 🇮🇷', value: 'ext:geosite_IR.dat:malware' },
|
||||||
{ label: 'Phishing 🇮🇷', value: 'ext:geosite_IR.dat:phishing' },
|
{ label: 'Phishing 🇮🇷', value: 'ext:geosite_IR.dat:phishing' },
|
||||||
{ label: 'Cryptominers 🇮🇷', value: 'ext:geosite_IR.dat:cryptominers' },
|
{ label: 'Cryptominers 🇮🇷', value: 'ext:geosite_IR.dat:cryptominers' },
|
||||||
{ label: 'Adult +18', value: 'geosite:category-porn' },
|
|
||||||
{ label: '🇮🇷 Iran', value: 'ext:geosite_IR.dat:ir' },
|
{ label: '🇮🇷 Iran', value: 'ext:geosite_IR.dat:ir' },
|
||||||
{ label: '🇮🇷 .ir', value: 'regexp:.*\\.ir$' },
|
{ label: '🇮🇷 .ir', value: 'regexp:.*\\.ir$' },
|
||||||
{ label: '🇮🇷 .ایران', value: 'regexp:.*\\.xn--mgba3a4f16a$' },
|
{ label: '🇮🇷 .ایران', value: 'regexp:.*\\.xn--mgba3a4f16a$' },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue