Commit c2ad1ab12a06996829f67452124ebd7cf9735ba9

Authored by Julien Pivotto
1 parent 3b7ffb35

Fix default gravatar configuration. Fixes #112.

CHANGELOG
... ... @@ -3,6 +3,7 @@
3 3 - Fix default Postgres port for non-packaged DBMS (Drew Blessing)
4 4 - Add migration instructions coming from an existing GitLab installation (Goni Zahavy)
5 5 - Add a gitlab.yml conversion support script
  6 +- Correct default gravatar configuration (#112) (Julien Pivotto)
6 7  
7 8 6.8.1
8 9 - Use gitlab-rails 6.8.1
... ...
files/gitlab-cookbooks/gitlab/definitions/template_symlink.rb
... ... @@ -15,13 +15,14 @@
15 15 # limitations under the License.
16 16 #
17 17  
18   -define :template_symlink, :link_from => nil, :source => nil, :owner => nil, :group => nil, :mode => nil, :variables => nil, :notifies => nil, :restarts => [] do
  18 +define :template_symlink, :link_from => nil, :source => nil, :owner => nil, :group => nil, :mode => nil, :variables => nil, :helpers => nil, :notifies => nil, :restarts => [] do
19 19 template params[:name] do
20 20 source params[:source]
21 21 owner params[:owner]
22 22 group params[:group]
23 23 mode params[:mode]
24 24 variables params[:variables]
  25 + helpers *params[:helpers] if params[:helpers]
25 26 notifies *params[:notifies] if params[:notifies]
26 27 params[:restarts].each do |resource|
27 28 notifies :restart, resource
... ...
files/gitlab-cookbooks/gitlab/libraries/helper.rb
... ... @@ -83,3 +83,11 @@ class OmnibusHelper
83 83 end
84 84  
85 85 end
  86 +
  87 +module SingleQuoteHelper
  88 +
  89 + def single_quote(string)
  90 + "'#{string}'" if not string.nil?
  91 + end
  92 +
  93 +end
... ...
files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb
... ... @@ -77,6 +77,7 @@ end
77 77 template_symlink File.join(gitlab_rails_etc_dir, "gitlab.yml") do
78 78 link_from File.join(gitlab_rails_source_dir, "config/gitlab.yml")
79 79 source "gitlab.yml.erb"
  80 + helpers SingleQuoteHelper
80 81 owner "root"
81 82 group "root"
82 83 mode "0644"
... ...
files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb
... ... @@ -107,8 +107,8 @@ production: &base
107 107 ## Gravatar
108 108 gravatar:
109 109 enabled: <%= @gravatar_enabled %> # Use user avatar image from Gravatar.com (default: true)
110   - plain_url: "<%= @gravatar_plain_url %>" # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
111   - ssl_url: "<%= @gravatar_ssl_url %>" # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
  110 + plain_url: <%= single_quote(@gravatar_plain_url) %> # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
  111 + ssl_url: <%= single_quote(@gravatar_ssl_url) %> # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
112 112  
113 113 #
114 114 # 2. Auth settings
... ...