Skip to content

Commit 1a091ce

Browse files
authored
Merge pull request #2511 from getfloret/master
Fix: HealthCheck Script will Fail if the ENV GITLAB_HTTPS set True
2 parents 07d058f + def7ef5 commit 1a091ce

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
@@ -1642,9 +1642,13 @@ update_ssh_listen_port() {
16421642
generate_healthcheck_script() {
16431643
# configure healthcheck script
16441644
## https://docs.gitlab.com/ee/user/admin_area/monitoring/health_check.html
1645+
local HEALTHCHECK_PROTOCOL="http"
1646+
if [[ "${GITLAB_HTTPS}" == true ]]; then
1647+
HEALTHCHECK_PROTOCOL="${HEALTHCHECK_PROTOCOL}s"
1648+
fi
16451649
cat > /usr/local/sbin/healthcheck <<EOF
16461650
#!/bin/bash
1647-
url=http://localhost${GITLAB_RELATIVE_URL_ROOT}/-/liveness
1651+
url=${HEALTHCHECK_PROTOCOL}://localhost${GITLAB_RELATIVE_URL_ROOT}/-/liveness
16481652
options=( '--insecure' '--location' '--silent' )
16491653
curl "\${options[@]}" \$url
16501654
[[ "\$(curl \${options[@]} -o /dev/null -I -w '%{http_code}' \$url)" == "200" ]]

0 commit comments

Comments
 (0)