From cc963615b4017fcb39829900d52d4943de0fc652 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 12 May 2019 15:55:38 +0200 Subject: [PATCH] [fix] issues spotted durring review --- scripts/actions/internal_users | 18 +++++++----------- scripts/upgrade | 8 +++++++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/actions/internal_users b/scripts/actions/internal_users index 743c86b..271987b 100644 --- a/scripts/actions/internal_users +++ b/scripts/actions/internal_users @@ -13,8 +13,6 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -# Get authentication backend and set as lowercase -#auth_backend=${YNH_ACTION_IS_INTERNAL_USERS,,} # Get "is_internal_users" and set as lowercase is_internal_users=${YNH_ACTION_IS_INTERNAL_USERS,,} @@ -32,6 +30,11 @@ is_internal_users_old=$(ynh_app_setting_get $app is_internal_users) # CHECK IF ARGUMENTS AND REQUIREMENTS ARE CORRECT #================================================= +# Ensure that app is public +if [ $is_public -eq 0 ]; then + ynh_die "Wiki must be public if you want your people to be able to reach it. Run 'public_private' and come back here" 1 +fi + #================================================= # CHECK IF AN ACTION HAS TO BE DONE #================================================= @@ -118,16 +121,9 @@ ynh_replace_string "__YNH_ADMIN_USER__" "$admin" "$final_path/conf/loca # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum "$final_path/conf/local.protected.php" - -# Regen ssowat configuration -yunohost app ssowatconf +# Purge cache; see https://www.dokuwiki.org/faq:pluginproblems#cache +touch $final_path/conf/local.php # Update the config of the app ynh_app_setting_set $app auth_backend $auth_backend ynh_app_setting_set $app is_internal_users $is_internal_users - -#================================================= -# RELOAD NGINX -#================================================= - -systemctl reload nginx diff --git a/scripts/upgrade b/scripts/upgrade index e9f798f..7b70b82 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,7 +23,7 @@ is_public=$(ynh_app_setting_get $app is_public) final_path=$(ynh_app_setting_get $app final_path) auth_backend=$(ynh_app_setting_get $app auth_backend) -#is_internal_users=$(ynh_app_setting_get $app is_internal_users) +is_internal_users=$(ynh_app_setting_get $app is_internal_users) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -58,6 +58,12 @@ if [ -z "$language" ]; then ynh_app_setting_set $app language $language fi +# 'auth_backend' default value, if not set +if [ -z "$auth_backend" ]; then + auth_backend='authldap' + ynh_app_setting_set $app auth_backend $authldap +fi + # 'is_internal_users' default value, if not set if [ -z "$is_internal_users" ]; then ynh_app_setting_set $app is_internal_users 0