Skip to content

Commit a289ef5

Browse files
committed
bug fixed - random user pass
1 parent b5dd258 commit a289ef5

4 files changed

Lines changed: 54 additions & 58 deletions

File tree

install.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ echo "The OS release is: $release"
2525

2626
arch3xui() {
2727
case "$(uname -m)" in
28-
x86_64 | x64 | amd64 ) echo 'amd64' ;;
29-
armv8 | arm64 | aarch64 ) echo 'arm64' ;;
30-
* ) echo -e "${green}Unsupported CPU architecture! ${plain}" && rm -f install.sh && exit 1 ;;
28+
x86_64 | x64 | amd64) echo 'amd64' ;;
29+
armv8 | arm64 | aarch64) echo 'arm64' ;;
30+
*) echo -e "${green}Unsupported CPU architecture! ${plain}" && rm -f install.sh && exit 1 ;;
3131
esac
3232
}
3333
echo "arch: $(arch3xui)"
@@ -39,7 +39,7 @@ if [[ "${release}" == "centos" ]]; then
3939
if [[ ${os_version} -lt 8 ]]; then
4040
echo -e "${red} Please use CentOS 8 or higher ${plain}\n" && exit 1
4141
fi
42-
elif [[ "${release}" == "ubuntu" ]]; then
42+
elif [[ "${release}" == "ubuntu" ]]; then
4343
if [[ ${os_version} -lt 20 ]]; then
4444
echo -e "${red}please use Ubuntu 20 or higher version!${plain}\n" && exit 1
4545
fi
@@ -59,18 +59,17 @@ fi
5959

6060
install_base() {
6161
case "${release}" in
62-
centos|fedora)
63-
yum install -y -q wget curl tar
64-
;;
65-
*)
66-
apt install -y -q wget curl tar
67-
;;
62+
centos | fedora)
63+
yum install -y -q wget curl tar
64+
;;
65+
*)
66+
apt install -y -q wget curl tar
67+
;;
6868
esac
6969
}
7070

7171
#This function will be called when user installed x-ui out of sercurity
7272
config_after_install() {
73-
/usr/local/x-ui/x-ui migrate
7473
echo -e "${yellow}Install/update finished! For security it's recommended to modify panel settings ${plain}"
7574
read -p "Do you want to continue with the modification [y/n]? ": config_confirm
7675
if [[ "${config_confirm}" == "y" || "${config_confirm}" == "Y" ]]; then
@@ -101,6 +100,7 @@ config_after_install() {
101100
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}"
102101
fi
103102
fi
103+
/usr/local/x-ui/x-ui migrate
104104
}
105105

