1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00
This commit is contained in:
ewilly 2016-10-12 21:46:28 +02:00
parent f43d99b7ad
commit 21fc085531
3 changed files with 8 additions and 14 deletions

View file

@ -110,7 +110,7 @@ then
# escape magic chars in vars (lua magic chars are ().%+-*?[^$ according to https://www.lua.org/pil/20.2.html)
domainluaregex=$(echo "$domain" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
pathluaregex=$(echo "$path" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
regexList=${domainluaregex}${pathluaregex}/index.php%?f=.+$","${domainluaregex}${pathluaregex}/index.php%?zipfolder=.+$","${domainluaregex}${pathluaregex}/private/temp/.+%.zip$","${domainluaregex}${pathluaregex}/core/js/.*$","${domainluaregex}${pathluaregex}/templates/.*$"
regexList="${domainluaregex}${pathluaregex}/index.php%?f=.+$","${domainluaregex}${pathluaregex}/index.php%?zipfolder=.+$","${domainluaregex}${pathluaregex}/private/temp/.+%.zip$","${domainluaregex}${pathluaregex}/core/js/.*$","${domainluaregex}${pathluaregex}/templates/.*$"
ynh_app_setting_set "$app" unprotected_regex "$regexList"
sudo yunohost app ssowatconf
fi

View file

@ -27,9 +27,7 @@ if [ -e "/home/yunohost.app/${app}" ]; then
sudo rm -rf /home/yunohost.app/${app}
fi
# Remove app dependencies
ynh_package_autoremove "${app}-deps" || true
# Restart services
sudo service php5-fpm restart || true
sudo service nginx restart || true
sudo service nginx reload || true
sudo yunohost app ssowatconf

View file

@ -55,19 +55,15 @@ sudo chmod 644 "$phpfpm_conf"
# if app is private, remove url to SSOWat conf from skipped_uris
if [ "$is_public" = "No" ];
then
ynh_app_setting_delete "$app" unprotected_uris
# escape magic chars in vars (lua magic chars are ().%+-*?[^$ according to https://www.lua.org/pil/20.2.html)
domainluaregex=$(echo "$domain" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
pathluaregex=$(echo "$path" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
# redirect to SSOwat login in
ynh_app_setting_delete "$app" unprotected_uris
ynh_app_setting_set "$app" unprotected_regex \
"${domainluaregex}${pathluaregex}/index.php%?f=.+$", \
"${domainluaregex}${pathluaregex}/index.php%?zipfolder=.+$", \
"${domainluaregex}${pathluaregex}/private/temp/.+%.zip$", \
"${domainluaregex}${pathluaregex}/core/js/.*$", \
"${domainluaregex}${pathluaregex}/templates/.*$"
regexList="${domainluaregex}${pathluaregex}/index.php%?f=.+$","${domainluaregex}${pathluaregex}/index.php%?zipfolder=.+$","${domainluaregex}${pathluaregex}/private/temp/.+%.zip$","${domainluaregex}${pathluaregex}/core/js/.*$","${domainluaregex}${pathluaregex}/templates/.*$"
ynh_app_setting_set "$app" unprotected_regex "$regexList"
sudo yunohost app ssowatconf
fi
# Restart services
sudo service php5-fpm restart || true
sudo service nginx restart || true
sudo service nginx reload || true