Commit f29f23e8a048573f8cbf7dd84836f3b2812037df

Authored by Jacob Vosmaer
2 parents 29fcafd8 0b49c71b

Merge branch 'gitlab_yml' into 'master'

Gitlab Yml
files/gitlab-cookbooks/gitlab/attributes/default.rb
... ... @@ -43,18 +43,61 @@ default['gitlab']['gitlab-rails']['dir'] = "/var/opt/gitlab/gitlab-rails"
43 43 default['gitlab']['gitlab-rails']['log_directory'] = "/var/log/gitlab/gitlab-rails"
44 44 default['gitlab']['gitlab-rails']['environment'] = 'production'
45 45  
46   -default['gitlab']['gitlab-rails']['repositories_path'] = "/var/opt/gitlab/repositories"
47   -default['gitlab']['gitlab-rails']['satellites_path'] = "/var/opt/gitlab/gitlab-satellites"
48 46 default['gitlab']['gitlab-rails']['internal_api_url'] = "http://localhost:8080"
49   -default['gitlab']['gitlab-rails']['external_fqdn'] = node['fqdn']
50   -default['gitlab']['gitlab-rails']['external_port'] = 80
51   -default['gitlab']['gitlab-rails']['external_https'] = false
52   -default['gitlab']['gitlab-rails']['notification_email'] = "gitlab@#{node['fqdn']}"
53   -default['gitlab']['gitlab-rails']['support_email'] = "support@example.com"
54 47 default['gitlab']['gitlab-rails']['uploads_directory'] = "/var/opt/gitlab/uploads"
55 48 default['gitlab']['gitlab-rails']['rate_limit_requests_per_period'] = 10
56 49 default['gitlab']['gitlab-rails']['rate_limit_period'] = 60
57 50  
  51 +default['gitlab']['gitlab-rails']['gitlab_host'] = node['fqdn']
  52 +default['gitlab']['gitlab-rails']['gitlab_port'] = 80
  53 +default['gitlab']['gitlab-rails']['gitlab_https'] = false
  54 +default['gitlab']['gitlab-rails']['gitlab_email_from'] = "gitlab@#{node['fqdn']}"
  55 +default['gitlab']['gitlab-rails']['gitlab_support_email'] = "support@localhost"
  56 +default['gitlab']['gitlab-rails']['gitlab_default_projects_limit'] = 10
  57 +default['gitlab']['gitlab-rails']['gitlab_default_can_create_group'] = true
  58 +default['gitlab']['gitlab-rails']['gitlab_username_changing_enabled'] = true
  59 +default['gitlab']['gitlab-rails']['gitlab_default_theme'] = 2
  60 +default['gitlab']['gitlab-rails']['gitlab_signup_enabled'] = false
  61 +default['gitlab']['gitlab-rails']['gitlab_default_projects_features_issues'] = true
  62 +default['gitlab']['gitlab-rails']['gitlab_default_projects_features_merge_requests'] = true
  63 +default['gitlab']['gitlab-rails']['gitlab_default_projects_features_wiki'] = true
  64 +default['gitlab']['gitlab-rails']['gitlab_default_projects_features_wall'] = false
  65 +default['gitlab']['gitlab-rails']['gitlab_default_projects_features_snippets'] = false
  66 +default['gitlab']['gitlab-rails']['gitlab_default_projects_features_visibility_level'] = "private"
  67 +default['gitlab']['gitlab-rails']['issues_tracker_redmine'] = false
  68 +default['gitlab']['gitlab-rails']['issues_tracker_redmine_title'] = "Redmine"
  69 +default['gitlab']['gitlab-rails']['issues_tracker_redmine_project_url'] = "http://redmine.sample/projects/:issues_tracker_id"
  70 +default['gitlab']['gitlab-rails']['issues_tracker_redmine_issues_url'] = "http://redmine.sample/issues/:id"
  71 +default['gitlab']['gitlab-rails']['issues_tracker_redmine_new_issue_url'] = "http://redmine.sample/projects/:issues_tracker_id/issues/new"
  72 +default['gitlab']['gitlab-rails']['issues_tracker_jira'] = false
  73 +default['gitlab']['gitlab-rails']['issues_tracker_jira_title'] = "Atlassian Jira"
  74 +default['gitlab']['gitlab-rails']['issues_tracker_jira_project_url'] = "http://jira.sample/issues/?jql=project=:issues_tracker_id"
  75 +default['gitlab']['gitlab-rails']['issues_tracker_jira_issues_url'] = "http://jira.sample/browse/:id"
  76 +default['gitlab']['gitlab-rails']['issues_tracker_jira_new_issue_url'] = "http://jira.sample/secure/CreateIssue.jspa"
  77 +default['gitlab']['gitlab-rails']['gravatar_enabled'] = true
  78 +default['gitlab']['gitlab-rails']['gravatar_plain_url'] = "http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm"
  79 +default['gitlab']['gitlab-rails']['gravatar_ssl_url'] = "https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm"
  80 +default['gitlab']['gitlab-rails']['ldap_enabled'] = false
  81 +default['gitlab']['gitlab-rails']['ldap_host'] = "_your_ldap_server"
  82 +default['gitlab']['gitlab-rails']['ldap_base'] = "_the_base_where_you_search_for_users"
  83 +default['gitlab']['gitlab-rails']['ldap_port'] = 636
  84 +default['gitlab']['gitlab-rails']['ldap_uid'] = "sAMAccountName"
  85 +default['gitlab']['gitlab-rails']['ldap_method'] = "ssl"
  86 +default['gitlab']['gitlab-rails']['ldap_bind_dn'] = "_the_full_dn_of_the_user_you_will_bind_with"
  87 +default['gitlab']['gitlab-rails']['ldap_password'] = "_the_password_of_the_bind_user"
  88 +default['gitlab']['gitlab-rails']['ldap_allow_username_or_email_login'] = true
  89 +default['gitlab']['gitlab-rails']['satellites_path'] = "/var/opt/gitlab/gitlab-satellites"
  90 +default['gitlab']['gitlab-rails']['backup_path'] = "tmp/backups"
  91 +default['gitlab']['gitlab-rails']['gitlab_shell_path'] = "/opt/gitlab/embedded/service/gitlab-shell/"
  92 +default['gitlab']['gitlab-rails']['gitlab_shell_repos_path'] = "/home/git/repositories/"
  93 +default['gitlab']['gitlab-rails']['gitlab_shell_hooks_path'] = "/opt/gitlab/embedded/service/gitlab-shell/hooks/"
  94 +default['gitlab']['gitlab-rails']['gitlab_shell_upload_pack'] = true
  95 +default['gitlab']['gitlab-rails']['gitlab_shell_receive_pack'] = true
  96 +default['gitlab']['gitlab-rails']['git_bin_path'] = "/opt/gitlab/embedded/bin/git"
  97 +default['gitlab']['gitlab-rails']['git_max_size'] = 5242880
  98 +default['gitlab']['gitlab-rails']['git_timeout'] = 10
  99 +default['gitlab']['gitlab-rails']['extra'] =
  100 +
