Fix setting password for admin panel

This commit is contained in:
DeathByDenim 2022-02-13 15:10:59 -05:00
parent af66f8dae7
commit dacaad5aba
Signed by: DeathByDenim
GPG Key ID: 4A475283D925365B
3 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ apt install --assume-yes \
fuse g++ gcc curl firewalld automake autoconf libtool \
libcurl3-dev libc-ares-dev zlib1g-dev libncurses-dev make python3-aiohttp \
nginx-core certbot python3-certbot-nginx sudo python3-psutil \
ldc dub libenet-dev
ldc dub libenet-dev python3-bcrypt
# Create the user for running the game servers
if ! getent passwd ${systemuser}; then

0
scripts/deploy_lix.sh Normal file → Executable file
View File

View File

@ -43,7 +43,7 @@ patch --ignore-whitespace /etc/nginx/sites-available/default <<EOF
}
+ location ^~ /admin {
+ auth_basic “Restricted”;
+ auth_basic "Restricted";
+ auth_basic_user_file /etc/nginx/htpasswd;
+ }
+
@ -82,6 +82,6 @@ EOF
# Store password
echo -n "${systemuser}:" > /etc/nginx/htpasswd
echo "bcrypt.hashpw('${systempassword}'.encode('utf8'),bcrypt.gensalt(rounds=10))" | python3 >> /etc/nginx/htpasswd
echo -e "import bcrypt\nprint(bcrypt.hashpw('${systempassword}'.encode('utf8'),bcrypt.gensalt(rounds=10)).decode('utf8'))" | python3 >> /etc/nginx/htpasswd
systemctl restart nginx