From c866841ae06aa361cc07cfde9da0eb17fce50de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 23 May 2024 14:19:19 +0200 Subject: [PATCH] Keep ldap configuration file on upgrade --- scripts/upgrade | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f1e5a4d..fc904a6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,12 +83,15 @@ ynh_setup_source --dest_dir="$install_dir" --full_replace=1 \ --keep="config/discourse.conf plugins_old public/uploads public/backups log" # Restore all non-core plugins -for plugin_dir in "$install_dir/plugins"/*; do +for plugin_dir in "$install_dir/plugins_old"/*; do plugin_name=$(basename "$plugin_dir") if [ ! -d "$install_dir/plugins/$plugin_name" ]; then mv "$plugin_dir" "$install_dir/plugins/$plugin_name" fi done +# Also restore ldap configuration file +mv "$install_dir/plugins_old/discourse-ldap-auth/conf/settings.yml" "$install_dir/plugins/discourse-ldap-auth/conf/settings.yml" + ynh_secure_remove --file="$install_dir/plugins_old" # Install LDAP plugin