58 101  
59 102 ####
60 103 # Unicorn
... ...
files/gitlab-cookbooks/gitlab/libraries/gitlab.rb
... ... @@ -84,14 +84,14 @@ module Gitlab
84 84 raise "External URL must include a FQDN"
85 85 end
86 86 Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
87   - Gitlab['gitlab_rails']['external_fqdn'] = uri.host
88   - Gitlab['gitlab_rails']['notification_email'] ||= "gitlab@#{uri.host}"
  87 + Gitlab['gitlab_rails']['gitlab_host'] = uri.host
  88 + Gitlab['gitlab_rails']['gitlab_email_from'] ||= "gitlab@#{uri.host}"
89 89  
90 90 case uri.scheme
91 91 when "http"
92   - Gitlab['gitlab_rails']['external_https'] = false
  92 + Gitlab['gitlab_rails']['gitlab_https'] = false
93 93 when "https"
94   - Gitlab['gitlab_rails']['external_https'] = true
  94 + Gitlab['gitlab_rails']['gitlab_https'] = true
95 95 else
96 96 raise "Unsupported external URL scheme: #{uri.scheme}"
97 97 end
... ... @@ -100,7 +100,7 @@ module Gitlab
100 100 raise "Unsupported external URL path: #{uri.path}"
101 101 end
102 102  
103   - Gitlab['gitlab_rails']['external_port'] = uri.port
  103 + Gitlab['gitlab_rails']['gitlab_port'] = uri.port
