Gitlab: Difference between revisions

m Correcting the owner + group here to match gitlab runner.
DHCP (talk | contribs)
m style improvements
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:


=== Generate Secrets ===
=== Generate Secrets ===
<syntaxhighlight lang="bash">
<syntaxhighlight lang=console>
sudo install -d -m 0700 /var/lib/gitlab/secrets
# install -d -m 0700 /var/lib/gitlab/secrets
sudo sh -c 'openssl rand -hex 32 > /var/lib/gitlab/secrets/activeRecordPrimaryKey'
# sh -c 'openssl rand -hex 32 > /var/lib/gitlab/secrets/activeRecordPrimaryKey'
sudo sh -c 'openssl rand -hex 32 > /var/lib/gitlab/secrets/activeRecordDeterministicKey'
# sh -c 'openssl rand -hex 32 > /var/lib/gitlab/secrets/activeRecordDeterministicKey'
sudo sh -c 'openssl rand -hex 32 > /var/lib/gitlab/secrets/activeRecordSalt'
# sh -c 'openssl rand -hex 32 > /var/lib/gitlab/secrets/activeRecordSalt'
sudo chown -R gitlab:gitlab /var/lib/gitlab/secrets
# chown -R gitlab:gitlab /var/lib/gitlab/secrets
sudo chmod 700 /var/lib/gitlab/secrets
# chmod 700 /var/lib/gitlab/secrets
sudo chmod 0600 /var/lib/gitlab/secrets/*
# chmod 0600 /var/lib/gitlab/secrets/*
</syntaxhighlight>
</syntaxhighlight>


Line 57: Line 57:
Query info about your Gitlab instance
Query info about your Gitlab instance


<syntaxHighlight lang="bash">
<syntaxHighlight lang=console>
gitlab-rake gitlab:env:info
$ gitlab-rake gitlab:env:info
</syntaxHighlight>
</syntaxHighlight>


Check for configuration errors
Check for configuration errors


<syntaxHighlight lang="bash">
<syntaxHighlight lang=console>
gitlab-rake gitlab:check
$ gitlab-rake gitlab:check
</syntaxHighlight>
</syntaxHighlight>


Line 145: Line 145:
Apparently, it can happen that no root user is created (or at least not fully created in the database) when building the system with a newly configured Gitlab service.
Apparently, it can happen that no root user is created (or at least not fully created in the database) when building the system with a newly configured Gitlab service.


In this case, it can help to stop the Gitlab service, drop the postgres database and reboot the system. This sequence instantiates the Gitlab root user. With that, it's possible to log in with user "root" and the password configured in "initialRootPasswordFile".<syntaxhighlight lang="bash">
In this case, it can help to stop the Gitlab service, drop the postgres database and reboot the system. This sequence instantiates the Gitlab root user. With that, it's possible to log in with user "root" and the password configured in "initialRootPasswordFile".<syntaxhighlight lang=console>
# stop the gitlab stack
$ # stop the gitlab stack
systemctl stop gitlab.service
$ systemctl stop gitlab.service


# drop the database
$ # drop the database
sudo -u postgres dropdb gitlab
$ sudo -u postgres dropdb gitlab


# reboot (just starting the gitlab service again seems not to be sufficient)
$ # reboot (just starting the gitlab service again seems not to be sufficient)
sudo reboot
$ sudo reboot
</syntaxhighlight>
</syntaxhighlight>


Line 167: Line 167:
     IdentitiesOnly yes
     IdentitiesOnly yes
     PreferredAuthentications publickey
     PreferredAuthentications publickey
Note: If you want to just be able to copy the url from the clone Gitlab menu consider changing the git user to the generated "gitlab" user or create some other user yourself. See gitlabs reference [https://docs.gitlab.com/omnibus/settings/configuration/#change-the-name-of-the-git-user-or-group Change the name of the git user or group]


<references />
<references />