From f069ac6eaf8d25e17d86352f1ee5feb1b0786600 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 5 Nov 2021 12:54:52 +0100 Subject: [PATCH] Do not rely on GPM to update LDAP plugin --- scripts/upgrade | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index da87e9a..08c490e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -138,6 +138,21 @@ fi #================================================= # SPECIFIC UPGRADE +#================================================= +# UPGRADE LDAP PLUGIN +#================================================= +ynh_script_progression --message="Installing and configuring LDAP plugin..." --weight=3 + +# Download LDAP source +ynh_setup_source --dest_dir="$final_path/user/plugins/login-ldap" --source_id="ldap" + +exec_as $app mkdir -p "$final_path/user/config/plugins/login-ldap" +exec_as $app touch "$final_path/user/accounts/admin.yaml" + +ynh_add_config --template="../conf/login-ldap.yaml" --destination="$final_path/user/config/plugins/login-ldap.yaml" +chown $app:$app "$final_path/user/config/plugins/login-ldap.yaml" +chmod 640 "$final_path/user/config/plugins/login-ldap.yaml" + #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -158,21 +173,6 @@ pushd "$final_path" ynh_exec_warn_less yes N | ynh_exec_warn_less exec_as $app php${YNH_PHP_VERSION} bin/gpm update --all-yes --no-interaction || ynh_print_warn --message="Automatic plugin upgrade has failed, you can upgrade them from your Grav admin panel." popd -#================================================= -# INSTALL LDAP PLUGIN -#================================================= -ynh_script_progression --message="Installing and configuring LDAP plugin..." --weight=3 - -pushd "$final_path" - exec_as $app php${YNH_PHP_VERSION} bin/gpm install login-ldap --no-interaction -popd -exec_as $app mkdir -p "$final_path/user/config/plugins/login-ldap" -exec_as $app touch "$final_path/user/accounts/admin.yaml" - -ynh_add_config --template="../conf/login-ldap.yaml" --destination="$final_path/user/config/plugins/login-ldap.yaml" -chown $app:$app "$final_path/user/config/plugins/login-ldap.yaml" -chmod 640 "$final_path/user/config/plugins/login-ldap.yaml" - #================================================= # CREATE A CRON TASK #=================================================