104 104 end
105 105  
106 106 def generate_hash
... ...
files/gitlab-cookbooks/gitlab/recipes/gitlab-shell.rb
... ... @@ -20,7 +20,7 @@ git_user = node['gitlab']['user']['username']
20 20 git_group = node['gitlab']['user']['group']
21 21 gitlab_shell_dir = "/opt/gitlab/embedded/service/gitlab-shell"
22 22 gitlab_shell_var_dir = "/var/opt/gitlab/gitlab-shell"
23   -repositories_path = node['gitlab']['gitlab-rails']['repositories_path']
  23 +repositories_path = node['gitlab']['gitlab-rails']['gitlab_shell_repos_path']
24 24 ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh")
25 25 log_directory = node['gitlab']['gitlab-shell']['log_directory']
26 26  
... ...
files/gitlab-cookbooks/gitlab/recipes/nginx.rb
... ... @@ -44,7 +44,7 @@ template nginx_vars[:gitlab_http_config] do
44 44 mode "0644"
45 45 variables(nginx_vars.merge(
46 46 {
47   - :fqdn => node['gitlab']['gitlab-rails']['external_fqdn'],
  47 + :fqdn => node['gitlab']['gitlab-rails']['gitlab_host'],
48 48 :socket => node['gitlab']['unicorn']['socket']
49 49 }
50 50 ))
... ...
files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb
... ... @@ -15,9 +15,9 @@ production: &base
15 15 ## GitLab settings
16 16 gitlab:
17 17 ## Web server settings (note: host is the FQDN, do not include http://)
18   - host: <%= node['gitlab']['gitlab-rails']['external_fqdn'] %>
19   - port: <%= node['gitlab']['gitlab-rails']['external_port'] %>
20   - https: <%= node['gitlab']['gitlab-rails']['external_https'] %>
  18 + host: <%= @gitlab_host %>
  19 + port: <%= @gitlab_port %>
  20 + https: <%= @gitlab_https %>
21 21  
22 22 # Uncomment and customize the last line to run in a non-root path
23 23 # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this.
... ... @@ -35,27 +35,27 @@ production: &amp;base
35 35  
36 36 ## Email settings
37 37 # Email address used in the "From" field in mails sent by GitLab
38   - email_from: <%= node['gitlab']['gitlab-rails']['notification_email'] %>
  38 + email_from: <%= @gitlab_email_from %>
39 39  
40 40 # Email address of your support contact (default: same as email_from)
41   - support_email: <%= node['gitlab']['gitlab-rails']['support_email'] %>
  41 + support_email: <%= @gitlab_support_email %>
42 42  
43 43 ## User settings
44 44 default_projects_limit: 10
45   - # default_can_create_group: false # default: true
46   - # username_changing_enabled: false # default: true - User can change her username/namespace
  45 + default_can_create_group: <%= @gitlab_default_can_create_group %> # default: true
  46 + username_changing_enabled: <%= @username_changing_enabled %> # default: true - User can change her username/namespace
47 47 ## Default theme
48 48 ## BASIC = 1
49 49 ## MARS = 2
50 50 ## MODERN = 3
51 51 ## GRAY = 4
52 52 ## COLOR = 5
53   - # default_theme: 2 # default: 2
  53 + default_theme: <%= @gitlab_default_theme %> # default: 2
54 54  
55 55  
56 56 ## Users management
57 57 # default: false - Account passwords are not sent via the email if signup is enabled.
58   - # signup_enabled: true
  58 + signup_enabled: <%= @gitlab_signup_enabled %>
