diff --git a/scripts/install b/scripts/install index 10603fc..d9f019b 100644 --- a/scripts/install +++ b/scripts/install @@ -166,8 +166,15 @@ ynh_script_progression --message="Configuring SSOwat..." if [ $is_public -eq 1 ] then ynh_app_setting_set --app=$app --key=skipped_uris --value="/" - # Keep /admin private - ynh_app_setting_set --app=$app --key=protected_uris --value="/admin" + + # Keep /admin private + if [ "$path_url" == "/" ]; then + # If the path is /, clear it to prevent any error with the regex. + path_url="" + fi + # Modify the domain to be used in a regex + domain_regex=$(echo "$domain" | sed 's@-@.@g') + ynh_app_setting_set $app protected_regex "$domain_regex$path_url/admin/" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 3e32dae..5ab1fc2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -220,8 +220,15 @@ ynh_script_progression --message="Upgrading SSOwat configuration..." if [ $is_public -eq 1 ] then ynh_app_setting_set --app=$app --key=skipped_uris --value="/" - # Keep /admin private - ynh_app_setting_set --app=$app --key=protected_uris --value="/admin" + + # Keep /admin private + if [ "$path_url" == "/" ]; then + # If the path is /, clear it to prevent any error with the regex. + path_url="" + fi + # Modify the domain to be used in a regex + domain_regex=$(echo "$domain" | sed 's@-@.@g') + ynh_app_setting_set $app protected_regex "$domain_regex$path_url/admin/" fi #=================================================