diff --git a/src/freedombone b/src/freedombone index 27927b26..5d394fc0 100755 --- a/src/freedombone +++ b/src/freedombone @@ -8074,9 +8074,14 @@ function install_blog { fi # create a user + FULLBLOG_ADMIN_PASSWORD_HASH=$(freedombone-sec --bloghash "$FULLBLOG_ADMIN_PASSWORD") + if [ ${#FULLBLOG_ADMIN_PASSWORD_HASH} -lt 8 ]; then + echo $'Blog admin password could not be hashed' + exit 625728 + fi echo ';Password' > /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini - echo "password = '$FULLBLOG_ADMIN_PASSWORD'" >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini - echo 'encryption = clear' >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini + echo "password = '$FULLBLOG_ADMIN_PASSWORD_HASH'" >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini + echo 'encryption = bcrypt' >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini echo ';Role' >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini echo 'role = admin' >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini diff --git a/src/freedombone-adduser b/src/freedombone-adduser index e2c6bcf9..6277826d 100755 --- a/src/freedombone-adduser +++ b/src/freedombone-adduser @@ -247,9 +247,14 @@ if grep -q "Blog domain" $COMPLETION_FILE; then userdel -r $MY_USERNAME exit 9 fi + NEW_USER_PASSWORD_HASH=$(freedombone-sec --bloghash "$NEW_USER_PASSWORD") + if [ ${#NEW_USER_PASSWORD_HASH} -lt 8 ]; then + echo $'Blog admin password could not be hashed' + exit 783528 + fi echo ';Password' > /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini - echo "password = '$NEW_USER_PASSWORD'" >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini - echo 'encryption = clear' >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini + echo "password = '$NEW_USER_PASSWORD_HASH'" >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini + echo 'encryption = bcrypt' >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini echo ';Role' >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini echo 'role = admin' >> /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users/$MY_USERNAME.ini echo "$MY_USERNAME added as a blog user"