From a30f6696a39d371424300e22182317a0317575b7 Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Thu, 23 Jan 2025 08:30:48 +0100 Subject: [PATCH 1/3] update.sh: fixed --force for solr-removal + code optimization --- update.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/update.sh b/update.sh index 715ab3fee..94c1a8423 100755 --- a/update.sh +++ b/update.sh @@ -676,23 +676,21 @@ migrate_solr_config_options() { solr_volume=$(docker volume ls -qf name=^${COMPOSE_PROJECT_NAME}_solr-vol-1) if [[ -n $solr_volume ]]; then - echo -e "\e[34mSolr has been replaced within mailcow since 2025-01.\e[0m" + echo -e "\e[34mSolr has been replaced within mailcow since 2025-01.\nThe volume $solr_volume is unused.\e[0m" sleep 1 - echo -e "\e[34mTherefore the volume $solr_volume is unused.\e[0m" - sleep 1 - read -r -p "Would you like to remove the $solr_volume? " response - if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then - echo -e "\e[33mRemoving $solr_volume...\e[0m" - docker volume rm $solr_volume - if [[ $? != 0 ]]; then - echo -e "\e[31mCould not remove the volume... Please remove it manually!\e[0m" + if [ ! "$FORCE" ]; then + read -r -p "Remove $solr_volume? [y/N] " response + if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then + echo -e "\e[33mRemoving $solr_volume...\e[0m" + docker volume rm $solr_volume || echo -e "\e[31mFailed to remove. Remove it manually!\e[0m" && exit + echo -e "\e[32mSuccessfully removed $solr_volume!\e[0m" else - echo -e "\e[32mSucessfully removed $solr_volume!\e[0m" + echo -e "Not removing $solr_volume. Run \`docker volume rm $solr_volume\` manually if needed." fi else - echo "Ok! Not removing $solr_volume then." - echo "Once you decided on removing the volume simply run docker volume rm $solr_volume to remove it manually." - echo "This can be done anytime. mailcow does not use this volume anymore." + echo -e "\e[33mForce removing $solr_volume...\e[0m" + docker volume rm $solr_volume || echo -e "\e[31mFailed to remove. Remove it manually!\e[0m" && exit + echo -e "\e[32mSuccessfully removed $solr_volume!\e[0m" fi fi From 5a04942d89b220da3f1e5f5d1c5f318fca19d2f1 Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Thu, 23 Jan 2025 08:38:14 +0100 Subject: [PATCH 2/3] update.sh: changed SKIP_FTS default to y instead n for updates --- update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 94c1a8423..128abfda7 100755 --- a/update.sh +++ b/update.sh @@ -473,7 +473,7 @@ adapt_new_options() { echo "Adding new option \"${option}\" to mailcow.conf" echo '# Skip FTS (Fulltext Search) for Dovecot on low-memory systems or if you simply want to disable it.' >> mailcow.conf echo "# Dovecot inside mailcow use Flatcurve as FTS Backend." >> mailcow.conf - echo "SKIP_FTS=n" >> mailcow.conf + echo "SKIP_FTS=y" >> mailcow.conf fi elif [[ ${option} == "FTS_PROCS" ]]; then if ! grep -q ${option} mailcow.conf; then From 1dac8f1f66ad1767bf7cb5c64f4a95a2af94f2c8 Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Thu, 23 Jan 2025 08:42:22 +0100 Subject: [PATCH 3/3] scripts: changed SKIP_FTS text to warn on lower threaded systems --- generate_config.sh | 2 +- update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_config.sh b/generate_config.sh index 3044ab8d7..8f03e3899 100755 --- a/generate_config.sh +++ b/generate_config.sh @@ -379,7 +379,7 @@ SKIP_CLAMD=${SKIP_CLAMD} SKIP_SOGO=n -# Skip FTS (Fulltext Search) for Dovecot on low-memory systems or if you simply want to disable it. +# Skip FTS (Fulltext Search) for Dovecot on low-memory, low-threaded systems or if you simply want to disable it. # Dovecot inside mailcow use Flatcurve as FTS Backend. SKIP_FTS=n diff --git a/update.sh b/update.sh index 128abfda7..268fe7326 100755 --- a/update.sh +++ b/update.sh @@ -471,7 +471,7 @@ adapt_new_options() { elif [[ ${option} == "SKIP_FTS" ]]; then if ! grep -q ${option} mailcow.conf; then echo "Adding new option \"${option}\" to mailcow.conf" - echo '# Skip FTS (Fulltext Search) for Dovecot on low-memory systems or if you simply want to disable it.' >> mailcow.conf + echo '# Skip FTS (Fulltext Search) for Dovecot on low-memory, low-threaded systems or if you simply want to disable it.' >> mailcow.conf echo "# Dovecot inside mailcow use Flatcurve as FTS Backend." >> mailcow.conf echo "SKIP_FTS=y" >> mailcow.conf fi