Skip to content

Commit def7ef5

Browse files
author
AlpsTsui
committed
Fix: HealthCheck Script will Fail if the ENV GITLAB_HTTPS set True
1 parent 137376f commit def7ef5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

assets/runtime/functions

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,9 +1641,13 @@ update_ssh_listen_port() {
16411641
generate_healthcheck_script() {
16421642
# configure healthcheck script
16431643
## https://docs.gitlab.com/ee/user/admin_area/monitoring/health_check.html
1644+
local HEALTHCHECK_PROTOCOL="http"
1645+
if [[ "${GITLAB_HTTPS}" == true ]]; then
1646+
HEALTHCHECK_PROTOCOL="${HEALTHCHECK_PROTOCOL}s"
1647+
fi
16441648
cat > /usr/local/sbin/healthcheck <<EOF
16451649
#!/bin/bash
1646-
url=http://localhost${GITLAB_RELATIVE_URL_ROOT}/-/liveness
1650+
url=${HEALTHCHECK_PROTOCOL}://localhost${GITLAB_RELATIVE_URL_ROOT}/-/liveness
16471651
options=( '--insecure' '--location' '--silent' )
16481652
curl "\${options[@]}" \$url
16491653
[[ "\$(curl \${options[@]} -o /dev/null -I -w '%{http_code}' \$url)" == "200" ]]

0 commit comments

Comments
 (0)