GitLab

From Christoph's Personal Wiki
Revision as of 01:23, 9 February 2020 by Christoph (Talk | contribs) (Created page with "'''GitLab''' is a web-based DevOps lifecycle tool that provides a Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features, using an open-sour...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GitLab is a web-based DevOps lifecycle tool that provides a Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features, using an open-source license, developed by GitLab Inc.

Fix Let's Encrypt errors

If after running gitlab-ctl reconfigure you see an error that looks like the following:

Acme::Client::Error::Malformed: Method not allowed

Below are the steps I use to fix it:

  • Edit the /etc/gitlab/gitlab.rb file and disable https external_url and letsencrypt settings:
external_url 'http://domain.com'
#external_url 'https://domain.com'
# letsencrypt['auto_renew'] = true
# letsencrypt['auto_renew_hour'] = 0
# letsencrypt['auto_renew_minute'] = nil # Should be a number or cron expression, if specified.
# letsencrypt['auto_renew_day_of_month'] = "*/4"
  • Then reconfigure gitlab:
$ sudo gitlab-ctl reconfigure
  • Upgrade gitlab to the latest version:
$ sudo apt update -y && sudo apt upgrade -y
  • Edit the /etc/gitlab/gitlab.rb file again and uncomment https/letsencrypt settings:
external_url 'http://domain.com'
external_url 'https://domain.com'
letsencrypt['auto_renew'] = true
letsencrypt['auto_renew_hour'] = 0
letsencrypt['auto_renew_minute'] = nil # Should be a number or cron expression, if specified.
letsencrypt['auto_renew_day_of_month'] = "*/4"
  • Renew the certs and reconfigure (note: you may have to reconfigure one more time for the certs):
$ sudo gitlab-ctl reconfigure
$ sudo gitlab-ctl restart redis
$ sudo gitlab-ctl renew-le-certs
$ sudo gitlab-ctl gitlab-ce reconfigure

And now we are running the latest version of gitlab-ce and the certs have been renewed.

Miscelleanous

  • Reset root password:
$ cat << EOF >reset_root_passwd.sh
#!/bin/bash

gitlab-rails runner -e production " \
  user = User.find_by(id: 1);
  user.password = user.password_confirmation = '<MY_NEW_PASSWORD>'; \
  user.save!"
EOF

External links