From 21fc085531e5d04a07bb37d2c1c686f0edc87847 Mon Sep 17 00:00:00 2001 From: ewilly Date: Wed, 12 Oct 2016 21:46:28 +0200 Subject: [PATCH] update --- scripts/install | 2 +- scripts/remove | 6 ++---- scripts/upgrade | 14 +++++--------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/scripts/install b/scripts/install index 867110e..3697179 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/remove b/scripts/remove index f2f9394..4a86735 100644 --- a/scripts/remove +++ b/scripts/remove @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 3102d88..3937ee5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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