Skip to content

Commit 848711b

Browse files
authored
Update x-ui-pro.sh
1 parent 95791dc commit 848711b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

x-ui-pro.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
#################### x-ui-pro v9.2.0 @ github.com/GFW4Fun ##############################################
2+
#################### x-ui-pro v9.3.0 @ github.com/GFW4Fun ##############################################
33
[[ $EUID -ne 0 ]] && { echo "not root!"; exec sudo "$0" "$@"; }
44
##############################INFO######################################################################
55
msg_ok() { echo -e "\e[1;42m $1 \e[0m";}
@@ -128,7 +128,7 @@ if [[ "${SubDomain}.${MainDomain}" != "${domain}" ]] ; then
128128
fi
129129
###############################Install Packages#########################################################
130130
$Pak -y update
131-
for i in epel-release cronie psmisc unzip curl nginx certbot python3-certbot-nginx sqlite sqlite3 tor jq; do
131+
for i in epel-release cronie psmisc unzip curl nginx certbot python3-certbot-nginx sqlite sqlite3 tor jq openssl; do
132132
$Pak -y install "$i"
133133
done
134134
service_enable "nginx" "tor" "cron" "crond"
@@ -274,10 +274,12 @@ server {
274274
if (\$ssl_server_name !~* ^(.+\.)?$MainDomain\$ ) {set \$safe "\${safe}0"; }
275275
if (\$safe = 10){return 444;}
276276
if (\$request_uri ~ "(\"|'|\`|~|,|:|--|;|%|\\$|&&|\?\?|0x00|0X00|\||\\|\{|\}|\[|\]|<|>|\.\.\.|\.\.\/|\/\/\/)"){set \$hack 1;}
277-
error_page 400 401 402 403 500 501 502 503 504 =404 /404;
277+
error_page 400 402 403 500 501 502 503 504 =404 /404;
278278
proxy_intercept_errors on;
279279
#X-UI Admin Panel
280280
location $RNDSTR {
281+
auth_basic "Restricted Access";
282+
auth_basic_user_file /etc/nginx/.htpasswd;
281283
proxy_redirect off;
282284
proxy_set_header Host \$host;
283285
proxy_set_header X-Real-IP \$remote_addr;
@@ -409,7 +411,8 @@ if systemctl is-active --quiet x-ui || [ -e /etc/systemd/system/x-ui.service ];
409411
[[ -n $IP4 ]] && [[ "$IP4" =~ $IP4_REGEX ]] && msg_inf "IPv4: http://$IP4:$PORT$RNDSTR"
410412
[[ -n $IP6 ]] && [[ "$IP6" =~ $IP6_REGEX ]] && msg_inf "IPv6: http://[$IP6]:$PORT$RNDSTR"
411413
msg_inf "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
412-
msg_inf "X-UI Secure Panel: https://${domain}${RNDSTR}\n"
414+
sudo sh -c "echo -n '${XUIUSER}:' >> /etc/nginx/.htpasswd && openssl passwd -apr1 '${XUIPASS}' >> /etc/nginx/.htpasswd"
415+
msg_inf "X-UI (Double Login) Panel: https://${domain}${RNDSTR}\n"
413416
echo "Username: $XUIUSER"
414417
echo "Password: $XUIPASS"
415418
msg_inf "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"

0 commit comments

Comments
 (0)