4

ubuntu 安装和配置 GitLab

 1 year ago
source link: https://viencoding.com/article/301
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ubuntu 安装和配置 GitLab

2021-06-14 10:31:39   Git
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/xenial/gitlab-ce_12.1.4-ce.0_amd64.deb/download.deb
dpkg -i gitlab-ce_12.1.4-ce.0_amd64.deb
*.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.

     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
vim /etc/gitlab/gitlab.rb

修改这些项

external_url 'https://域名:端口' # 访问地址(域名或ip)
......
gitlab_rails['time_zone'] = 'Asia/Shanghai'
gitlab_rails['gitlab_email_from'] = '[email protected]'
......
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "111111" # 客户端授权密码
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
......
user["git_user_email"] = "[email protected]"
gitlab-ctl reconfigure

禁用gitlab自带nginx,使用自己安装的nginx

vim /etc/gitlab/gitlab.rb
# 禁用内置NG
nginx['enable'] = false
# 指定NG的用户名
web_server['external_users'] = ['nginx']
#  添加NG地址到信任列表,我这里就是本机地址
gitlab_rails['trusted_proxies'] = ['127.0.0.1']
# 配置监听网络:tcp
gitlab_workhorse['listen_network'] = "tcp"
# 配置GitLab的地址和端口
gitlab_workhorse['listen_addr'] = "127.0.0.1:7000"
gitlab-ctl reconfigure
gitlab-ctl restart

nginx转发配置

location /gitlab {
    proxy_pass http://127.0.0.1:7000;
}

viencoding.com版权所有,允许转载,但转载请注明出处和原文链接: https://viencoding.com/article/301 欢迎小伙伴们在下方评论区留言 ~ O(∩_∩)O
文章对我有帮助, 点此请博主吃包辣条 ~ O(∩_∩)O


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK