安装极狐GitLab(ubuntu)----写给不爱看官方文档的人

极狐gitlab开机自启 极狐 gitlab_运维

1.安装和配置必要的依赖项

sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl

(可选)下一步,安装 Postfix 以发送电子邮件通知。如果您想使用其他解决方案发送电子邮件,请跳过此步骤并在安装极狐GitLab 后配置外部 SMTP 服务器

sudo apt-get install -y postfix

在安装 Postfix 的过程中可能会出现一个配置界面,在该界面中选择“Internet Site”并按下回车。把“mail name”设置为您服务器的外部 DNS 域名并按下回车。如果还有其它配置界面出现,继续按下回车以接受默认配置。

  • 选择站点
  • 填写自己的邮箱后缀域名比如我的是azang.com

回车继续

2.下载极狐GitLab 安装包并安装极狐GitLab

下载极狐GitLab 安装包。

# Ubuntu 16.04 
wget https://omnibus.gitlab.cn/ubuntu/xenial/gitlab-jh_14.6.1-jh.0_amd64.deb

# Ubuntu 18.04 
wget https://omnibus.gitlab.cn/ubuntu/bionic/gitlab-jh_14.6.1-jh.0_amd64.deb

# Ubuntu 20.04
wget https://omnibus.gitlab.cn/ubuntu/focal/gitlab-jh_14.6.1-jh.0_amd64.deb

接下来,安装极狐GitLab。确保您已正确设置您的 DNS,并更改 https://gitlab.example.com 为您要访问极狐GitLab 实例的 URL。安装包将在该 URL 上自动配置和启动极狐GitLab。

建议将极狐GitLab 实例的域名以环境变量的形式注入(请将命令中 URL 替换为您要访问极狐GitLab 实例的 URL):

此处我没有ssl所以我暂时使用http之后会有文章写如何修改

# 官方例子
export EXTERNAL_URL=https://gitlab.example.com

# 因为我没有ssl所以没有办法直接配置https所以我用的是下面的要根据自己的域名进行修改
export EXTERNAL_URL=http://gitlab.azang.com

对于 https 站点,极狐GitLab 将使用 Let’s Encrypt 自动请求 SSL 证书,这需要有效的主机名和入站 HTTP 访问。您也可以使用自己的证书或仅使用 http://(不带s)。

如果您想为初始管理员用户(root)指定自定义密码,请查看文档。如果未指定密码,将自动生成随机密码。

接着执行如下命令开始安装:

sudo dpkg -i gitlab-jh_14.6.1-jh.0_amd64.deb

极狐gitlab开机自启 极狐 gitlab_运维_02

看到这个就是安装完成了然后看一下对应的下面的话,如果你没有的话可以直接访问你之前设置的域名并且进行,标签3[3. 访问极狐GitLab 实例并登录]内容

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=14-6

译:

感谢您安装GitLab!
GitLab无法检测实例的有效主机名。
请通过设置 “外部URL” 为GitLab实例配置URL
在/etc/gitlab.rb文件中配置。
然后,您可以通过运行以下命令来启动GitLab实例:

sudo gitlab-ctl reconfigure

有关配置选项的完整列表,请参阅Omnibus GitLab自述文件
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md 帮助我们改善安装体验,让我们知道我们如何进行1分钟的调查:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=14-6

所以这里就要执行两个shell

# 这里要注意http和https
  export EXTERNAL_URL=http://[你的域名]
  sudo gitlab-ctl reconfigure

接下来就是漫长的等待之后会看到

Running handlers:
Running handlers complete
Chef Infra Client finished, 570/1553 resources updated in 05 minutes 43 seconds
Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn’t opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.
NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
正在运行的处理程序:
运行处理程序完成
大厨基础设施客户完成,570/1553个资源在05分43秒内更新
注意:
默认管理员帐户已配置为以下详细信息:
用户名: 根
密码: 您没有选择将初始根密码打印到STDOUT。
存储到/etc/gitlab/initial_root_password的密码。该文件将在24小时后的首次重新配置运行中被清除。
注意: 由于这些凭据可能以纯文本形式存在于日志文件中,因此强烈建议在https://docs.gitlab.com/ee/security/ reset_user_password.html # reset-your-root-password之后重置密码。

3. 访问极狐GitLab 实例并登录

除非您在安装过程中指定了自定义密码,否则将随机生成一个密码并存储在 /etc/gitlab/initial_root_password 文件中(出于安全原因,24 小时后,此文件会被第一次 gitlab-ctl reconfigure 自动删除,因此若使用随机密码登录,建议安装成功初始登录成功之后,立即修改初始密码)。使用此密码和用户名 root 登录。

有关安装和配置的详细说明,请参阅我们的文档

4. 后续配置

完成安装后,请参考建议的后续配置,包括身份验证选项和注册限制的配置。

最后附上官网教程地址