要在沒有外網(wǎng)的麒麟系統(tǒng)上搭建GitLab服務(wù)并且無需客戶端賬號(hào)密碼驗(yàn)證,可以按照以下步驟進(jìn)行操作:
- 安裝必要的依賴包和軟件
sudo yum install curl policycoreutils-python openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
- 安裝GitLab的依賴工具
sudo yum install -y curl policycoreutils-python openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
- 下載并安裝GitLab
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ee
- 配置GitLab
打開GitLab配置文件并做出如下修改:
sudo vim /etc/gitlab/gitlab.rb
將external_url
配置為:
external_url 'http://localhost:80'
去掉nginx
配置:
nginx['enable'] = false
添加GitLab監(jiān)聽所有本地IP地址:
web_listen_address = '0.0.0.0'
web_listen_port = 80
允許HTTP訪問:
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "localhost:8181"
gitlab_rails['trusted_proxies'] = ['127.0.0.1', 'localhost', '::1']
nginx['enable'] = false
保存文件并退出。文章來源:http://www.zghlxwxcb.cn/news/detail-709392.html
- 重新配置并啟動(dòng)GitLab
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
- 創(chuàng)建并添加管理員賬戶
sudo gitlab-rails console
user = User.new(username: 'admin', name: 'Administrator', email: 'admin@example.com', password: 'password', password_confirmation: 'password')
user.admin = true
user.save
exit
現(xiàn)在你可以訪問http://localhost
來訪問GitLab服務(wù),并使用admin
賬戶和password
密碼進(jìn)行登錄。注意,這種方式不安全,不建議在生產(chǎn)環(huán)境中使用。文章來源地址http://www.zghlxwxcb.cn/news/detail-709392.html
到了這里,關(guān)于沒有外網(wǎng)的麒麟系統(tǒng)上搭建GitLab服務(wù)并且無需客戶端賬號(hào)密碼驗(yàn)證的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!