摘自官方文档,由于官方网站太难访问,留存以备用:
标签归档:gitlab
gitlab-ce root 密码修改
How to reset your root password
Log into your server with root privileges. Then start a Ruby on Rails console.
Start the console with this command:
gitlab-rails console production
Wait until the console has loaded.
There are multiple ways to find your user. You can search for email or username.
user = User.where(id: 1).first
or
user = User.find_by(email: 'admin@local.host')
Now you can change your password:
user.password = 'secret_pass'
user.password_confirmation = 'secret_pass'
It's important that you change both password and password_confirmation to make it work.
Don't forget to save the changes.
user.save!
Exit the console and try to login with your new password.
GitLab 8 升级 GitLab 10 注意事项
本文主要说明使用 yum 仓库升级 GitLab 所需要注意的事项。
若直接使用 yum update gitlab-ce
会提示先让你升级 PostgreSQL 数据库,但是 PostgreSQL 数据库是 GitLab 自动安装的,无法使用 yum 进行升级,该怎么办呢?
如何访问 GitLab 默认安装的 PostgreSQL 数据库
简述
当通过Omnibus方式安装GitLab后,运行起来的默认是PostgreSQL数据库,并且使用内置的用户名密码,虽然增加了安全性,但对于用户对数据库的访问造成了一定的困难。下面就来说说如何访问GitLab默认安装的PostgreSQL。
GitLab 接入 OpenLDAP 配置
操作系统:CentOS6.8
操作账户:root
安装GitLab CE
创建或编辑 /etc/yum.repos.d/gitlab-ce.repo
,填入以下内容:
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
执行命令安装:
yum makecache
yum install gitlab-ce
安装依赖并启动 Postfix :
service postfix start
chkconfig postfix on
lokkit -s http -s ssh
启动 Gitlab CE :
gitlab-ctl reconfigure
gitlab-ctl start
访问 Gitlab CE :
# 默认80端口
http://IP/
GitLab 数据备份与恢复
GitLab 备份
# 可以将此命令写入crontab,以实现定时备份
/usr/bin/gitlab-rake gitlab:backup:create
备份的数据会存储在 /var/opt/gitlab/backups
,除非用户在 gitlab_rails['backup_path']
另行设定:
[root@hzz ~]# ls -l /var/opt/gitlab/backups
total 24667228
-rw------- 1 git git 12384215040 Oct 19 12:39 1476851754_gitlab_backup.tar
-rw------- 1 git git 506798080 Oct 19 12:43 1476852184_gitlab_backup.tar
-rw------- 1 git git 12368209920 Oct 20 02:17 1476900742_gitlab_backup.tar