Fix typos

This commit is contained in:
ericgaspar 2021-07-25 19:40:19 +02:00
parent 0dc407274c
commit 437093ee88
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -144,7 +144,7 @@ _VALIDATE_THAT_APP_CAN_BE_ACCESSED () {
# Not checking this if this ain't relevant for the current app # Not checking this if this ain't relevant for the current app
this_is_a_web_app || return 0 this_is_a_web_app || return 0
log_small_title "Validating that the app $app_id_to_check can/cant be accessed with its url..." log_small_title "Validating that the app $app_id_to_check can/can't be accessed with its URL..."
# Force the app to public only if we're checking the public-like installs AND there's no is_public arg # Force the app to public only if we're checking the public-like installs AND there's no is_public arg
# For example, that's the case for agendav which is always installed as # For example, that's the case for agendav which is always installed as
@ -160,7 +160,7 @@ _VALIDATE_THAT_APP_CAN_BE_ACCESSED () {
_RUN_YUNOHOST_CMD "app ssowatconf" _RUN_YUNOHOST_CMD "app ssowatconf"
fi fi
# Try to access to the url in 2 times, with a final / and without # Try to access to the URL in 2 times, with a final / and without
for i in $(seq 1 2) for i in $(seq 1 2)
do do
@ -185,7 +185,7 @@ _VALIDATE_THAT_APP_CAN_BE_ACCESSED () {
log_debug "Running curl $check_domain$curl_check_path" log_debug "Running curl $check_domain$curl_check_path"
# Call curl to try to access to the url of the app # Call curl to try to access to the URL of the app
curl --location --insecure --silent --show-error \ curl --location --insecure --silent --show-error \
--header "Host: $check_domain" \ --header "Host: $check_domain" \
--resolve $DOMAIN:80:$LXC_IP \ --resolve $DOMAIN:80:$LXC_IP \
@ -223,28 +223,28 @@ _VALIDATE_THAT_APP_CAN_BE_ACCESSED () {
[ $curl_error -eq 1 ] && log_error "The HTTP code shows an error." [ $curl_error -eq 1 ] && log_error "The HTTP code shows an error."
fi fi
# Analyze the output of curl # Analyze the output of cURL
if [ -e "$curl_output" ] if [ -e "$curl_output" ]
then then
# Print the title of the page # Print the title of the page
local page_title=$(grep "<title>" "$curl_output" | cut --delimiter='>' --fields=2 | cut --delimiter='<' --fields=1) local page_title=$(grep "<title>" "$curl_output" | cut --delimiter='>' --fields=2 | cut --delimiter='<' --fields=1)
local page_extract=$(lynx -dump -force_html "$curl_output" | head --lines 20 | tee -a "$complete_log") local page_extract=$(lynx -dump -force_html "$curl_output" | head --lines 20 | tee -a "$complete_log")
# Check if the page title is neither the YunoHost portail or default nginx page # Check if the page title is neither the YunoHost portail or default NGINX page
if [ "$page_title" = "YunoHost Portal" ] if [ "$page_title" = "YunoHost Portal" ]
then then
log_debug "The connection attempt fall on the YunoHost portal." log_debug "The connection attempt fall on the YunoHost portal."
fell_on_sso_portal=1 fell_on_sso_portal=1
# Falling on nginx default page is an error. # Falling on NGINX default page is an error.
elif echo "$page_title" | grep -q "Welcome to nginx" elif echo "$page_title" | grep -q "Welcome to NGINX"
then then
log_error "The connection attempt fall on nginx default page." log_error "The connection attempt fall on NGINX default page."
curl_error=1 curl_error=1
fi fi
fi fi
echo -e "Test url: $check_domain$curl_check_path echo -e "Test URL: $check_domain$curl_check_path
Real url: $(cat "./curl_print" | cut --delimiter=';' --fields=2) Real URL: $(cat "./curl_print" | cut --delimiter=';' --fields=2)
HTTP code: $http_code HTTP code: $http_code
Page title: $page_title Page title: $page_title
Page extract:\n$page_extract" > $TEST_CONTEXT/curl_result Page extract:\n$page_extract" > $TEST_CONTEXT/curl_result
@ -324,7 +324,7 @@ TEST_INSTALL () {
local is_public="1" local is_public="1"
[ "$install_type" = "subdir" ] && { start_test "Installation in a sub path"; local check_path=/path; } [ "$install_type" = "subdir" ] && { start_test "Installation in a sub path"; local check_path=/path; }
[ "$install_type" = "root" ] && { start_test "Installation on the root"; } [ "$install_type" = "root" ] && { start_test "Installation on the root"; }
[ "$install_type" = "nourl" ] && { start_test "Installation without url access"; local check_path=""; } [ "$install_type" = "nourl" ] && { start_test "Installation without URL access"; local check_path=""; }
[ "$install_type" = "private" ] && { start_test "Installation in private mode"; local is_public="0"; } [ "$install_type" = "private" ] && { start_test "Installation in private mode"; local is_public="0"; }
local snapname=snap_${install_type}install local snapname=snap_${install_type}install
@ -628,7 +628,7 @@ TEST_CHANGE_URL () {
continue continue
fi fi
log_small_title "Changing the url from $current_domain$current_path to $new_domain$new_path..." \ log_small_title "Changing the URL from $current_domain$current_path to $new_domain$new_path..." \
&& _RUN_YUNOHOST_CMD "app change-url $app_id -d $new_domain -p $new_path" \ && _RUN_YUNOHOST_CMD "app change-url $app_id -d $new_domain -p $new_path" \
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $new_domain $new_path && _VALIDATE_THAT_APP_CAN_BE_ACCESSED $new_domain $new_path