This guide assumes that you have a running gitlab instance on Linux installed via above Gitlab omnibus install. It is also assumed that you already have either a specific SSL certificate for your site (ex: gitlab-foo.yourdomain.com) or wildcard SSL certificates for your site (ex: *.yourdomain.com).
Below is a summary of what I did to convert my Gitlab instance to use SSL. I hope this is helpful to others:
My server: Ubuntu 12.04 x64 HVM - running in Amazon Web services on a C3.Large instance. At the time I installed this, there were some issues that prevented me from deploying Ubuntu 14.04, but I expect everything below should work exactly the same for Ubuntu 14.04
Put your ssl certificates on gitlab server
mkdir -p /etc/nginx/sslput your ssl certificates in this directory as:
server.crt <-- public key
server.key <-- private key in .pem format (first line contains something like BEGIN ___ PRIVATE KEY = .pem format)
Edit gitlab.rb template config file
edit /etc/gitlab/gitlab.rb and add or modify following lines:external_url 'https://your.domain.com'
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/nginx/ssl/server.crt"
nginx['ssl_certificate_key'] = "/etc/nginx/ssl/server.key"
Edit gitlab.yml config file
edit /var/opt/gitlab/gitlab-rails/etc/gitlab.ymlport: 443
https=true
Edit gitlab-shell/config.yml
edit /var/opt/gitlab/gitlab-shell/config.ymlca_file: /etc/nginx/ssl/server.crt
ca_path: /etc/nginx/ssl
gitlab_url: "https://127.0.0.1:8080"
Reconfigure with chef and restart
sudo gitlab-ctl reconfiguresudo gitlab-ctl restart
.... and that should do it!
4 comments:
Hi Ross,
Thanks for spreading the word about GitLab!
For your information, there is also a way to enable ssl fr GitLab Rails and GitLab Shell completely through Omnibus, please see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#enable-https
Best regards,
Sytse
Thanks, Sytse - I missed that after my initial install was up and running. It would be a good idea in my opinion to reference the omnibus README.md link in the default gitlab installation.md doc to make it easier for people searching the web after an install to find. Keep up the great work! :)
Thanks for you suggestion Ross, I added the link with https://gitlab.com/gitlab-com/www-gitlab-com/commit/f360a5ee2872c5833699b762b8aa00cd7a8a650c
Helpful post and still very relevant, thank you for the info Ross!
Post a Comment