From c326837466d3813f023213a9d2c54a132f5fb0ba Mon Sep 17 00:00:00 2001 From: ewilly Date: Wed, 12 Oct 2016 20:59:47 +0200 Subject: [PATCH] update --- scripts/install | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/scripts/install b/scripts/install index 0c0520d..754a40c 100644 --- a/scripts/install +++ b/scripts/install @@ -84,34 +84,33 @@ sudo cp ../conf/php-fpm.conf "$phpfpm_conf" sudo chown root: "$phpfpm_conf" sudo chmod 644 "$phpfpm_conf" -# if app is private, remove url to SSOWat conf from skipped_uris -if [ "$is_public" = "No" ]; -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') - # 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/.*$" -else - ynh_app_setting_set "$app" unprotected_uris "/" -fi - # restart services sudo service php5-fpm restart || true sudo service nginx restart || true +# set temporary public access +ynh_app_setting_set "$app" unprotected_uris "/" +sudo yunohost app ssowatconf + # fill the superadmin creation form curl_path=$([ "$path" == "/" ] || echo "$path") -curl https://"$domain""$curl_path"/index.php?p=login > /dev/null 2>&1 +curl https://"$domain""$curl_path"/ > /dev/null 2>&1 curl -X POST \ --data-urlencode creation="1" \ --data-urlencode login="$admin" \ --data-urlencode pass="$password" \ --data-urlencode confirm="$password" \ https://"$domain""$curl_path"/index.php?p=login > /dev/null 2>&1 + +# 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') + 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" +fi + +sudo yunohost app ssowatconf