Move .htpasswd to /opt/etc

This commit is contained in:
iamromulan
2024-04-13 23:25:55 -04:00
parent db98e44aae
commit 0c62275c95
2 changed files with 4 additions and 4 deletions

View File

@@ -290,15 +290,15 @@ configure_simple_firewall() {
}
set_simpleadmin_passwd(){
ensure_entware_installed
while true; do
echo -e "\e[1;31mPlease set your simpleadmin (User: admin) web login password.\e[0m"
read -s password
if [ -z "$password" ]; then
echo -e "\e[1;32mNo password provided.\e[0m"
else
mkdir $SIMPLE_ADMIN_DIR > /dev/null 2>&1
echo -n "admin:" > $SIMPLE_ADMIN_DIR/.htpasswd
openssl passwd -crypt "$password" >> $SIMPLE_ADMIN_DIR/.htpasswd
echo -n "admin:" > /opt/etc/.htpasswd
openssl passwd -crypt "$password" >> /opt/etc/.htpasswd
echo -e "\e[1;32mPassword set.\e[0m"
break
fi

View File

@@ -14,7 +14,7 @@ server.document-root = "/usrdata/simpleadmin/www"
index-file.names = ( "index.html" )
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/usrdata/simpleadmin/.htpasswd"
auth.backend.htpasswd.userfile = "/opt/etc/.htpasswd"
$SERVER["socket"] == "0.0.0.0:443" {
ssl.engine = "enable"