在系统已经存在postgres时,安装gitlab

以下作废,感觉直接装gitlab太不稳定了,现在转而使用dockers安装gitlab

https://cloud.tencent.com/developer/article/2309562
https://www.cnblogs.com/lvzhenjiang/p/14949722.html
https://cloud.tencent.com/developer/article/2256871
https://blog.csdn.net/chaircat/article/details/107985127

user = User.find_by(username: 'root')
user.password = '*****’
user.password_confirmation = '*****’
user.confirmed_at = Time.now
user.save!

https://about.gitlab.com/install/#ubuntu

1、下载 

https://packages.gitlab.com/app/gitlab/gitlab-ce/search?q=&filter=debs&dist=

2、安装

sudo EXTERNAL_URL="http://xx.xx.xx.xx:xxxx" dpkg -i gitlab-ce_17.0.2-ce.0_amd64.deb

3、postgres数据库配置

Gitlab-5.配置外部PostgreSQL_gitlab 禁用postgresql-CSDN博客

https://www.cnblogs.com/linkenpark/p/8359216.html

sudo -s -u postgres#登录postgres
psql
create user gitlab with password 'gitlab';#创建用户
create database gitlabhq_production OWNER gitlab;#创建数据库
GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production TO gitlab;#赋予权限
sudo -u postgres psql -c 'SHOW unix_socket_directories;'#查看socket地址

 4、gitlab配置

vim /etc/gitlab/gitlab.rb
EXTERNAL_URL="http://xx.xx.xx.xx:xxx"
postgresql['enable'] = false#关闭gitlab自带postgresql
gitlab_rails[db_username’] = “gitlab”#设置postgresql用户名
gitlab_rails[db_password’] = “gitlab”#设置postgresql密码
postgresql['dir']" ="/var/run/postresql"#修改postgresql的socket地址
puma[‘port’] = 3333#修改puma端口
githlab_workhorse['auth_backend'] = "http://localhost:3333"
sudo gitlab-ctl reconfigure#重新配置
sudo gitlab-ctl restart #重启
sudo gitlab-rails dbconsole#查看数据连接情况

#以防万一,可以将某些权限打开
cd /var/opt/gitlab
sudo chmod 777 -R *
cd /opt/gitlab
sudo chmod 777 -R *

 5、如果忘了密码,重置root密码

重置gitlab root初始密码_gitlab修改初始密码-CSDN博客

sudo gitlab-rails console -e production
user = User.find_by(username: 'root')
user.password = 'xxxx'
user.password_confirmation = 'xxxx'
user.save!

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值