-
-
Save rjmsilveira/3a2c6f56216e46de901fad5598566ff7 to your computer and use it in GitHub Desktop.
gitlab-ce permissions fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Holds repositories directory | |
sudo chown -R -v git:root /var/opt/gitlab/git-data | |
sudo chmod -R -v 0700 /var/opt/gitlab/git-data | |
# Holds git repositories | |
sudo chown -R -v git:git /var/opt/gitlab/git-data/repositories | |
sudo chmod -R -v 2770 /var/opt/gitlab/git-data/repositories | |
# Holds large object directories | |
sudo chown -R -v git:gitlab-www /var/opt/gitlab/gitlab-rails/shared | |
sudo chmod -R -v 0751 /var/opt/gitlab/gitlab-rails/shared | |
# Holds CI artifacts | |
sudo chown -R -v git:root /var/opt/gitlab/gitlab-rails/shared/artifacts | |
sudo chmod -R -v 0700 /var/opt/gitlab/gitlab-rails/shared/artifacts | |
# Holds LFS objects | |
sudo chown -R -v git:root /var/opt/gitlab/gitlab-rails/shared/lfs-objects | |
sudo chmod -R -v 0700 /var/opt/gitlab/gitlab-rails/shared/lfs-objects | |
# Holds user attachments | |
sudo chown -R -v git:root /var/opt/gitlab/gitlab-rails/uploads | |
sudo chmod -R -v 0700 /var/opt/gitlab/gitlab-rails/uploads | |
# Holds user pages | |
sudo chown -R -v git:gitlab-www /var/opt/gitlab/gitlab-rails/shared/pages | |
sudo chmod -R -v 0750 /var/opt/gitlab/gitlab-rails/shared/pages | |
# Holds CI build logs | |
sudo chown -R -v git:root /var/opt/gitlab/gitlab-ci/builds | |
sudo chmod -R -v 0700 /var/opt/gitlab/gitlab-ci/builds | |
# PostgreSQL | |
sudo chown -R -v gitlab-psql:git /var/opt/gitlab/postgresql/data | |
sudo chmod -R -v 0700 /var/opt/gitlab/postgresql/data | |
sudo gitlab-ctl reconfigure | |
sudo gitlab-rake gitlab:check | |
sudo gitlab-ctl restart | |
################## | |
### All in One ### | |
################## | |
sudo chown -R -v git:root /var/opt/gitlab/git-data \ | |
&& sudo chmod -R -v 0700 /var/opt/gitlab/git-data \ | |
&& sudo chown -R -v git:git /var/opt/gitlab/git-data/repositories \ | |
&& sudo chmod -R -v 2770 /var/opt/gitlab/git-data/repositories \ | |
&& sudo chown -R -v git:gitlab-www /var/opt/gitlab/gitlab-rails/shared \ | |
&& sudo chmod -R -v 0751 /var/opt/gitlab/gitlab-rails/shared \ | |
&& sudo chown -R -v git:root /var/opt/gitlab/gitlab-rails/shared/artifacts \ | |
&& sudo chmod -R -v 0700 /var/opt/gitlab/gitlab-rails/shared/artifacts \ | |
&& sudo chown -R -v git:root /var/opt/gitlab/gitlab-rails/shared/lfs-objects \ | |
&& sudo chmod -R -v 0700 /var/opt/gitlab/gitlab-rails/shared/lfs-objects \ | |
&& sudo chown -R -v git:root /var/opt/gitlab/gitlab-rails/uploads \ | |
&& sudo chmod -R -v 0700 /var/opt/gitlab/gitlab-rails/uploads \ | |
&& sudo chown -R -v git:gitlab-www /var/opt/gitlab/gitlab-rails/shared/pages \ | |
&& sudo chmod -R -v 0750 /var/opt/gitlab/gitlab-rails/shared/pages \ | |
&& sudo chown -R -v git:root /var/opt/gitlab/gitlab-ci/builds \ | |
&& sudo chmod -R -v 0700 /var/opt/gitlab/gitlab-ci/builds \ | |
&& sudo chown -R -v gitlab-psql:git /var/opt/gitlab/postgresql/data \ | |
&& sudo chmod -R -v 0700 /var/opt/gitlab/postgresql/data \ | |
&& sudo gitlab-ctl reconfigure \ | |
&& sudo gitlab-rake gitlab:check \ | |
&& sudo gitlab-ctl restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment