mirror of
https://github.com/YunoHost-Apps/lufi_ynh.git
synced 2024-09-03 19:36:28 +02:00
Fix public/private
This commit is contained in:
parent
619276677b
commit
1125a9433d
3 changed files with 33 additions and 10 deletions
|
@ -127,6 +127,23 @@ ynh_store_file_checksum "${final_path}/lufi.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALISATION
|
# GENERIC FINALISATION
|
||||||
|
#=================================================
|
||||||
|
# UPDATE SSOWAT
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Reconfigure SSOwat"
|
||||||
|
|
||||||
|
ynh_app_setting_set $app unprotected_uris "/"
|
||||||
|
if [ $is_public -eq 0 ]
|
||||||
|
then
|
||||||
|
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/stats$","$domain_regex$path_url/manifest.webapp$","$domain_regex$path_url/$","$domain_regex$path_url/d/.*$","$domain_regex$path_url/m/.*$"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTART LUFI
|
# RESTART LUFI
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -196,13 +196,16 @@ yunohost service add $app --log "$final_path/log/production.log"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Configuring SSOwat..."
|
ynh_print_info "Configuring SSOwat..."
|
||||||
|
|
||||||
# Make app public or private
|
|
||||||
ynh_app_setting_set $app unprotected_uris "/"
|
ynh_app_setting_set $app unprotected_uris "/"
|
||||||
if [ $is_public -eq 0 ];
|
if [ $is_public -eq 0 ]
|
||||||
then
|
then
|
||||||
ynh_app_setting_set $app protected_regex "/stats$","/manifest.webapp$","/$","/d/.*$","/m/.*$"
|
if [ "$path_url" == "/" ]; then
|
||||||
else
|
# If the path is /, clear it to prevent any error with the regex.
|
||||||
ynh_app_setting_delete $app protected_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/stats$","$domain_regex$path_url/manifest.webapp$","$domain_regex$path_url/$","$domain_regex$path_url/d/.*$","$domain_regex$path_url/m/.*$"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -185,13 +185,16 @@ ln -sf "$final_path/log/production.log" "/var/log/$app/production.log"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Upgrading SSOwat configuration..."
|
ynh_print_info "Upgrading SSOwat configuration..."
|
||||||
|
|
||||||
# Make app public or private
|
|
||||||
ynh_app_setting_set $app unprotected_uris "/"
|
ynh_app_setting_set $app unprotected_uris "/"
|
||||||
if [ $is_public -eq 0 ];
|
if [ $is_public -eq 0 ]
|
||||||
then
|
then
|
||||||
ynh_app_setting_set $app protected_regex "/stats$","/manifest.webapp$","/$","/d/.*$","/m/.*$"
|
if [ "$path_url" == "/" ]; then
|
||||||
else
|
# If the path is /, clear it to prevent any error with the regex.
|
||||||
ynh_app_setting_delete $app protected_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/stats$","$domain_regex$path_url/manifest.webapp$","$domain_regex$path_url/$","$domain_regex$path_url/d/.*$","$domain_regex$path_url/m/.*$"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue