Gitlab

From UVOO Tech Wiki
Jump to navigation Jump to search

Sites of Interest

Authentication

You can easily hook into your own application portal using auth api

Migrate from Local User to LDAP Auth

URL Links for Licensing

Who gets counted in the subscription?
Every person with a GitLab account on the instance is a user and is counted in the subscription. Only active users count towards total user count. Blocked users do not count, nor do Guest users in an Ultimate license.

For more detail, administrators can find user counts under the Admin wrench > Users. The Active Users tab indicates the users currently counted.

Backup & Migration to New Host

https://pikedom.com/migrate-gitlab-instance-to-new-host/

Some useful commands

gitlab-ctl reconfigure

Script

Add your new server ssh key into from_gitlab /root/.ssh/authorized_keys

#!/bin/bash
set -e

# This is after you have installed fresh OS and installed from from latest omnibus package
# You need to make sure source host is same version of gitlab as well

gitlab_from_host=x.x.x.x
gitlab_to_host=y.y.y.y
gitlab_backup_name=latestbackup

ssh gitlab_from_host "sudo gitlab-rake gitlab:backup:create STRATEGY=copy BACKUP=${gitlab_backup_name}"

scp ${gitlab_from_host}:/var/opt/gitlab/backups/${gitlab_backup_name}_gitlab_backup.tar /var/opt/gitlab/backups/
chown -v git:git /var/opt/gitlab/backups/${gitlab_backup_name}
scp ${gitlab_from_host}:/etc/gitlab/gitlab.rb /etc/gitlab/
scp ${gitlab_from_host}:/etc/gitlab/gitlab-secrets.json /etc/gitlab/
scp ${gitlab_from_host}:/etc/ssh/ssh_host_* /etc/ssh/

gitlab-rake gitlab:backup:restore BACKUP=${gitlab_backup_name}
# You can use --skip if you want to skip artifacts and such
cd /etc/gitlab
gitlab-ctl reconfigure
# You may want/need to reboot

Issues with backup runners after move (if you've lost gitlab-secrets.json)

gitlab-rails console
ApplicationSetting.current.reset_runners_registration_token!

Upgrades for Major version

sudo apt-get update
sudo apt-get install gitlab-ce=12.10.9-ce.0
# check gui url that it works
sudo apt-get install gitlab-ce=13.0.10-ce.0
...

Other

gitlab-rails dbconsole