From 552d4ade038e4f0c03cf6d79b36da8879c5ab660 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Sun, 27 Apr 2014 15:17:47 +0530 Subject: [PATCH] gitlab-shell: use default gitlab_url talk to gitlab-ce api when signed ssl certificates are used --- assets/init | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/init b/assets/init index 8119f2ee..ada7566e 100755 --- a/assets/init +++ b/assets/init @@ -270,9 +270,18 @@ case "${GITLAB_HTTPS}" in true) case "${GITLAB_HTTPS_ONLY}" in true) - # talk to gitlab over https on localhost - # this will make sure the api access works when the default https port is not used. - sed -i 's,#{config.gitlab_url}/api/v3/internal,https://localhost/api/v3/internal,' -i /home/git/gitlab-shell/lib/gitlab_net.rb + case "${GITLAB_SSL_SELF_SIGNED}" in + true) + # we are using self signed certificates, talk to gitlab over https on localhost + # this will make sure the api access works when the default https port is not used. + sed -i 's,#{config.gitlab_url}/api/v3/internal,https://localhost/api/v3/internal,' -i /home/git/gitlab-shell/lib/gitlab_net.rb + ;; + *) + # signed https certificates are in use, talk to gitlab using the default gitlab_url. + # hence we are not editing anything here, just using the default. + # ps. when using signed ssl certificates, you **MUST** use the default https port. + ;; + esac ;; *) # we are not using https only mode, talk to gitlab over plain http on localhost