centos安装gitlab
#
准备yum install -y curl openssh-server openssh-clients cronie lokkitlokkit -s http -s ssh
#
安装 postfixyum install postfixservice postfix startchkconfig postfix on
#
安装Gitlabcurl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bashyum install -y gitlab-ce
#
修改默认端口vi /etc/gitlab/gitlab.rb
nginx['listen_port'] = 8091
#
配置 https使用 acme.sh 生成证书
external_url 'https://git.xxx.com'nginx['ssl_certificate'] = "/etc/nginx/ssl/fullchain.cer"nginx['ssl_certificate_key'] = "/etc/nginx/ssl/git.xxx.com.key"
#
应用配置gitlab-ctl reconfigure
#
启动gitlab-ctl start
#
重启gitlab-ctl restart
#
配置系统 nginx 端口转发location / { proxy_pass https://localhost:8091; proxy_redirect default;}
#
汉化# 声明版本变量gitlab_version=$(sudo cat /opt/gitlab/embedded/service/gitlab-rails/VERSION)
# 进入克隆仓库git clone https://gitlab.com/xhang/gitlab.git ~/gitlab-zhcd ~/gitlab-zh
# 导出汉化补丁git diff v${gitlab_version} v${gitlab_version}-zh > ${gitlab_version}-zh.diff
# 停止 gitlabsudo gitlab-ctl stop
#安装 patchyum install patch -y
# 应用补丁sudo patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 ${gitlab_version}-zh.diff
# 重新配置并启动 gitlabgitlab-ctl reconfiguregitlab-ctl restart
#
配置 smtp 邮件vi /etc/gitlab/gitlab.rb # Change the external_url to the address your users will type in their browserexternal_url 'http://xxhost.com'
#Sending application email via SMTPgitlab_rails['smtp_enable'] = truegitlab_rails['smtp_address'] = "smtp.163.com"gitlab_rails['smtp_port'] = 25 gitlab_rails['smtp_user_name'] = "[email protected]"gitlab_rails['smtp_password'] = "xxpassword"gitlab_rails['smtp_domain'] = "163.com"gitlab_rails['smtp_authentication'] = :logingitlab_rails['smtp_enable_starttls_auto'] = true
##修改gitlab配置的发信人gitlab_rails['gitlab_email_from'] = "[email protected]"user["git_user_email"] = "[email protected]"