我设置了一个全新的CentOS 6.6安装程序,并将Omniubus安装程序用于Gitlab的CE。
运行 gitlab-ctl reconfigure 时出现以下错误:
================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb
================================================================================
RuntimeError
------------
External URL must include a FQDN
Cookbook Trace:
---------------
/opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb:95:in `parse_external_url'
/opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb:191:in `generate_config'
/opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb:34:in `from_file'
Relevant File Content:
----------------------
/opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb:
88:
89: def parse_external_url
90: return unless external_url
91:
92: uri = URI(external_url.to_s)
93:
94: unless uri.host
95>> raise "External URL must include a FQDN"
96: end
97: Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
98: Gitlab['gitlab_rails']['gitlab_host'] = uri.host
99: Gitlab['gitlab_rails']['gitlab_email_from'] ||= "gitlab@#{uri.host}"
100:
101: case uri.scheme
102: when "http"
103: Gitlab['gitlab_rails']['gitlab_https'] = false
104: when "https"
服务器的FQDN设置正确,我有一个外部IP。 DNS配置为FQDN指向我的外部IP。
以下是 /etc/gitlab/gitlab.rb 的内容,以防有用:
# Check and change the external_url to the address your users will type in their browser
external_url 'gitlab.thefallenphoenix.net'
gitlab_rails['gitlab_email_from'] = 'gitlab@thefallenphoenix.net'
答案 0 :(得分:72)
编辑:现在修复此问题,将http://
或https://
添加到.rb
文件中的域。使用Gitlab EE在Debian 9上进行测试。
在 gitlab.rb 中添加=
个符号。
应该是:
external_url = 'gitlab.thefallenphoenix.net'
gitlab_rails['gitlab_email_from'] = 'gitlab@thefallenphoenix.net'
之后它应该安装好。至少它在CentOS 6.6上为我工作。
答案 1 :(得分:18)
将等号(=)添加到gitlab.rb只能暂时解决您的问题!这不是一个bug。 使用" http://example.com"而不是" example.com"实际上解决了这个问题 *如果gitlab安装正常但无法通过浏览器访问,请在网址中添加一个端口,例如" http://example.com:10080"你应该在浏览器中看到网站http://example.com:10080
答案 2 :(得分:1)
我从6.6.9升级到最新的gitlab_7.4.3-omnibus.5.1.0.ci-1_amd64.deb
只需按照
之前的升级instruction进行操作即可gitlab-ctl reconfigure
vim /opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb
99 def parse_external_url
100 return unless external_url
101
102 uri = URI("http://whatever.example.com")
//just change external_url line here
103
104 unless uri.host
105 raise "External URL must include a FQDN"
106 end
107 Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
108 Gitlab['gitlab_rails']['gitlab_host'] = uri.host
109 Gitlab['gitlab_rails']['gitlab_email_from'] ||= "gitlab@#{uri.host}"
110
111 case uri.scheme
112 when "http"
113 Gitlab['gitlab_rails']['gitlab_https'] = false
114 when "https"
115 Gitlab['gitlab_rails']['gitlab_https'] = true
116 Gitlab['nginx']['ssl_certificate'] ||= "/etc/gitlab/ssl/#{uri.host}.crt"
117 Gitlab['nginx']['ssl_certificate_key'] ||= "/etc/gitlab/ssl/#{uri.host}.key"
118 else
119 raise "Unsupported external URL scheme: #{uri.scheme}"
120 end
121
122 unless ["", "/"].include?(uri.path)
123 raise "Unsupported external URL path: #{uri.path}"
124 end
125
126 Gitlab['gitlab_rails']['gitlab_port'] = uri.port
127 end
然后再做
gitlab-ctr reconfigure
一切都好!