Gitlab

Gitlab

gitlab的部署

//安装git和依赖包
[root@node3 ~]#  yum -y install epel-release git curl openssh-server openssh-clients postfix cronie  //
[root@node3 ~]#wget http://mirror.centos.org/centos/7/os/x86_64/Packages/policycoreutils-python-2.5-34.el7.x86_64.rpm

//处理依赖包关系
[root@node3 ~]#dnf -y remove policycoreutils-python-utils-2.9-18.el8.noarch 
[root@node3 ~]#dnf -y remove policycoreutils
[root@node3 ~]#rpm -ivh --nodeps policycoreutils-python-2.5-34.el7.x86_64.rpm 
[root@node3 ~]# ls
anaconda-ks.cfg                       policycoreutils-python-2.5-34.el7.x86_64.rpm
gitlab-ce-15.2.2-ce.0.el7.x86_64.rpm

//启动postfix服务并设置开机自启
[root@node3 ~]# systemctl restart postfix
[root@node3 ~]# systemctl enable postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.

//安装
[root@node3 ~]# rpm -ivh gitlab-ce-15.2.2-ce.0.el7.x86_64.rpm
warning: gitlab-ce-15.2.2-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:gitlab-ce-15.2.2-ce.0.el7        ################################# [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 reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help 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=15-2



[root@node3 ~]# vim /etc/gitlab/gitlab.rb //修改配置文件
external_url 'http://192.168.143.130'  //将此处设为gitlab的服务器ip地址亦或域名


/重载配置文件并重启gitlab
[root@node3 ~]# gitlab-ctl reconfigure
[root@node3 ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 2193) 1s
ok: run: gitaly: (pid 2202) 0s
ok: run: gitlab-exporter: (pid 2434) 0s
ok: run: gitlab-kas: (pid 2436) 0s
ok: run: gitlab-workhorse: (pid 2444) 1s
ok: run: logrotate: (pid 2454) 0s
ok: run: nginx: (pid 2460) 0s
ok: run: node-exporter: (pid 2465) 1s
ok: run: postgres-exporter: (pid 2471) 0s
ok: run: postgresql: (pid 2479) 1s
ok: run: prometheus: (pid 2492) 0s
ok: run: puma: (pid 2502) 1s
ok: run: redis: (pid 2507) 0s
ok: run: redis-exporter: (pid 2513) 0s
ok: run: sidekiq: (pid 2521) 0s




效果

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-EmGc9wer-1660177581143)(C:\Users\Admin\AppData\Roaming\Typora\typora-user-images\1660143384624.png)]

破解密码

[root@node3 ~]# gitlab-rails console -e  production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
 GitLab:       15.2.2 (4ecb014a935) FOSS
 GitLab Shell: 14.9.0
 PostgreSQL:   13.6
------------------------------------------------------------[ booted in 29.21s ]
Loading production environment (Rails 6.1.4.7)
irb(main):001:0> user = User.where(id: 1).first  //id为1的是超级管理员
=> #<User id:1 @root>
irb(main):002:0> user.password = '88888888'   //密码必须至少8个字符
=> "88888888"
irb(main):003:0> user.password_confirmation = '88888888'   //确认密码
=> "88888888"
irb(main):004:0> user.save!  保存修改,若无问题将返回true
=> true  
irb(main):005:0> exit  //退出

在这里插入图片描述

成功登陆

save! 保存修改,若无问题将返回true
=> true
irb(main):005:0> exit //退出

成功登陆
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值