CentOS下GitLab權限設置主要包括以下方面:
sudo adduser git --system --shell /bin/bash --gecos 'Git Version Control' --disabled-login --home /home/git
創建git用戶,用sudo usermod -aG wheel git
將其添加到wheel組。sudo chown -R git:git /var/opt/gitlab
設置GitLab數據目錄所有者,用sudo chmod -R 755 /var/opt/gitlab
設置權限。項目倉庫目錄權限設置為755,.git
目錄為700。/etc/gitlab/gitlab.rb
,設置正確的數據、日志等目錄路徑和權限,如git_data_dirs({"default"=>{"path"=>"/var/opt/gitlab/git-data/repositories","permissions"=>"755"}})
,然后執行sudo gitlab-ctl reconfigure
使配置生效。