diff --git a/src/freedombone-app-radicale b/src/freedombone-app-radicale index ced796d3..a44a7edd 100755 --- a/src/freedombone-app-radicale +++ b/src/freedombone-app-radicale @@ -57,9 +57,10 @@ function remove_user_radicale { function add_user_radicale { new_username="$1" new_user_password="$2" + new_user_hash=$(echo -n "$new_user_password" | sha1sum | awk -F ' ' '{print $1}') - if ! grep "$new_username:$new_user_password" ${RADICALE_DIRECTORY}/users; then - printf "$new_username:$new_user_password\n" >> ${RADICALE_DIRECTORY}/users + if ! grep "$new_username:$new_user_hash" ${RADICALE_DIRECTORY}/users; then + printf "$new_username:$new_user_hash\n" >> ${RADICALE_DIRECTORY}/users systemctl reload radicale fi echo '0' @@ -225,7 +226,7 @@ function install_radicale { echo '[auth]' > ${RADICALE_DIRECTORY}/config echo 'type = htpasswd' >> ${RADICALE_DIRECTORY}/config echo "htpasswd_filename = ${RADICALE_DIRECTORY}/users" >> ${RADICALE_DIRECTORY}/config - echo 'htpasswd_encryption = crypt' >> ${RADICALE_DIRECTORY}/config + echo 'htpasswd_encryption = sha1' >> ${RADICALE_DIRECTORY}/config echo '' >> ${RADICALE_DIRECTORY}/config echo '[rights]' >> ${RADICALE_DIRECTORY}/config echo 'type = owner_only' >> ${RADICALE_DIRECTORY}/config