内网安装GitLab

devtools/2024/9/30 0:31:14/

内网安装GitLab

为什么安装GitLab

GitHub(国外)和Gitee(国内)都是第三方托管平台,不能本地部署,对公网开放,代码保密性不高。

为代码保密性,需在内网搭建代码管理平台。有web操作页面,所以选择GitLab。

下载

地址:https://packages.gitlab.com/gitlab/gitlab-ee

【注意】:el/7,el/8,el/9 分别对应centos7、8、9,不同服务器操作系统下载不同的安装包

image-20240611154405541

依赖安装

#安装相关依赖
sudo yum install -y curl policycoreutils openssh-server openssh-clients
#启动ssh服务、设置为开机自启动
sudo systemctl enable sshd
sudo systemctl start sshd
#安装postfix以发送邮件通知
sudo yum install -y postfix
#启动postfix服务、设置为开机自启动
sudo systemctl enable postfix
sudo systemctl start postfix
#开放http服务、重启防火墙
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

安装GitLab

上传下载的rpm包,或者curl、wget下载的包

# 安装
rpm -ivh gitlab-ee-16.10.6-ee.0.el7.x86_64.rpm

安装成功后输入以下信息

[root@localhost gitlab]# rpm -ivh gitlab-ee-16.10.6-ee.0.el9.x86_64.rpm 
警告:gitlab-ee-16.10.6-ee.0.el9.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f27eab47: NOKEY
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...1:gitlab-ee-16.10.6-ee.0.el9       ################################# [100%]
It looks like GitLab has not been configured yet; skipping the upgrade script.*.                  *.***                 ********               *****.******             ***************            ********,,,,,,,,,***********,,,,,,,,,,,,,,,,,,,,*********,,,,,,,,,,,.,,,,,,,,,,,*******,,,,,,,,,,,,,,,,,,,,,*****,,,,,,,,,.,,,,,,,****,,,,,,.,,,***,,,,,*,._______ __  __          __/ ____(_) /_/ /   ____ _/ /_/ / __/ / __/ /   / __ `/ __ \/ /_/ / / /_/ /___/ /_/ / /_/ /\____/_/\__/_____/\__,_/_.___/Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:sudo gitlab-ctl reconfigureFor a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.mdHelp us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=16-10

修改Gitlab配置

vi /etc/gitlab/gitlab.rb
#修改以下内容:
external_url 'http://gitlab.example.com'
#更改 https://gitlab.example.com 为要访问极狐GitLab实例的URL
external_url 'http://ip' # f#重新加载配置
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
#开放指定端口(注意80端口被占用)
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

修改root密码

#重置管理员登录密码
su - git        #切换用户
gitlab-rails console -e production  #进入GitLab控制台
user = User.where(id: 1).first      #查询gitlab超级管理员信息,超级管理员用户默认是1
user.password='12345678'        #修改密码
user.save!      #保存用户对象
exit        #退出控制台#登录默认端口80
http://id:80

image-20240611163912533

修改语言为中文

image-20240611164246392

从GitHub等第三方当代码仓库,


http://www.ppmy.cn/devtools/104946.html

相关文章

力扣(俄罗斯套娃信封问题)

354. 俄罗斯套娃信封问题 给你一个二维整数数组 envelopes ,其中 envelopes[i] [wi, hi] ,表示第 i 个信封的宽度和高度。 当另一个信封的宽度和高度都比这个信封大的时候,这个信封就可以放进另一个信封里,如同俄罗斯套娃一样。…

js处理echarts tooltip定时轮播

echarts tooltip定时轮播 /*** echarts tooltip轮播* param chart ECharts实例* param chartOption echarts的配置信息* param options object 选项* {* interval 轮播时间间隔,单位毫秒,默认为3000* true表示循环所有series的tooltip…

MySQL——事务与存储过程(一)事务管理(1)事务的概念

事务处理机制在程序开发过程中有着非常重要的作用,它可以使整个系统更加安全,保证在同一个事务中的操作具有同步性。 现实生活中,人们经常会进行转账操作,转账可以分为两部分来完成,转人和转出,只有这两个部…

Mybatis链路分析:JDK动态代理和责任链模式的应用

背景 此前写过关于代理模式的文章,参考:代理模式 动态代理功能:生成一个Proxy代理类,Proxy代理类实现了业务接口,而通过调用Proxy代理类实现的业务接口,实际上会触发代理类的invoke增强处理方法。 责任链功…

BOOTSTRAP VUE快速使用

步骤 1&#xff1a;安装 Bootstrap npm install bootstrap步骤 2&#xff1a;导入 Bootstrap import bootstrap使用组件 <buttoon type button classbtn btn-primary>

OpenCV 模板匹配教程

OpenCV 模板匹配教程 模板匹配是一种计算机视觉技术&#xff0c;用于在更大的图像&#xff08;源图像&#xff09;中查找较小的子图像&#xff08;模板图像&#xff09;。OpenCV 提供了多种模板匹配的方法&#xff0c;允许我们检测源图像中与模板最相似的位置。在本教程中&…

【3.6】贪心算法-解救生艇问题

一、题目 第 i 个人的体重为 people[i]&#xff0c;每艘船可以承载的最大重量为 limit。 每艘船最多可同时载两人&#xff0c;但条件是这些人的重量之和最多为 limit 。 返回载到每一个人所需的最小船数。(保证每个人都能被船载)。 二、解题思路 题目要求每艘船最多能载两人&…

单窗口IP代理设置指南:轻松搞定

在现代互联网生活中&#xff0c;IP代理已经成为了许多人日常上网的必备工具。单窗口IP代理是一种非常实用的代理方式&#xff0c;它允许你在同一个浏览器中为不同的窗口设置不同的IP地址&#xff0c;从而更好地保护隐私和实现多任务处理。今天&#xff0c;我们就来详细讲解一下…