没有外网的麒麟系统上搭建GitLab服务并且无需客户端账号密码验证

要在没有外网的麒麟系统上搭建GitLab服务并且无需客户端账号密码验证,可以按照以下步骤进行操作:

  1. 安装必要的依赖包和软件
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

  1. 安装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

  1. 下载并安装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

  1. 配置GitLab

打开GitLab配置文件并做出如下修改:

sudo vim /etc/gitlab/gitlab.rb

external_url配置为:

external_url 'http://localhost:80'

去掉nginx配置:

nginx['enable'] = false

添加GitLab监听所有本地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

保存文件并退出。

  1. 重新配置并启动GitLab
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

  1. 创建并添加管理员账户
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

现在你可以访问http://localhost来访问GitLab服务,并使用admin账户和password密码进行登录。注意,这种方式不安全,不建议在生产环境中使用。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值