1
0
Fork 0
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:
Kayou 2019-03-08 22:04:09 +01:00
parent 619276677b
commit 1125a9433d
No known key found for this signature in database
GPG key ID: 823A2CBE071D3126
3 changed files with 33 additions and 10 deletions

View file

@ -127,6 +127,23 @@ ynh_store_file_checksum "${final_path}/lufi.conf"
#=================================================
# 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
#=================================================

View file

@ -196,13 +196,16 @@ yunohost service add $app --log "$final_path/log/production.log"
#=================================================
ynh_print_info "Configuring SSOwat..."
# Make app public or private
ynh_app_setting_set $app unprotected_uris "/"
if [ $is_public -eq 0 ];
if [ $is_public -eq 0 ]
then
ynh_app_setting_set $app protected_regex "/stats$","/manifest.webapp$","/$","/d/.*$","/m/.*$"
else
ynh_app_setting_delete $app protected_regex
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
#=================================================

View file

@ -185,13 +185,16 @@ ln -sf "$final_path/log/production.log" "/var/log/$app/production.log"
#=================================================
ynh_print_info "Upgrading SSOwat configuration..."
# Make app public or private
ynh_app_setting_set $app unprotected_uris "/"
if [ $is_public -eq 0 ];
if [ $is_public -eq 0 ]
then
ynh_app_setting_set $app protected_regex "/stats$","/manifest.webapp$","/$","/d/.*$","/m/.*$"
else
ynh_app_setting_delete $app protected_regex
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
#=================================================