手机版
你好,游客 登录 注册
背景:
阅读新闻

GitLab 升级到5.0的严重注意事项

[日期:2013-04-24] 来源:Linux社区  作者:sheismylife [字体:大 中 小]

第四步,让gitlab-shell访问本地gitlab server的REST API时禁止启用SSL证书

参考这个帖子:https://github.com/gitlabhq/gitlabhq/issues/3292

so i had to add string not to check certificate at /home/git/gitlab-shell/lib/gitlab_net.rb
from:

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = (url.port == 443)
request = Net::HTTP::Get.new(url.request_uri)
http.start {|http| http.request(request) }
to:
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = (url.port == 443)
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl?
request = Net::HTTP::Get.new(url.request_uri)
http.start {|http| http.request(request) }

我这里不交代如何在Nginx中设置SSL证书。

第五步,Nginx中的gitlab配置, 也许对大家有用,仅供参考:

File Edit Options Buffers Tools Help
# GITLAB
# Maintainer: @randx
# App Version: 4.0

upstream gitlab {
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
}

server {
listen *:443; # e.g., listen 192.168.1.1:80;
ssl on;
ssl_certificate /etc/nginx/sites-available/server.crt;
ssl_certificate_key /etc/nginx/sites-available/server.key;

server_name localhost;
#Ubuntu1204-dell source.myserver.com; # e.g., server_name source.example.com;
root /home/git/gitlab/public;

 

# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;

location / {
# serve static files from defined root folder;.
# @gitlab is a named location for the upstream fallback, see below
try_files $uri $uri/index.html $uri.html @gitlab;
}

# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_redirect off;

proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;

proxy_pass http://gitlab;
}
}

这样才能让

sudo -u git -H /home/git/gitlab-shell/bin/check

和

sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

检查全部通过。

并且才能解决客户端git clone 不能访问的问题。

GitLab 的详细介绍:请点这里
GitLab 的下载地址:请点这里

linux
相关资讯       Gitlab 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款