59 59  
60 60 # Restrict setting visibility levels for non-admin users.
61 61 # The default is to allow all levels.
... ... @@ -69,47 +69,51 @@ production: &amp;base
69 69  
70 70 ## Default project features settings
71 71 default_projects_features:
72   - issues: true
73   - merge_requests: true
74   - wiki: true
75   - wall: false
76   - snippets: false
77   - visibility_level: "private" # can be "private" | "internal" | "public"
  72 + issues: <%= @gitlab_default_projects_features_issues %>
  73 + merge_requests: <%= @gitlab_default_projects_features_merge_requests %>
  74 + wiki: <%= @gitlab_default_projects_features_wiki %>
  75 + wall: <%= @gitlab_default_projects_features_wall %>
  76 + snippets: <%= @gitlab_default_projects_features_snippets %>
  77 + visibility_level: "<%= @gitlab_default_projects_features_visibility_level %>" # can be "private" | "internal" | "public"
78 78  
79 79 ## External issues trackers
80 80 issues_tracker:
81   - # redmine:
82   - # title: "Redmine"
83   - # ## If not nil, link 'Issues' on project page will be replaced with this
84   - # ## Use placeholders:
85   - # ## :project_id - GitLab project identifier
86   - # ## :issues_tracker_id - Project Name or Id in external issue tracker
87   - # project_url: "http://redmine.sample/projects/:issues_tracker_id"
88   - #
89   - # ## If not nil, links from /#\d/ entities from commit messages will replaced with this
90   - # ## Use placeholders:
91   - # ## :project_id - GitLab project identifier
92   - # ## :issues_tracker_id - Project Name or Id in external issue tracker
93   - # ## :id - Issue id (from commit messages)
94   - # issues_url: "http://redmine.sample/issues/:id"
95   - #
96   - # ## If not nil, linkis to creating new issues will be replaced with this
97   - # ## Use placeholders:
98   - # ## :project_id - GitLab project identifier
99   - # ## :issues_tracker_id - Project Name or Id in external issue tracker
100   - # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new"
101   - #
102   - # jira:
103   - # title: "Atlassian Jira"
104   - # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id"
105   - # issues_url: "http://jira.sample/browse/:id"
106   - # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa"
  81 + <% if @issues_tracker_redmine %>
  82 + redmine:
  83 + title: "<%= @issues_tracker_redmine_title %>"
  84 + ## If not nil, link 'Issues' on project page will be replaced with this
  85 + ## Use placeholders:
  86 + ## :project_id - GitLab project identifier
  87 + ## :issues_tracker_id - Project Name or Id in external issue tracker
  88 + project_url: "<%= @issues_tracker_redmine_project_url %>"
  89 +
  90 + ## If not nil, links from /#\d/ entities from commit messages will replaced with this
  91 + ## Use placeholders:
  92 + ## :project_id - GitLab project identifier
  93 + ## :issues_tracker_id - Project Name or Id in external issue tracker
  94 + ## :id - Issue id (from commit messages)
  95 + issues_url: "<%= @issues_tracker_redmine_issues_url %>"
  96 +
  97 + ## If not nil, linkis to creating new issues will be replaced with this
  98 + ## Use placeholders:
  99 + ## :project_id - GitLab project identifier
  100 + ## :issues_tracker_id - Project Name or Id in external issue tracker
  101 + new_issue_url: "<%= @issues_tracker_redmine_new_issue_url %>"
  102 + <% end %>
  103 +
  104 + <% if @issues_tracker_jira %>
  105 + jira:
  106 + title: "<%= @issues_tracker_jira_title %>"
  107 + project_url: "<%= @issues_tracker_jira_project_url %>"
  108 + issues_url: "<%= @issues_tracker_jira_issues_url %>"
  109 + new_issue_url: "<%= @issues_tracker_jira_new_issue_url %>"
  110 + <% end %>
107 111  
108 112 ## Gravatar
109 113 gravatar:
110   - enabled: true # Use user avatar image from Gravatar.com (default: true)
111   - # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
112   - # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
  114 + enabled: <%= @gravatar_enabled %> # Use user avatar image from Gravatar.com (default: true)
  115 + plain_url: "<%= @gravatar_plain_url %>" # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
  116 + ssl_url: "<%= @gravatar_ssl_url %>" # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
