feat: Implement password protection

This commit is contained in:
Kroese 2025-02-15 02:18:34 +01:00 committed by GitHub
parent 83369673a0
commit 195c092d52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,6 +65,7 @@ if [ -z "${CPU// /}" ] && grep -qi "model:" <<< "$CPI"; then
fi
CPU="${CPU// CPU/}"
CPU="${CPU// 8 Core/}"
CPU="${CPU// 16 Core/}"
CPU="${CPU// 32 Core/}"
CPU="${CPU// 64 Core/}"
@ -245,6 +246,15 @@ hasDisk() {
return 1
}
user="admin"
pass="$user"
[ -n "${USER:-}" ] && user="${USER:-}"
[ -n "${PASS:-}" ] && pass="${PASS:-}"
# Set password
echo "$user:{PLAIN}$pass" > /etc/nginx/.htpasswd
# Start webserver
cp -r /var/www/* /run/shm
html "Starting $APP for Docker..."