没有外网的麒麟系统上搭建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密码进行登录。注意,这种方式不安全,不建议在生产环境中使用。

相关推荐
爱宇阳16 小时前
GitLab CI/CD 集成 Harbor 全面教程
ci/cd·gitlab·harbor
雪碧聊技术16 小时前
gitLab如何新建分支(根据某个分支)
gitlab·new branch·新建分支
字节逆旅1 天前
如何解决代码冲突
gitlab
林晓lx2 天前
使用Git钩子+ husky + lint语法检查提高前端项目代码质量
前端·git·gitlab·源代码管理
爱宇阳2 天前
从容器化到自动化:Vue3 项目 Docker 部署与 GitLab CI/CD 集成 Harbor 全流程
docker·自动化·gitlab
爱宇阳2 天前
Spring Boot 项目 GitLab CI/CD 自动构建并推送到 Harbor 教程
spring boot·ci/cd·gitlab
爱宇阳2 天前
Vue3 项目 GitLab CI/CD 自动构建并推送到 Harbor 教程
ci/cd·gitlab
西部森林牧歌3 天前
Arbess零基础学习 - 使用Arbess+GitLab实现Node.js项目自动化构建/主机部署
ci/cd·node.js·gitlab·arbess·tiklab devops
极小狐4 天前
极狐GitLab 18.5 正式发布,更新 Maven 虚拟仓库 UI(Beta)、全新个人主页、实例级合规与安全策略管理 以及 DAST 认证脚本 等
java·gitlab·maven
维尔切5 天前
GitLab 版本控制系统
gitlab