113 117  
114 118 #
115 119 # 2. Auth settings
... ... @@ -119,14 +123,14 @@ production: &amp;base
119 123 # You can inspect a sample of the LDAP users with login access by running:
120 124 # bundle exec rake gitlab:ldap:check RAILS_ENV=production
121 125 ldap:
122   - enabled: false
123   - host: '_your_ldap_server'
124   - base: '_the_base_where_you_search_for_users'
125   - port: 636
126   - uid: 'sAMAccountName'
127   - method: 'ssl' # "tls" or "ssl" or "plain"
128   - bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
129   - password: '_the_password_of_the_bind_user'
  126 + enabled: <%= @ldap_enabled %>
  127 + host: '<%= @ldap_host %>'
  128 + base: '<%= @ldap_base %>'
  129 + port: <%= @ldap_port %>
  130 + uid: '<%= @ldap_uid %>'
  131 + method: '<%= @ldap_method %>' # "tls" or "ssl" or "plain"
  132 + bind_dn: '<%= @ldap_bind_dn %>'
  133 + password: '<%= @ldap_password %>'
130 134 # If allow_username_or_email_login is enabled, GitLab will ignore everything
131 135 # after the first '@' in the LDAP username submitted by the user on login.
132 136 #
... ... @@ -136,7 +140,7 @@ production: &amp;base
136 140 #
137 141 # If you are using "uid: 'userPrincipalName'" on ActiveDirectory you need to
138 142 # disable this setting, because the userPrincipalName contains an '@'.
139   - allow_username_or_email_login: true
  143 + allow_username_or_email_login: <%= @ldap_allow_username_or_email_login %>
140 144  
141 145 ## OmniAuth settings
142 146 omniauth:
... ... @@ -175,24 +179,24 @@ production: &amp;base
175 179 # GitLab Satellites
176 180 satellites:
177 181 # Relative paths are relative to Rails.root (default: tmp/repo_satellites/)
178   - path: <%= node['gitlab']['gitlab-rails']['satellites_path'] %>
  182 + path: <%= @satellites_path %>
179 183  
180 184 ## Backup settings
181 185 backup:
182   - path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
  186 + path: "<%= @backup_path %>" # Relative paths are relative to Rails.root (default: tmp/backups/)
183 187 # keep_time: 604800 # default: 0 (forever) (in seconds)
184 188  
185 189 ## GitLab Shell settings
186 190 gitlab_shell:
187   - path: /opt/gitlab/embedded/service/gitlab-shell/
  191 + path: <%= @gitlab_shell_path %>
188 192  
189 193 # REPOS_PATH MUST NOT BE A SYMLINK!!!
190   - repos_path: <%= node['gitlab']['gitlab-rails']['repositories_path'] %>
191   - hooks_path: /opt/gitlab/embedded/service/gitlab-shell/hooks/
  194 + repos_path: <%= @gitlab_shell_repos_path %>
  195 + hooks_path: <%= @gitlab_shell_hooks_path %>
192 196  
193 197 # Git over HTTP
194   - upload_pack: true
195   - receive_pack: true
  198 + upload_pack: <%= @gitlab_shell_upload_pack %>
  199 + receive_pack: <%= @gitlab_shell_receive_pack %>
196 200  
197 201 # If you use non-standard ssh port you need to specify it
198 202 # ssh_port: 22
... ... @@ -201,13 +205,13 @@ production: &amp;base
201 205 # CAUTION!
202 206 # Use the default values unless you really know what you are doing
203 207 git:
204   - bin_path: /opt/gitlab/embedded/bin/git
  208 + bin_path: <%= @git_bin_path %>
205 209 # The next value is the maximum memory size grit can use
206 210 # Given in number of bytes per git object (e.g. a commit)
207 211 # This value can be increased if you have very large commits
208   - max_size: 5242880 # 5.megabytes
  212 + max_size: <%= @git_max_size %> # 5.megabytes
209 213 # Git timeout to read a commit, in seconds
210   - timeout: 10
  214 + timeout: <%= @git_timeout %>
211 215  
212 216 #
213 217 # 4. Extra customization
... ...