Commit aee110e20dd81861a62ea458b5629619c32a2d0a

Authored by Dmitriy Zaporozhets
1 parent 5bd5d09b

Add extra config for some advanced customization

app/helpers/application_helper.rb
... ... @@ -37,7 +37,7 @@ module ApplicationHelper
37 37 if !Gitlab.config.gravatar.enabled || user_email.blank?
38 38 'no_avatar.png'
39 39 else
40   - gravatar_url = request.ssl? || Gitlab.config.gitlab.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
  40 + gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
41 41 user_email.strip!
42 42 sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size
43 43 end
... ... @@ -196,4 +196,14 @@ module ApplicationHelper
196 196  
197 197 [namespace, controller.controller_name, controller.action_name].compact.join(":")
198 198 end
  199 +
  200 + # shortcut for gitlab config
  201 + def gitlab_config
  202 + Gitlab.config.gitlab
  203 + end
  204 +
  205 + # shortcut for gitlab extra config
  206 + def extra_config
  207 + Gitlab.config.extra
  208 + end
199 209 end
... ...
config/gitlab.yml.example
... ... @@ -73,8 +73,6 @@ production: &base
73 73 # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
74 74 # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
75 75  
76   -
77   -
78 76 #
79 77 # 2. Auth settings
80 78 # ==========================
... ... @@ -157,6 +155,19 @@ production: &base
157 155 # Git timeout to read a commit, in seconds
158 156 timeout: 10
159 157  
  158 + #
  159 + # 4. Extra customization
  160 + # ==========================
  161 +
  162 + extra:
  163 + ## Google analytics. Uncomment if you want it
  164 + # google_analytics_id: '_your_tracking_id'
  165 +
  166 + ## Text under sign-in page (Markdown enabled)
  167 + # sign_in_text: |
  168 + # ![Company Logo](http://www.companydomain.com/logo.png)
  169 + # [Learn more about CompanyName](http://www.companydomain.com/)
  170 +
160 171 development:
161 172 <<: *base
162 173  
... ...
config/initializers/1_settings.rb
... ... @@ -106,3 +106,8 @@ Settings.git[&#39;timeout&#39;] ||= 10
106 106  
107 107 Settings['satellites'] ||= Settingslogic.new({})
108 108 Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root)
  109 +
  110 +#
  111 +# Extra customization
  112 +#
  113 +Settings['extra'] ||= Settingslogic.new({})
... ...