1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

minor typos

This commit is contained in:
Éric Gaspar 2024-08-03 09:49:44 +02:00
parent 5e498ded58
commit e83c680c54

View file

@ -9,8 +9,8 @@
#================================================= #=================================================
wait_nginx_reload() { wait_nginx_reload() {
# Nginx may take some time to support the new configuration, # NGINX may take some time to support the new configuration,
# wait for the nextcloud configuration file to disappear from nginx before checking the CalDAV/CardDAV URL. # wait for the Nextcloud configuration file to disappear from NGINX before checking the CalDAV/CardDAV URL.
timeout=30 timeout=30
for i in $(seq 1 $timeout); do for i in $(seq 1 $timeout); do
if ! ynh_exec_warn_less nginx -T | grep --quiet "# configuration file /etc/nginx/conf.d/$domain.d/$app.conf:"; then if ! ynh_exec_warn_less nginx -T | grep --quiet "# configuration file /etc/nginx/conf.d/$domain.d/$app.conf:"; then
@ -18,7 +18,7 @@ wait_nginx_reload() {
fi fi
sleep 1 sleep 1
done done
# Wait untils nginx has fully reloaded (avoid curl fail with http2) # Wait untils NGINX has fully reloaded (avoid cURL fail with http2)
sleep 2 sleep 2
} }
@ -33,22 +33,22 @@ is_url_handled() {
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
# Try to get the url with curl, and keep the http code and an eventual redirection url. # Try to get the URL with cURL, and keep the http code and an eventual redirection URL.
local curl_output="$(curl --insecure --silent --output /dev/null \ local curl_output="$(curl --insecure --silent --output /dev/null \
--write-out '%{http_code};%{redirect_url}' https://127.0.0.1$path --header "Host: $domain" --resolve $domain:443:127.0.0.1)" --write-out '%{http_code};%{redirect_url}' https://127.0.0.1$path --header "Host: $domain" --resolve $domain:443:127.0.0.1)"
# Cut the output and keep only the first part to keep the http code # Cut the output and keep only the first part to keep the http code
local http_code="${curl_output%%;*}" local http_code="${curl_output%%;*}"
# Do the same thing but keep the second part, the redirection url # Do the same thing but keep the second part, the redirection URL
local redirection="${curl_output#*;}" local redirection="${curl_output#*;}"
# Return 1 if the url isn't handled. # Return 1 if the URL isn't handled.
# Which means either curl got a 404 (or the admin) or the sso. # Which means either cURL got a 404 (or the admin) or the SSO.
# A handled url should redirect to a publicly accessible url. # A handled URL should redirect to a publicly accessible URL.
# Return 1 if the url has returned 404 # Return 1 if the URL has returned 404
if [ "$http_code" = "404" ] || [[ $redirection =~ "/yunohost/admin" ]]; then if [ "$http_code" = "404" ] || [[ $redirection =~ "/yunohost/admin" ]]; then
return 1 return 1
# Return 1 if the url is redirected to the SSO # Return 1 if the URL is redirected to the SSO
elif [[ $redirection =~ "/yunohost/sso" ]]; then elif [[ $redirection =~ "/yunohost/sso" ]]; then
return 1 return 1
fi fi