sudo dpkg -i gitlab-ce_9.2.5-ce.0_amd64.deb
sudo gitlab-ctl reconfigure
如需重启服务
sudo gitlab-ctl restart
sudo gitlab-rake gitlab:backup:create
默认备份文件位置: /var/opt/gitlab/backups
备份配置文件及密匙: /etc/gitlab/gitlab.rb
、/etc/gitlab/gitlab-secrets.json
sudo cp gitlab.rb /etc/gitlab/gitlab.rb
sudo cp gitlab-secrets.json /etc/gitlab/gitlab-secrets.json
sudo cp 1622265010_2021_05_29_9.2.5_gitlab_backup.tar /var/opt/gitlab/backups/
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
sudo gitlab-ctl status
sudo gitlab-rake gitlab:backup:restore BACKUP=1622265010_2021_05_29_9.2.5
sudo gitlab-ctl start
sudo gitlab-rake gitlab:check SANITIZE=true
修改Gitlab配置文件
external_url '[https://domain]'
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "[path_of_certificate_file]"
nginx['ssl_certificate_key'] = "[path_of_certificate_private_key]"
如果存在反向代理则配置如下
external_url '[https://domain]'
nginx['listen_port'] = proxy_port
nginx['listen_https'] = false
更新配置即可。
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart nginx
附:gitlab下nginx配置文件位置
server_name [https://domain];
ssl on;
ssl_certificate [path_of_certificate_file];
ssl_certificate_key [path_of_certificate_private_key];
1.查看IP是否被封,若Redis存在被封记录,则删除对应键即可
cd /opt/gitlab/embedded/bin/
./redis-cli -s /var/opt/gitlab/redis/redis.socket keys '*' | grep 'rack::attack'
./redis-cli -s /var/opt/gitlab/redis/redis.socket del [REDIS_KEY]
sudo gitlab-ctl tail nginx/gitlab_access.log
管理员账号用户名: root
1.创建系统SSH key pair(no passphrase)
ssh-keygen -t rsa -C "your.email@example.com" -b 4096
2.复制SSH公钥($HOME/.ssh/id_rsa.pub
)到gitlab
3.验证是否有效
ssh -T git@your-gitlab-domain
4.使用SSH方式拉取代码
ssh git@your-gitlab-domain:your-project.git