106106
install_x-ui() {

web/html/xui/form/protocol/vmess.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<template slot="title">
1010
<span>{{ i18n "pages.inbounds.emailDesc" }}</span>
1111
</template>
12-
1312
</a-tooltip>
1413
</span>
1514
<a-icon @click="client.email = RandomUtil.randomText()" type="sync"> </a-icon>

web/translation/translate.en_US.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
"xtlsDesc" = "Xray core needs to be 1.7.5"
171171
"realityDesc" = "Xray core needs to be 1.8.0 or higher."
172172
"telegramDesc" = "use Telegram ID without @ or chat IDs ( you can get it here @userinfobot )"
173-
"subscriptionDesc" = "you can find your sub link on Details, also ou can use the same name for several configurations"
173+
"subscriptionDesc" = "you can find your sub link on Details, also you can use the same name for several configurations"
174174

175175
[pages.client]
176176
"add" = "Add Client"

x-ui.sh

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ if [[ "${release}" == "centos" ]]; then
4242
if [[ ${os_version} -lt 8 ]]; then
4343
echo -e "${red} Please use CentOS 8 or higher ${plain}\n" && exit 1
4444
fi
45-
elif [[ "${release}" == "ubuntu" ]]; then
45+
elif [[ "${release}" == "ubuntu" ]]; then
4646
if [[ ${os_version} -lt 20 ]]; then
4747
echo -e "${red}please use Ubuntu 20 or higher version! ${plain}\n" && exit 1
4848
fi
@@ -432,8 +432,7 @@ show_xray_status() {
432432
}
433433

434434
open_ports() {
435-
if ! command -v ufw &> /dev/null
436-
then
435+
if ! command -v ufw &>/dev/null; then
437436
echo "ufw firewall is not installed. Installing now..."
438437
sudo apt-get update
439438
sudo apt-get install -y ufw
@@ -460,22 +459,23 @@ open_ports() {
460459

461460
# Check if the input is valid
462461
if ! [[ $ports =~ ^([0-9]+|[0-9]+-[0-9]+)(,([0-9]+|[0-9]+-[0-9]+))*$ ]]; then
463-
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
462+
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
463+
exit 1
464464
fi
465465

466466
# Open the specified ports using ufw
467-
IFS=',' read -ra PORT_LIST <<< "$ports"
467+
IFS=',' read -ra PORT_LIST <<<"$ports"
468468
for port in "${PORT_LIST[@]}"; do
469469
if [[ $port == *-* ]]; then
470-
# Split the range into start and end ports
471-
start_port=$(echo $port | cut -d'-' -f1)
472-
end_port=$(echo $port | cut -d'-' -f2)
473-
# Loop through the range and open each port
474-
for ((i=start_port; i<=end_port; i++)); do
475-
sudo ufw allow $i
476-
done
470+
# Split the range into start and end ports
471+
start_port=$(echo $port | cut -d'-' -f1)
472+
end_port=$(echo $port | cut -d'-' -f2)
473+
# Loop through the range and open each port
474+
for ((i = start_port; i <= end_port; i++)); do
475+
sudo ufw allow $i
476+
done
477477
else
478-
sudo ufw allow "$port"
478+
sudo ufw allow "$port"
479479
fi
480480
done
481481

@@ -529,7 +529,7 @@ ssl_cert_issue() {
529529
fi
530530
fi
531531
#install socat second
532-
if [[ "${release}" == "centos" ]] || [[ "${release}" == "fedora" ]] ; then
532+
if [[ "${release}" == "centos" ]] || [[ "${release}" == "fedora" ]]; then
533533
yum install socat -y
534534
else
535535
apt install socat -y
@@ -555,16 +555,16 @@ ssl_cert_issue() {
555555
else
556556
LOGI "your domain is ready for issuing cert now..."
557557
fi
558-
559-
#create a directory for install cert
560-
certPath="/root/cert/${domain}"
561-
if [ ! -d "$certPath" ]; then
562-
mkdir -p "$certPath"
563-
else
564-
rm -rf "$certPath"
565-
mkdir -p "$certPath"
566-
fi
567-
558+
559+
#create a directory for install cert
560+
certPath="/root/cert/${domain}"
561+
if [ ! -d "$certPath" ]; then
562+
mkdir -p "$certPath"
563+
else
564+
rm -rf "$certPath"
565+
mkdir -p "$certPath"
566+
fi
567+
568568
#get needed port here
569569
local WebPort=80
570570
read -p "please choose which port do you use,default will be 80 port:" WebPort
@@ -595,21 +595,20 @@ ssl_cert_issue() {
595595
else
596596
LOGI "install certs succeed,enable auto renew..."
597597
fi
598-
599-
~/.acme.sh/acme.sh --upgrade --auto-upgrade
600-
if [ $? -ne 0 ]; then
601-
LOGE "auto renew failed, certs details:"
602-
ls -lah cert/*
603-
chmod 755 $certPath/*
604-
exit 1
605-
else
606-
LOGI "auto renew succeed, certs details:"
607-
ls -lah cert/*
608-
chmod 755 $certPath/*
609-
fi
610598

611-
}
599+
~/.acme.sh/acme.sh --upgrade --auto-upgrade
600+
if [ $? -ne 0 ]; then
601+
LOGE "auto renew failed, certs details:"
602+
ls -lah cert/*
603+
chmod 755 $certPath/*
604+
exit 1
605+
else
606+
LOGI "auto renew succeed, certs details:"
607+
ls -lah cert/*
608+
chmod 755 $certPath/*
609+
fi
612610

611+
}
613612

614613
warp_fixchatgpt() {
615614
curl -fsSL https://gist.githubusercontent.com/hamid-gh98/dc5dd9b0cc5b0412af927b1ccdb294c7/raw/install_warp_proxy.sh | bash
@@ -619,21 +618,21 @@ warp_fixchatgpt() {
619618

620619
run_speedtest() {
621620
# Check if Speedtest is already installed
622-
if ! command -v speedtest &> /dev/null; then
621+
if ! command -v speedtest &>/dev/null; then
623622
# If not installed, install it
624-
if command -v dnf &> /dev/null; then
623+
if command -v dnf &>/dev/null; then
625624
sudo dnf install -y curl
626625
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash
627626
sudo dnf install -y speedtest
628-
elif command -v yum &> /dev/null; then
627+
elif command -v yum &>/dev/null; then
629628
sudo yum install -y curl
630629
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash
631630
sudo yum install -y speedtest
632-
elif command -v apt-get &> /dev/null; then
631+
elif command -v apt-get &>/dev/null; then
633632
sudo apt-get update && sudo apt-get install -y curl
634633
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
635634
sudo apt-get install -y speedtest
636-
elif command -v apt &> /dev/null; then
635+
elif command -v apt &>/dev/null; then
637636
sudo apt update && sudo apt install -y curl
638637
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
639638
sudo apt install -y speedtest
@@ -647,8 +646,6 @@ run_speedtest() {
647646
speedtest
648647
}
649648

650-
651-
652649
show_usage() {
653650
echo "x-ui control menu usages: "
654651
echo "------------------------------------------"
@@ -760,7 +757,7 @@ show_menu() {
760757
19)
761758
warp_fixchatgpt
762759
;;
763-
20)
760+
20)
764761
run_speedtest
765762
;;
766763
*)

0 commit comments

Comments
 (0)