From e90bd93c9f9532d7b9e987b17916081333de9ad3 Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Tue, 17 May 2022 23:33:32 -0500 Subject: [PATCH] Fix fts reinstall (#2328) --- apps/fulltextsearch.sh | 7 +++---- lib.sh | 12 ++++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/fulltextsearch.sh b/apps/fulltextsearch.sh index 7c1e9d24b6..30aaa5c439 100644 --- a/apps/fulltextsearch.sh +++ b/apps/fulltextsearch.sh @@ -24,7 +24,7 @@ debug_mode # Must be root root_check -# Nextcloud 18 is required. +# Nextcloud 21 is required. lowest_compatible_nc 21 # Check if Full Text Search is already installed @@ -49,9 +49,8 @@ else done # Removal Docker image docker_prune_this "$nc_fts" - docker_prune_this "$opens_fts" docker_prune_volume "esdata" - docker_prune_volume "fts_os-data" + docker-compose_down "$OPNSDIR/docker-compose.yml" # Remove configuration files rm -rf "$RORDIR" rm -rf "$OPNSDIR" @@ -98,7 +97,7 @@ install_if_not docker-compose set_max_count mkdir -p "$OPNSDIR" docker pull "$opens_fts" -BCRYPT_HASH="$(docker run -it $opens_fts \ +BCRYPT_HASH="$(docker run --rm -it $opens_fts \ bash -c "plugins/opensearch-security/tools/hash.sh -p $OPNSREST | tr -d ':\n' ")" # Create configurations YML diff --git a/lib.sh b/lib.sh index 3ab0a88388..47ff3c0fc8 100644 --- a/lib.sh +++ b/lib.sh @@ -1697,6 +1697,18 @@ You will be given the option to abort when you hit OK." fi } +# Stop and remove selected docker-compose items (containers, networks, volumes) by up. +# docker-compose_down "$OPNSDIR/docker-compose.yml" (absolute path to docker-compose.yml) +docker-compose_down() { +if [ -f "$1" ] +then + cd "$(dirname "$1")" + docker-compose down --volume --rmi all +else + echo "Non-existing docker-compose file path, skipping..." +fi +} + # Update specific Docker image # docker_update_specific 'vaultwarden' 'Vaultwarden' (docker conainter name = $1, the name in text = $2)