|
1 | 1 | #!/bin/bash
|
2 |
| -#################### x-ui-pro v9.2.0 @ github.com/GFW4Fun ############################################## |
| 2 | +#################### x-ui-pro v9.3.0 @ github.com/GFW4Fun ############################################## |
3 | 3 | [[ $EUID -ne 0 ]] && { echo "not root!"; exec sudo "$0" "$@"; }
|
4 | 4 | ##############################INFO######################################################################
|
5 | 5 | msg_ok() { echo -e "\e[1;42m $1 \e[0m";}
|
@@ -128,7 +128,7 @@ if [[ "${SubDomain}.${MainDomain}" != "${domain}" ]] ; then
|
128 | 128 | fi
|
129 | 129 | ###############################Install Packages#########################################################
|
130 | 130 | $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 |
132 | 132 | $Pak -y install "$i"
|
133 | 133 | done
|
134 | 134 | service_enable "nginx" "tor" "cron" "crond"
|
@@ -274,10 +274,12 @@ server {
|
274 | 274 | if (\$ssl_server_name !~* ^(.+\.)?$MainDomain\$ ) {set \$safe "\${safe}0"; }
|
275 | 275 | if (\$safe = 10){return 444;}
|
276 | 276 | 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; |
278 | 278 | proxy_intercept_errors on;
|
279 | 279 | #X-UI Admin Panel
|
280 | 280 | location $RNDSTR {
|
| 281 | + auth_basic "Restricted Access"; |
| 282 | + auth_basic_user_file /etc/nginx/.htpasswd; |
281 | 283 | proxy_redirect off;
|
282 | 284 | proxy_set_header Host \$host;
|
283 | 285 | 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 ];
|
409 | 411 | [[ -n $IP4 ]] && [[ "$IP4" =~ $IP4_REGEX ]] && msg_inf "IPv4: http://$IP4:$PORT$RNDSTR"
|
410 | 412 | [[ -n $IP6 ]] && [[ "$IP6" =~ $IP6_REGEX ]] && msg_inf "IPv6: http://[$IP6]:$PORT$RNDSTR"
|
411 | 413 | 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" |
413 | 416 | echo "Username: $XUIUSER"
|
414 | 417 | echo "Password: $XUIPASS"
|
415 | 418 | msg_inf "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
|
|
0 commit comments