gitlab-ee安装与配置

目的

本文介绍如何安装gitlab企业版(Enterprise Edtion)

环境

Linux Mint 21.3

添加GPG公钥

1
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

创建/etc/apt/source.list.d/gitlab.ee.list,添加配置文件

1
deb https://mirror.nju.edu.cn/gitlab-ee/ubuntu jammy main

安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
sudo apt update
sudo apt upgrade
sudo apt install gitlab-ee

Creating config file /etc/ssh/sshd_config with new version
Creating SSH2 RSA key; this may take some time ...
3072 SHA256:1iN0HfupBGwI8NkmBmw9dCaOZ3UltA6zQG3d7Wph10s root@hyper-gitlab (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:wntbBzkjDqi5uKOT6TAFZGEnmUhtZ7GNaTEyU/isBQk root@hyper-gitlab (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:eDftFXwUj92iBjVTu9uQeqOynORSBE5YFaI58PexM94 root@hyper-gitlab (ED2551
9)
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.servi
ce.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/s
ystemd/system/ssh.service.
rescue-ssh.target is a disabled or a static unit, not starting it.
ssh.socket is a disabled or a static unit, not starting it.
Setting up ssh-import-id (5.11-0ubuntu1) ...
Setting up gitlab-ee (17.0.1-ee.0) ...
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 min
ute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnib
us&release=17-0

Setting up ncurses-term (6.3-2ubuntu0.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for ufw (0.36.1-4ubuntu0.1) ...

2024.05.24 17.0.1安装包大约为1G

配置

按照安装提示,编辑/etc/gitlab/gitlab.rb,修改

1
external_url 'http://127.0.0.1'

然后执行自动配置

1
sudo gitlab-ctl reconfigure

大概需要一两分钟

使用

打开浏览器,输入配置的网址http://127.0.0.1/

进入登录页面

登录

用户名为root

获取密码

1
2
3
4
5
6
7
8
9
10
cat /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
# 1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
# 2. Password hasn't been changed manually, either via UI or via command line.
#
# If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: peY3JuGNGxPun/YKdUvLzRVikqQ6/ijxzH6eDNS+4nU=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

初始密码有效期24小时。最好更换密码

汉化

这是个问题

命令

1
2
3
gitlab-ctl start/stop/restart/status/tail 
gitlab-rake gitlab:backup:create #备份数据
gitlab-rake gitlab:env:info #版本信息

gitlab-ee安装与配置
https://blog.jackeylea.com/gitlab/how-to-install-gitlab-under-linux/
作者
JackeyLea
发布于
2024年6月5日
许可协议