centos 7 部署 汉化版 gitlab 11.4.14

gitlab   gitlab汉化  

部署社区版gitlab

  • 安装gitlab的依赖项
yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python  
  • 启动postfix,并设置为开机启动
systemctl start postfix  
systemctl enable postfix  
  • 设置防火墙
firewall-cmd --add-service=http --permanent  
firewall-cmd --reload  
  • 获取rpm包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.4.14-ce.0.el7.x86_64.rpm  
  • 安装RPM包
rpm -i gitlab-ce-11.4.14-ce.0.el7.x86_64.rpm  
  • 根据提示
gitlab-ctl reconfigure  
  • 修改配置文件gitlab.rb
external_url 'http://gitlab.imdst.com'  
  • 重载配置
```
gitlab-ctl reconfigure  
gitlab-ctl restart  
  • 查看gitlab版本
head -1 /opt/gitlab/version-manifest.txt  

覆盖汉化包

  • 下载汉化包 https://gitlab.com/xhang
wget https://gitlab.com/xhang/gitlab/-/archive/11-4-stable-zh/gitlab-11-4-stable-zh.zip  
  • 解压覆盖
unzip gitlab-11-4-stable-zh.zip  
cd gitlab-11-4-stable-zh  
cp -r /opt/gitlab/embedded/service/gitlab-rails{,.ori}   #备份  
\cp -fr  *  /opt/gitlab/embedded/service/gitlab-rails/
  • 重载配置
```
gitlab-ctl reconfigure  
gitlab-ctl restart  

Nginx配置

server {  
    listen 80;
    server_name  gitlab.imdst.com;
    index index.html index.htm index.php;
    access_log /data/logs/gitlab.imdst.com.acc.log access;
    error_log /data/logs/gitlab.imdst.com.err.log;
    location ~ ^/(assets)/  {
       root /opt/gitlab/embedded/service/gitlab-rails/public;
       expires max;
       add_header Cache-Control public;
    } 
    location / {
      proxy_pass http://127.0.0.1:8080;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_redirect off;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Host $server_name;
   }
}

登陆

  • 首次登陆提示修改密码
  • 使用root登陆

邮件配置

  • 邮件配置
gitlab_rails['smtp_enable'] = true  
gitlab_rails['smtp_address'] = "smtp.163.com"  
gitlab_rails['smtp_port'] = 25  
gitlab_rails['smtp_user_name'] = "aaa@163.com"  
gitlab_rails['smtp_password'] = "dfasfasdfdsfa"  
gitlab_rails['smtp_domain'] = "163.com"  
gitlab_rails['smtp_authentication'] = "login"  
gitlab_rails['smtp_enable_starttls_auto'] = true  
gitlab_rails['smtp_tls'] = false  
### Email Settings
gitlab_rails['gitlab_email_enabled'] = true  
gitlab_rails['gitlab_email_from'] = 'aaa@163.com'  
gitlab_rails['gitlab_email_display_name'] = 'aaa'  
gitlab_rails['gitlab_email_reply_to'] = 'aaa@163.com'  
gitlab_rails['gitlab_email_subject_suffix'] = 'gitlab'  
# gitlab_rails['admin_email_worker_cron'] = "0 0 * * 0"
  • 测试发邮件
gitlab-rails console  
-------------------------------------------------------------------------------------
 GitLab:       11.4.14 (c69471c)
 GitLab Shell: 8.3.3
 postgresql:   9.6.8
-------------------------------------------------------------------------------------
Loading production environment (Rails 4.2.10)  
irb(main):001:0> Notify.test_email('leoiceo@qq.com', 'Message Subject', 'Message Body').deliver_now