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

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

  1. 安装必要的依赖包和软件
shell 复制代码
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的依赖工具
shell 复制代码
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
shell 复制代码
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配置文件并做出如下修改:

shell 复制代码
sudo vim /etc/gitlab/gitlab.rb

external_url配置为:

shell 复制代码
external_url 'http://localhost:80'

去掉nginx配置:

shell 复制代码
nginx['enable'] = false

添加GitLab监听所有本地IP地址:

shell 复制代码
web_listen_address = '0.0.0.0'
web_listen_port = 80

允许HTTP访问:

shell 复制代码
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
shell 复制代码
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
  1. 创建并添加管理员账户
shell 复制代码
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密码进行登录。注意,这种方式不安全,不建议在生产环境中使用。

相关推荐
krb___1 天前
python拉取gitlab项目以及拉取报错处理
gitlab
dami_king3 天前
新手怎么使用GitLab?
运维·git·svn·云原生·gitlab·github
linyb极客之路3 天前
聊聊gitlab ci如何构建以时间为版本号的docker镜像
ci/cd·docker·gitlab
大海里的番茄4 天前
公网环境使用Potplayer远程访问家中群晖NAS搭建的WebDAV听歌看电影
gitlab·ruby
奇遇少年5 天前
代码托管服务:GitHub、GitLab、Gitee
gitee·gitlab·github
白如意i5 天前
在Ubuntu 16.04上安装和配置GitLab的方法
linux·ubuntu·gitlab
kuuuugua6 天前
2024广东省职业技能大赛云计算赛项实战——集群部署GitLab Runner
ci/cd·容器·云计算·k8s·gitlab
kuuuugua6 天前
2024广东省职业技能大赛云计算赛项实战——集群部署GitLab Agent
运维·ci/cd·容器·云计算·k8s·gitlab
鹏大师运维6 天前
国产操作系统上netstat命令详解 _ 统信 _ 麒麟 _ 中科方德
linux·网络·麒麟·国产操作系统·netstat·统信·kylinos
桃花源小王子7 天前
【Linux】部署 GitLab 服务
linux·运维·gitlab