From a4c091c2f5cc36dbab2ca574440a37839d26b122 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 23 Apr 2025 11:57:11 +0200 Subject: [PATCH] install_nextcloud.sh: Support Nextcloud installation without activated encryption module. --- install_nextcloud.sh | 114 ++++++++++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 38 deletions(-) diff --git a/install_nextcloud.sh b/install_nextcloud.sh index 6e3f70e..32b8dd3 100755 --- a/install_nextcloud.sh +++ b/install_nextcloud.sh @@ -695,6 +695,33 @@ else fi +# - Enable encryption module? +# - +ENABLE_ENCRYPTION=false + +echo "" +echo -e " \033[32m--\033[m" +echo "" +echo " Should the encryption module be switched on?" +echo "" +echo "" + +echononl "Enable encryption [yes/no]: " + +read OK + +while [[ "${OK,,}" != "yes" ]] && [[ "${OK,,}" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK +done + +if [[ ${OK,,} = "yes" ]] ; then + ENABLE_ENCRYPTION=true +else + ENABLE_ENCRYPTION=false +fi + + # - Install redis-service? # - INSTALL_REDIS_SERVICE=false @@ -1018,6 +1045,8 @@ echo " Nextcloud verion.....................: $VERSION" echo " Nextcloud installation directory.....: $INSTALL_DIR" echo " Nextcloud data directory.............: $DATA_DIR" echo "" +echo " Eenable Encryption...................: \033[33m${ENABLE_ENCRYPTION}\033[m" +echo "" echo " Admin user name......................: $ADMIN_USER" echo " Passord for admin user...............: $ADMIN_PASS" echo "" @@ -1110,6 +1139,8 @@ echo "# - Nextcloud verion.....................: $VERSION" >> $log_file echo "# - Nextcloud installation directory.....: $INSTALL_DIR" >> $log_file echo "# - Nextcloud data directory.............: $DATA_DIR" >> $log_file echo "# -" >> $log_file +echo "# - Eenable Encryption...................: ${ENABLE_ENCRYPTION}" >> $log_file +echo "# -" >> $log_file echo "# - Admin user name......................: $ADMIN_USER" >> $log_file echo "# - Passord for admin user...............: $ADMIN_PASS" >> $log_file echo "# -" >> $log_file @@ -3551,59 +3582,66 @@ fi blank_line -# - Activate and Enable (default) encryption module -# - -echo "" >> $log_file -echo "# - Eabable the (default) encryption module" >> $log_file -echo "# -" >> $log_file echononl "Eabable the (default) encryption module.." +if ${ENABLE_ENCRYPTION} ; then + # - Activate and Enable (default) encryption module + # - + echo "" >> $log_file + echo "# - Eabable the (default) encryption module" >> $log_file + echo "# -" >> $log_file -echo "sudo -u \"$HTTP_USER\" \"$php_binary\" \"${INSTALL_DIR}/occ\" app:enable encryption" >> $log_file -sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:enable encryption >> $log_file 2>&1 + echo "sudo -u \"$HTTP_USER\" \"$php_binary\" \"${INSTALL_DIR}/occ\" app:enable encryption" >> $log_file + sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:enable encryption >> $log_file 2>&1 -if [[ $? -eq 0 ]]; then - echo_ok -else - echo_failed - error "For more informations see log output at '$log_file'." + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "For more informations see log output at '$log_file'." - echononl "continue anyway [yes/no]: " - read OK - OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" - while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do - echononl "Wrong entry! - repeat [yes/no]: " + echononl "continue anyway [yes/no]: " read OK - done - [[ $OK = "yes" ]] || fatal "Interrupted ny user." + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interrupted ny user." + fi +else + echo_skipped fi -echo "" >> $log_file -echo "# - Enable encryption" >> $log_file -echo "# -" >> $log_file + echononl "Enable encryption.." +if ${ENABLE_ENCRYPTION} ; then + echo "" >> $log_file + echo "# - Enable encryption" >> $log_file + echo "# -" >> $log_file -echo "sudo -u \"$HTTP_USER\" \"$php_binary\" \"${INSTALL_DIR}/occ\" encryption:enable" >> $log_file -sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" encryption:enable >> $log_file 2>&1 + echo "sudo -u \"$HTTP_USER\" \"$php_binary\" \"${INSTALL_DIR}/occ\" encryption:enable" >> $log_file + sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" encryption:enable >> $log_file 2>&1 -if [[ $? -eq 0 ]]; then - echo_ok -else - echo_failed - error "For more informations see log output at '$log_file'." + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "For more informations see log output at '$log_file'." - echononl "continue anyway [yes/no]: " - read OK - OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" - while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do - echononl "Wrong entry! - repeat [yes/no]: " + echononl "continue anyway [yes/no]: " read OK - done - [[ $OK = "yes" ]] || fatal "Interrupted ny user." + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interrupted ny user." + fi +else + echo_skipped fi - - # - Adjust 'trusted_domains' # - _parameter="trusted_domains"