1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00

Fix lua regex

This commit is contained in:
ewilly 2016-04-24 17:20:05 +02:00
parent b5fd13d1ee
commit 6d70c0458d

View file

@ -109,11 +109,17 @@ curl -k -X POST \
# 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
sudo yunohost app setting $app unprotected_uris -d
sudo yunohost app setting $app unprotected_regex -v "$domain$path/index.php%?f=.*$","$domain$path/index.php%?zipfolder=.*$","$domain$path/core/js/.*$","$domain$path/templates/.*$","$domain$path/private/temp/.*%.zip$"
else
sudo yunohost app setting $app unprotected_uris -v "/"
sudo yunohost app setting $app unprotected_regex -v \
"$domainluaregex$pathluaregex/index.php%?f=.+$", \
"$domainluaregex$pathluaregex/index.php%?zipfolder=.+$", \
"$domainluaregex$pathluaregex/private/temp/.+%.zip$", \
"$domainluaregex$pathluaregex/core/js/.*$", \
"$domainluaregex$pathluaregex/templates/.*$"
fi
# restart services