mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-05-02 21:28:49 +00:00
bug fixed - random user pass
This commit is contained in:
parent
b5dd258074
commit
a289ef5d10
4 changed files with 54 additions and 58 deletions
10
install.sh
10
install.sh
|
@ -25,9 +25,9 @@ echo "The OS release is: $release"
|
||||||
|
|
||||||
arch3xui() {
|
arch3xui() {
|
||||||
case "$(uname -m)" in
|
case "$(uname -m)" in
|
||||||
x86_64 | x64 | amd64 ) echo 'amd64' ;;
|
x86_64 | x64 | amd64) echo 'amd64' ;;
|
||||||
armv8 | arm64 | aarch64 ) echo 'arm64' ;;
|
armv8 | arm64 | aarch64) echo 'arm64' ;;
|
||||||
* ) echo -e "${green}Unsupported CPU architecture! ${plain}" && rm -f install.sh && exit 1 ;;
|
*) echo -e "${green}Unsupported CPU architecture! ${plain}" && rm -f install.sh && exit 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
echo "arch: $(arch3xui)"
|
echo "arch: $(arch3xui)"
|
||||||
|
@ -59,7 +59,7 @@ fi
|
||||||
|
|
||||||
install_base() {
|
install_base() {
|
||||||
case "${release}" in
|
case "${release}" in
|
||||||
centos|fedora)
|
centos | fedora)
|
||||||
yum install -y -q wget curl tar
|
yum install -y -q wget curl tar
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -70,7 +70,6 @@ install_base() {
|
||||||
|
|
||||||
#This function will be called when user installed x-ui out of sercurity
|
#This function will be called when user installed x-ui out of sercurity
|
||||||
config_after_install() {
|
config_after_install() {
|
||||||
/usr/local/x-ui/x-ui migrate
|
|
||||||
echo -e "${yellow}Install/update finished! For security it's recommended to modify panel settings ${plain}"
|
echo -e "${yellow}Install/update finished! For security it's recommended to modify panel settings ${plain}"
|
||||||
read -p "Do you want to continue with the modification [y/n]? ": config_confirm
|
read -p "Do you want to continue with the modification [y/n]? ": config_confirm
|
||||||
if [[ "${config_confirm}" == "y" || "${config_confirm}" == "Y" ]]; then
|
if [[ "${config_confirm}" == "y" || "${config_confirm}" == "Y" ]]; then
|
||||||
|
@ -101,6 +100,7 @@ config_after_install() {
|
||||||
echo -e "${red} this is your upgrade,will keep old settings,if you forgot your login info,you can type x-ui and then type 7 to check${plain}"
|
echo -e "${red} this is your upgrade,will keep old settings,if you forgot your login info,you can type x-ui and then type 7 to check${plain}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
/usr/local/x-ui/x-ui migrate
|
||||||
}
|
}
|
||||||
|
|
||||||
install_x-ui() {
|
install_x-ui() {
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<span>{{ i18n "pages.inbounds.emailDesc" }}</span>
|
<span>{{ i18n "pages.inbounds.emailDesc" }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<a-icon @click="client.email = RandomUtil.randomText()" type="sync"> </a-icon>
|
<a-icon @click="client.email = RandomUtil.randomText()" type="sync"> </a-icon>
|
||||||
|
|
|
@ -170,7 +170,7 @@
|
||||||
"xtlsDesc" = "Xray core needs to be 1.7.5"
|
"xtlsDesc" = "Xray core needs to be 1.7.5"
|
||||||
"realityDesc" = "Xray core needs to be 1.8.0 or higher."
|
"realityDesc" = "Xray core needs to be 1.8.0 or higher."
|
||||||
"telegramDesc" = "use Telegram ID without @ or chat IDs ( you can get it here @userinfobot )"
|
"telegramDesc" = "use Telegram ID without @ or chat IDs ( you can get it here @userinfobot )"
|
||||||
"subscriptionDesc" = "you can find your sub link on Details, also ou can use the same name for several configurations"
|
"subscriptionDesc" = "you can find your sub link on Details, also you can use the same name for several configurations"
|
||||||
|
|
||||||
[pages.client]
|
[pages.client]
|
||||||
"add" = "Add Client"
|
"add" = "Add Client"
|
||||||
|
|
25
x-ui.sh
25
x-ui.sh
|
@ -432,8 +432,7 @@ show_xray_status() {
|
||||||
}
|
}
|
||||||
|
|
||||||
open_ports() {
|
open_ports() {
|
||||||
if ! command -v ufw &> /dev/null
|
if ! command -v ufw &>/dev/null; then
|
||||||
then
|
|
||||||
echo "ufw firewall is not installed. Installing now..."
|
echo "ufw firewall is not installed. Installing now..."
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y ufw
|
sudo apt-get install -y ufw
|
||||||
|
@ -460,18 +459,19 @@ open_ports() {
|
||||||
|
|
||||||
# Check if the input is valid
|
# Check if the input is valid
|
||||||
if ! [[ $ports =~ ^([0-9]+|[0-9]+-[0-9]+)(,([0-9]+|[0-9]+-[0-9]+))*$ ]]; then
|
if ! [[ $ports =~ ^([0-9]+|[0-9]+-[0-9]+)(,([0-9]+|[0-9]+-[0-9]+))*$ ]]; then
|
||||||
echo "Error: Invalid input. Please enter a comma-separated list of ports or a range of ports (e.g. 80,443,2053 or 400-500)." >&2; exit 1
|
echo "Error: Invalid input. Please enter a comma-separated list of ports or a range of ports (e.g. 80,443,2053 or 400-500)." >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Open the specified ports using ufw
|
# Open the specified ports using ufw
|
||||||
IFS=',' read -ra PORT_LIST <<< "$ports"
|
IFS=',' read -ra PORT_LIST <<<"$ports"
|
||||||
for port in "${PORT_LIST[@]}"; do
|
for port in "${PORT_LIST[@]}"; do
|
||||||
if [[ $port == *-* ]]; then
|
if [[ $port == *-* ]]; then
|
||||||
# Split the range into start and end ports
|
# Split the range into start and end ports
|
||||||
start_port=$(echo $port | cut -d'-' -f1)
|
start_port=$(echo $port | cut -d'-' -f1)
|
||||||
end_port=$(echo $port | cut -d'-' -f2)
|
end_port=$(echo $port | cut -d'-' -f2)
|
||||||
# Loop through the range and open each port
|
# Loop through the range and open each port
|
||||||
for ((i=start_port; i<=end_port; i++)); do
|
for ((i = start_port; i <= end_port; i++)); do
|
||||||
sudo ufw allow $i
|
sudo ufw allow $i
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
@ -529,7 +529,7 @@ ssl_cert_issue() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#install socat second
|
#install socat second
|
||||||
if [[ "${release}" == "centos" ]] || [[ "${release}" == "fedora" ]] ; then
|
if [[ "${release}" == "centos" ]] || [[ "${release}" == "fedora" ]]; then
|
||||||
yum install socat -y
|
yum install socat -y
|
||||||
else
|
else
|
||||||
apt install socat -y
|
apt install socat -y
|
||||||
|
@ -610,7 +610,6 @@ ssl_cert_issue() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
warp_fixchatgpt() {
|
warp_fixchatgpt() {
|
||||||
curl -fsSL https://gist.githubusercontent.com/hamid-gh98/dc5dd9b0cc5b0412af927b1ccdb294c7/raw/install_warp_proxy.sh | bash
|
curl -fsSL https://gist.githubusercontent.com/hamid-gh98/dc5dd9b0cc5b0412af927b1ccdb294c7/raw/install_warp_proxy.sh | bash
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -619,21 +618,21 @@ warp_fixchatgpt() {
|
||||||
|
|
||||||
run_speedtest() {
|
run_speedtest() {
|
||||||
# Check if Speedtest is already installed
|
# Check if Speedtest is already installed
|
||||||
if ! command -v speedtest &> /dev/null; then
|
if ! command -v speedtest &>/dev/null; then
|
||||||
# If not installed, install it
|
# If not installed, install it
|
||||||
if command -v dnf &> /dev/null; then
|
if command -v dnf &>/dev/null; then
|
||||||
sudo dnf install -y curl
|
sudo dnf install -y curl
|
||||||
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash
|
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash
|
||||||
sudo dnf install -y speedtest
|
sudo dnf install -y speedtest
|
||||||
elif command -v yum &> /dev/null; then
|
elif command -v yum &>/dev/null; then
|
||||||
sudo yum install -y curl
|
sudo yum install -y curl
|
||||||
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash
|
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash
|
||||||
sudo yum install -y speedtest
|
sudo yum install -y speedtest
|
||||||
elif command -v apt-get &> /dev/null; then
|
elif command -v apt-get &>/dev/null; then
|
||||||
sudo apt-get update && sudo apt-get install -y curl
|
sudo apt-get update && sudo apt-get install -y curl
|
||||||
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
|
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
|
||||||
sudo apt-get install -y speedtest
|
sudo apt-get install -y speedtest
|
||||||
elif command -v apt &> /dev/null; then
|
elif command -v apt &>/dev/null; then
|
||||||
sudo apt update && sudo apt install -y curl
|
sudo apt update && sudo apt install -y curl
|
||||||
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
|
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
|
||||||
sudo apt install -y speedtest
|
sudo apt install -y speedtest
|
||||||
|
@ -647,8 +646,6 @@ run_speedtest() {
|
||||||
speedtest
|
speedtest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
show_usage() {
|
show_usage() {
|
||||||
echo "x-ui control menu usages: "
|
echo "x-ui control menu usages: "
|
||||||
echo "------------------------------------------"
|
echo "------------------------------------------"
|
||||||
|
|
Loading…
Reference in a new issue