Skip to content

Install Gitlab

This guide helps with installation of a dedicated Gitlab service. This Gitlab installation can be used as OAuth2 authorization provider to the DTaaS software.

There are two possible ways you can install Gitlab:

  • At dedicated domain name (ex: gitlab.foo.com)
  • At a URL path on existing WWW server (ex: foo.com/gitlab)

This guide illustrates the installation of Gitlab at: foo.com/gitlab. But the instructions can be adapted to install Gitlab at a dedicated domain name.

Configure and Install

If you have not cloned the DTaaS git repository, cloning would be the first step. In case you already have the codebase, you can skip the cloning step. To clone, do:

git clone https://github.com/into-cps-association/DTaaS.git
cd DTaaS/deploy/services

The next step in installation is to specify the config for the Gitlab. The gitlab.yml contains the required configuration settings. Update the configuration file before proceeding with the installation.

Now continue with the installation of services.

yarn install
node gitlab.js

Post-install Configuration

Gitlab also requires post-installation configuration.

Information

This configuration needs to be done from within the running container.

docker exec -it gitlab bash

The configuration file to change is /etc/gitlab/gitlab.rb. The variables to change are:

1
2
3
4
5
6
7
external_url 'http(s)://foo.com/gitlab'
nginx['listen_port'] = 80
nginx['enable'] = true

nginx['listen_https'] = false
nginx['redirect_http_to_https'] = false
letsencrypt['enable'] = false

If you want to use gitlab.foo.com for Gitlab installation, you can make one change: external_url http(s)://foo.com/gitlab. Other settings remain the same.

gitlab-ctl reconfigure

The administrator username for Gitlab is: root. The password for this user account is available in: /etc/gitlab/initial_root_password.

Traefik Gateway Configuration

It is likely that you are going to put the Gitlab behind Traefik gateway. If so, do remove the middleware authorization from gitlab PathPrefix.

Use

After the installation is complete, the required user accounts and OAuth2 applications can be setup on this Gitlab instance.