Logo       PBase-Foundation

GitLab CE

Installation - Summary

Substitute your server's subdomain and email in the echo commands below. If your server is registered in DNS as your domain's root provide an empty string instead of "git" shown in the example. After providing these defaults run the yum commands as detailed below.

echo "git" > /root/DEFAULT_SUB_DOMAIN.txt
echo "myaddress@myemailprovider.com" > /root/DEFAULT_EMAIL_ADDRESS.txt
yum -y install https://pbase-foundation.com/pbase-repo.rpm
yum -y install pbase-preconfig-gitlab-ce
yum -y install pbase-gitlab-ce

Installation - Step by Step

Here is how to install an instance of the Gitlab CE omnibus stack. It assumes your CentOS 8/EL8 host is registered in DNS on a "git" subdomain like git.myexample.com and the installer will use Let's Encrypt to setup HTTPS.

Step 1: Provide your subdomain and admin email address by using the echo commands below to create a text file under the /root directory for each value. For example:
echo "git" > /root/DEFAULT_SUB_DOMAIN.txt
echo "myaddress@myemailprovider.com" > /root/DEFAULT_EMAIL_ADDRESS.txt

Step 2: Install the pbase-repo package with the command:
yum -y install https://pbase-foundation.com/pbase-repo.rpm

... when it runs, its output will point out the file pbase_repo.json that now holds copies of the defaults.

Step 3: Install the Gitlab dependencies and pre-configuration package with the command:
yum -y install pbase-preconfig-gitlab-ce

Step 4: Install the pbase-gitlab-ce package with the command:
yum -y install pbase-gitlab-ce

... it will take a few minutes for the installer to complete this step as it downloads and builds the dependencies used by Peertube.

It will use Let's Encrypt to generate a certificate for HTTPS connections.
When the pbase-gitlab-ce package completes you should have a full working instance of Peertube ready to be administered at https://git.myexample.com depending on your domain name.

You must login first to set the Gitlab root password and complete the first-time setup of your instance.

Extras

You should secure your server ports with pbase-firewall-enable and lock down SSH access with the pbase-ssh-fail2ban package.
If your server doesn't already have NTP/Chrony already running you should sync your clocks with the pbase-timesync-enable package.

yum -y install pbase-firewall-enable
yum -y install pbase-ssh-fail2ban
yum -y install pbase-timesync-enable

Compatibility: EL8/CentOS 8 only

Version 1.0 of the pbase-gitlab-ce package only works with Red Hat EL8 and CentOS 8.

Configuration Options

The first step of the installer is the pbase-repo package. It creates the module-config.d directory to hold customizable configuration option files:
/usr/local/pbase-data/admin-only/module-config.d/

The pbase-repo creates this file: pbase_repo.json
it must be edited to set the defaultEmailAddress field with your email.

{
"pbase_repo": {
"defaultEmailAddress": "myaddress@myexample.com",
"defaultDesktopUsername": "",
"defaultSmtpPassword": "",
"defaultSubDomain": ""
}
}

The third step of the install is the preconfig-gitlab-ce package. It places another default option file under the /usr/local/pbase-data/admin-only/module-config.d/ directory.

This is the Gitlab configuration options file: pbase_gitlab_ce.json
These defaults are appropriate for most use cases.
It assumes a subdomain of 'git'. If your subdomain is something else edit the externalUrlSubdomain field to specify it.

{
"pbase_gitlab_ce" : {
"externalUrlSubdomain": "git",
"externalUrlIsHttps": true,
"letsEncryptEnable": true,
"letsEncryptEmailAddress": "yoursysadmin@yourrealmail.com",
"crontabBackupEnable": true,
"crontabBackupHour": 2
}
}

Subdomain name

Your server's subdomain is defined in initial step of filling the /root/DEFAULT_SUB_DOMAIN.txt file. The value in this file is copied to the urlSubDomain field in the JSON preconfig pbase_gitlab_ce.json file created in step three of the install.
The steps shown above assumes the 'git' subdomain is configured in DNS.

The other option is to have Gitea for your root domain.
In this case, simply set the DEFAULT_SUB_DOMAIN file to an empty string with:
echo "" > /root/DEFAULT_SUB_DOMAIN.txt

... or omit it which sets the preconfig files' urlSubDomain fields to an empty string.

Source code of this RPM

This is the RPM .spec file containing the code that is executed by the pbase-gitlab installer. https://github.com/marklangbehn/pbase-rpm-installer/blob/master/applications/pbase-gitlab-ce/rpmbuild/SPECS/pbase-gitlab-ce.spec

More about Gitlab CE

Learn about the Gitlab project at:
https://about.gitlab.com/

"GitLab CE: Community Edition is a full featured CI/CD application for managing a Git repository and software development process."