Skip to content

Commit

Permalink
chore(dev): fix vdev check scripts warnings (#22277)
Browse files Browse the repository at this point in the history
* core(dev): fix vdev scripts warnings

* use a more complex expression to evaluate retries

* tweaks
  • Loading branch information
pront authored Jan 22, 2025
1 parent 21776bb commit 9161ca7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
25 changes: 13 additions & 12 deletions distribution/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -594,21 +594,25 @@ downloader() {
if [ "$1" = --check ]; then
need_cmd "$_dld"
elif [ "$_dld" = curl ]; then
check_curl_for_retry_support
_retry="$RETVAL"
if check_curl_for_retry_support; then
_retry=(--retry 3)
else
_retry=()
fi

get_ciphersuites_for_curl
_ciphersuites="$RETVAL"
if [ -n "$_ciphersuites" ]; then
_err=$(curl $_retry --proto '=https' --tlsv1.2 --ciphers "$_ciphersuites" --silent --show-error --fail --location "$1" --output "$2" 2>&1)
_err=$(curl "${_retry[@]}" --proto '=https' --tlsv1.2 --ciphers "$_ciphersuites" --silent --show-error --fail --location "$1" --output "$2" 2>&1)
_status=$?
else
echo "Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure"
if ! check_help_for "$3" curl --proto --tlsv1.2; then
echo "Warning: Not enforcing TLS v1.2, this is potentially less secure"
_err=$(curl $_retry --silent --show-error --fail --location "$1" --output "$2" 2>&1)
_err=$(curl "${_retry[@]}" --silent --show-error --fail --location "$1" --output "$2" 2>&1)
_status=$?
else
_err=$(curl $_retry --proto '=https' --tlsv1.2 --silent --show-error --fail --location "$1" --output "$2" 2>&1)
_err=$(curl "${_retry[@]}" --proto '=https' --tlsv1.2 --silent --show-error --fail --location "$1" --output "$2" 2>&1)
_status=$?
fi
fi
Expand Down Expand Up @@ -707,16 +711,13 @@ check_help_for() {
true # not strictly needed
}

# Check if curl supports the --retry flag, then pass it to the curl invocation.
# Check if curl supports the --retry flag
check_curl_for_retry_support() {
local _retry_supported=""
# "unspecified" is for arch, allows for possibility old OS using macports, homebrew, etc.
if check_help_for "notspecified" "curl" "--retry"; then
_retry_supported="--retry 3"
return 0
else
return 1
fi

RETVAL="$_retry_supported"

}

# Return cipher suite string specified by user, otherwise return strong TLS 1.2-1.3 cipher suites
Expand Down
4 changes: 0 additions & 4 deletions website/scripts/cue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ cmd_check() {
cargo vdev check docs
}

cmd_fmt() {
list-docs-files | xargs cue fmt "$@"
}

cmd_list() {
list-docs-files
}
Expand Down

0 comments on commit 9161ca7

Please sign in to comment.