diff --git a/Base/check-grid.sh b/Base/check-grid.sh index 12366110b..ba18c6409 100755 --- a/Base/check-grid.sh +++ b/Base/check-grid.sh @@ -5,7 +5,7 @@ set -e HOST="localhost" PORT="4444" -BASIC_AUTH="$(echo -n "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64)" +BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)" echoerr() { echo "$@" 1>&2; } diff --git a/Makefile b/Makefile index d7377d6df..3d08fae18 100644 --- a/Makefile +++ b/Makefile @@ -951,6 +951,7 @@ chart_test_autoscaling_job: chart_test_autoscaling_playwright_connect_grid: PLATFORMS=$(PLATFORMS) CHART_ENABLE_TRACING=true CHART_ENABLE_BASIC_AUTH=true MATRIX_TESTS=CDPTests \ + BASIC_AUTH_USERNAME=docker-selenium BASIC_AUTH_PASSWORD=2NMI4jdBi6k7bENoeUfV25295VvzwAE9chM24a+2VL95uOHozo \ SECURE_INGRESS_ONLY_DEFAULT=true SECURE_USE_EXTERNAL_CERT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=443 \ VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) KEDA_BASED_NAME=$(KEDA_BASED_NAME) KEDA_BASED_TAG=$(KEDA_BASED_TAG) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ TEMPLATE_OUTPUT_FILENAME="k8s_playwright_connect_grid_basicAuth_secureIngress_ingressPublicIP_autoScaling_patchKEDA.yaml" \ diff --git a/Video/validate_endpoint.sh b/Video/validate_endpoint.sh index e9c969748..64576e8ce 100755 --- a/Video/validate_endpoint.sh +++ b/Video/validate_endpoint.sh @@ -5,7 +5,7 @@ graphql_endpoint=${2:-false} max_time=1 process_name="endpoint.checks" -BASIC_AUTH="$(echo -n "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64)" +BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)" if [ "${graphql_endpoint}" = "true" ]; then endpoint_checks=$(curl --noproxy "*" -m ${max_time} -k -X POST \ diff --git a/Video/video.sh b/Video/video.sh index 27ae6246b..97683b96f 100755 --- a/Video/video.sh +++ b/Video/video.sh @@ -29,7 +29,7 @@ else fi /opt/bin/validate_endpoint.sh "${NODE_STATUS_ENDPOINT}" -BASIC_AUTH="$(echo -n "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64)" +BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)" if [ -d "${VIDEO_FOLDER}" ]; then echo "$(date +%FT%T%Z) [${process_name}] - Video folder exists: ${VIDEO_FOLDER}" diff --git a/Video/video_graphQLQuery.sh b/Video/video_graphQLQuery.sh index bf877a5da..a10d99e99 100755 --- a/Video/video_graphQLQuery.sh +++ b/Video/video_graphQLQuery.sh @@ -14,7 +14,7 @@ if [[ -n ${GRAPHQL_ENDPOINT} ]] && [[ ! ${GRAPHQL_ENDPOINT} == */graphql ]]; the GRAPHQL_ENDPOINT="${GRAPHQL_ENDPOINT}/graphql" fi -BASIC_AUTH="$(echo -n "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64)" +BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)" VIDEO_CAP_NAME=${VIDEO_CAP_NAME:-"se:recordVideo"} TEST_NAME_CAP=${TEST_NAME_CAP:-"se:name"} diff --git a/charts/selenium-grid/configs/distributor/distributorProbe.sh b/charts/selenium-grid/configs/distributor/distributorProbe.sh index 15ce06b4e..ba701cdf1 100644 --- a/charts/selenium-grid/configs/distributor/distributorProbe.sh +++ b/charts/selenium-grid/configs/distributor/distributorProbe.sh @@ -7,7 +7,7 @@ ts_format=${SE_LOG_TIMESTAMP_FORMAT:-"+%T.%3N"} ROUTER_CONFIG_DIRECTORY=${ROUTER_CONFIG_DIRECTORY:-"/opt/bin"} GRID_GRAPHQL_URL=$(bash ${ROUTER_CONFIG_DIRECTORY}/routerGraphQLUrl.sh) -BASIC_AUTH="$(echo -n "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64)" +BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)" if [ -z "${GRID_GRAPHQL_URL}" ]; then echo "$(date ${ts_format}) DEBUG [${probe_name}] - Could not construct GraphQL endpoint, please provide SE_HUB_HOST (or SE_ROUTER_HOST) and SE_HUB_PORT (or SE_ROUTER_PORT). Bypass the probe checks for now." diff --git a/charts/selenium-grid/configs/node/nodeGridUrl.sh b/charts/selenium-grid/configs/node/nodeGridUrl.sh index 5164488d7..95687b4ff 100644 --- a/charts/selenium-grid/configs/node/nodeGridUrl.sh +++ b/charts/selenium-grid/configs/node/nodeGridUrl.sh @@ -2,7 +2,7 @@ max_time=3 -BASIC_AUTH="$(echo -n "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64)" +BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)" if [ "${SE_SUB_PATH}" = "/" ]; then SE_SUB_PATH="" diff --git a/charts/selenium-grid/configs/node/nodePreStop.sh b/charts/selenium-grid/configs/node/nodePreStop.sh index 0aeb7c583..92c1a2ca9 100644 --- a/charts/selenium-grid/configs/node/nodePreStop.sh +++ b/charts/selenium-grid/configs/node/nodePreStop.sh @@ -33,7 +33,7 @@ function signal_hub_to_drain_node() { return_list=($(bash ${NODE_CONFIG_DIRECTORY}/nodeGridUrl.sh)) grid_url=${return_list[0]} grid_check=${return_list[1]} - BASIC_AUTH="$(echo -n "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64)" + BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)" if [ -n "${grid_url}" ]; then if [ "${grid_check}" = "401" ]; then echo "$(date +%FT%T%Z) [${probe_name}] - Hub/Router requires authentication. Please check SE_ROUTER_USERNAME and SE_ROUTER_PASSWORD." diff --git a/charts/selenium-grid/configs/node/nodeProbe.sh b/charts/selenium-grid/configs/node/nodeProbe.sh index d3536219f..a50b14903 100644 --- a/charts/selenium-grid/configs/node/nodeProbe.sh +++ b/charts/selenium-grid/configs/node/nodeProbe.sh @@ -39,7 +39,7 @@ if curl --noproxy "*" -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE return_list=($(bash ${NODE_CONFIG_DIRECTORY}/nodeGridUrl.sh)) grid_url=${return_list[0]} grid_check=${return_list[1]} - BASIC_AUTH="$(echo -n "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64)" + BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)" if [ -n "${grid_url}" ]; then if [ "${grid_check}" = "401" ]; then diff --git a/charts/selenium-grid/configs/router/routerProbe.sh b/charts/selenium-grid/configs/router/routerProbe.sh index fe44551be..1a66c3340 100644 --- a/charts/selenium-grid/configs/router/routerProbe.sh +++ b/charts/selenium-grid/configs/router/routerProbe.sh @@ -7,7 +7,7 @@ ts_format=${SE_LOG_TIMESTAMP_FORMAT:-"+%T.%3N"} ROUTER_CONFIG_DIRECTORY=${ROUTER_CONFIG_DIRECTORY:-"/opt/bin"} GRID_GRAPHQL_URL=$(bash ${ROUTER_CONFIG_DIRECTORY}/routerGraphQLUrl.sh) -BASIC_AUTH="$(echo -n "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64)" +BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)" if [ -z "${GRID_GRAPHQL_URL}" ]; then echo "$(date ${ts_format}) DEBUG [${probe_name}] - Could not construct GraphQL endpoint, please provide SE_HUB_HOST (or SE_ROUTER_HOST) and SE_HUB_PORT (or SE_ROUTER_PORT). Bypass the probe checks for now." diff --git a/tests/CDPTests/bootstrap.sh b/tests/CDPTests/bootstrap.sh index f6d4cc38b..1da9e6adf 100755 --- a/tests/CDPTests/bootstrap.sh +++ b/tests/CDPTests/bootstrap.sh @@ -11,7 +11,7 @@ SELENIUM_REMOTE_URL="${SELENIUM_GRID_PROTOCOL}://${SELENIUM_GRID_HOST}:${SELENIU echo "SELENIUM_REMOTE_URL=${SELENIUM_REMOTE_URL}" > .env if [ -n ${SELENIUM_GRID_USERNAME} ] && [ -n ${SELENIUM_GRID_PASSWORD} ]; then - BASIC_AUTH="$(echo -n "${SELENIUM_GRID_USERNAME}:${SELENIUM_GRID_PASSWORD}" | base64)" + BASIC_AUTH="$(echo -en "${SELENIUM_GRID_USERNAME}:${SELENIUM_GRID_PASSWORD}" | base64 -w0)" echo "SELENIUM_REMOTE_HEADERS={\"Authorization\": \"Basic ${BASIC_AUTH}\"}" >> .env fi