Commit b19d2942 authored by Kirill Smelkov's avatar Kirill Smelkov

gitlab: Slapos'ify gitlab config updates

    - relative URL support: comment out - we do not need it - gitlab is
      always located at /.

    - Nginx-http: restore our version for proxy_set_header - upstream
      turned to allowing users to configure this, see e.g.

        https://gitlab.com/gitlab-org/omnibus-gitlab/commit/e13d5e42
        https://gitlab.com/gitlab-org/omnibus-gitlab/commit/a450585e

      but doing this way creates more complexity for gitlab SR, so I've
      restored our version which essentially does the same as default in
      omnibus-gitlab, and if we'll need to tune it - we can do directly in
      Nginx config.

      In other words slapos version does not allow users to tune nginx
      headers as instance parameter.
parent 716b93e4
...@@ -223,15 +223,15 @@ url = ${:_profile_base_location_}/template/${:_buildout_section_name_} ...@@ -223,15 +223,15 @@ url = ${:_profile_base_location_}/template/${:_buildout_section_name_}
[config.ru.in] [config.ru.in]
<= download-template <= download-template
md5sum = 3ed3c439ac1b93f75121dabcea126078 md5sum = 91737a2067be80f3ae48157e5a0738b4
[database.yml.in] [database.yml.in]
<= download-template <= download-template
md5sum = b33f4f2f49a5a3e3e6542357c555a3a3 md5sum = 76d8f20532d63282ecd3617a3937fcf1
[gitconfig.in] [gitconfig.in]
<= download-template <= download-template
md5sum = 75f620ea0751fc8d2dc717cf929d29f3 md5sum = d8b3611386c4982605edd9a31832ee28
[gitlab-parameters.cfg] [gitlab-parameters.cfg]
<= download-file <= download-file
...@@ -239,7 +239,7 @@ md5sum = 2cfd3bbf9da10627044ca3a9a149fdbb ...@@ -239,7 +239,7 @@ md5sum = 2cfd3bbf9da10627044ca3a9a149fdbb
[gitlab-shell-config.yml.in] [gitlab-shell-config.yml.in]
<= download-template <= download-template
md5sum = f061d529b71241d58affbf7aec5c8af1 md5sum = 9c62aa1bf7396f207a528e39973aa135
[gitlab-unicorn-startup.in] [gitlab-unicorn-startup.in]
<= download-file <= download-file
...@@ -247,7 +247,7 @@ md5sum = 14c5632182d830c03f7788c85d6f4da1 ...@@ -247,7 +247,7 @@ md5sum = 14c5632182d830c03f7788c85d6f4da1
[gitlab.yml.in] [gitlab.yml.in]
<= download-template <= download-template
md5sum = cd7aaeeb1917fdedb7656943065c0a9c md5sum = 8f1c52ed223ee2c2d07c6c79bcd2f6c0
[instance-gitlab.cfg.in] [instance-gitlab.cfg.in]
<= download-file <= download-file
...@@ -259,27 +259,27 @@ md5sum = a56a44e96f65f5ed20211bb6a54279f4 ...@@ -259,27 +259,27 @@ md5sum = a56a44e96f65f5ed20211bb6a54279f4
[nginx-gitlab-http.conf.in] [nginx-gitlab-http.conf.in]
<= download-template <= download-template
md5sum = 3b494fe8425a12e4a7fd3a9bb17f88f8 md5sum = be7ddd26b0b0196fde8d699e50e84b2f
[nginx.conf.in] [nginx.conf.in]
<= download-template <= download-template
md5sum = dc16257d49d1fc1ae6e7d10865898201 md5sum = 71b4221cd91e0e1e20a72b97991f2665
[rack_attack.rb.in] [rack_attack.rb.in]
<= download-template <= download-template
md5sum = fbea569a1ac9ee46e37d0b98b5441169 md5sum = 2cf56b210a906cee80f86cde7112f468
[resque.yml.in] [resque.yml.in]
<= download-template <= download-template
md5sum = 2cd97d9f5906d06e00774dd2e4e6af0e md5sum = 1fa21655a845602f68a901f23a1da89a
[smtp_settings.rb.in] [smtp_settings.rb.in]
<= download-template <= download-template
md5sum = 75b9e0325737ca5ecbf938443a5d3321 md5sum = 07b640122b8c4840e853360f2479d0ac
[unicorn.rb.in] [unicorn.rb.in]
<= download-template <= download-template
md5sum = 1b55105a3de1ef13260ac3faa30d6e85 md5sum = 4f7c14147fd60b4cc9aefe7f64524abe
[versions] [versions]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# see: # see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config.ru # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config.ru
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab-rails-config.ru.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab-rails-config.ru.erb
# (last updated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
# This file is used by Rack-based servers to start the application. # This file is used by Rack-based servers to start the application.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# see: # see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/database.yml.postgresql # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/database.yml.postgresql
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/database.yml.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/database.yml.erb
# (last updated for 8.4.4+ce.0-0-g1680742) # (last updated for 8.5.1+ce.0-1-ge732b39)
{% from 'macrolib.cfg.in' import cfg with context %} {% from 'macrolib.cfg.in' import cfg with context %}
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# see: # see:
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/attributes/default.rb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/attributes/default.rb
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitconfig.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitconfig.erb
# (last updated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
# #
{% from 'macrolib.cfg.in' import cfg with context %} {% from 'macrolib.cfg.in' import cfg with context %}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# see: # see:
# https://gitlab.com/gitlab-org/gitlab-shell/blob/master/config.yml.example # https://gitlab.com/gitlab-org/gitlab-shell/blob/master/config.yml.example
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab-shell-config.yml.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab-shell-config.yml.erb
# (last updated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
# GitLab user. git by default # GitLab user. git by default
user: {{ backend_info.user }} user: {{ backend_info.user }}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# see: # see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb
# (last updated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
{% from 'macrolib.cfg.in' import cfg, cfg_https, external_url with context %} {% from 'macrolib.cfg.in' import cfg, cfg_https, external_url with context %}
...@@ -28,7 +28,9 @@ production: &base ...@@ -28,7 +28,9 @@ production: &base
# WARNING: See config/application.rb under "Relative url support" for the list of # WARNING: See config/application.rb under "Relative url support" for the list of
# other files that need to be changed for relative url support # other files that need to be changed for relative url support
{# we do not support relative URL
relative_url_root: <%= @gitlab_relative_url %> relative_url_root: <%= @gitlab_relative_url %>
#}
# Uncomment and customize if you can't use the default user to run GitLab (default: 'git') # Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
user: {{ backend_info.user }} user: {{ backend_info.user }}
......
{{ autogenerated }} {{ autogenerated }}
# see: # see:
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb
# (last updated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
{% from 'macrolib.cfg.in' import cfg, cfg_bool, cfg_https, fqdn with context %} {% from 'macrolib.cfg.in' import cfg, cfg_bool, cfg_https, fqdn with context %}
...@@ -104,8 +104,9 @@ server { ...@@ -104,8 +104,9 @@ server {
access_log {{ nginx.log }}/gitlab_access.log gitlab_access; access_log {{ nginx.log }}/gitlab_access.log gitlab_access;
error_log {{ nginx.log }}/gitlab_error.log; error_log {{ nginx.log }}/gitlab_error.log;
<% path = @relative_url ? @relative_url : "/" %> {# we do not support relative URL - path is always "/" #}
location <%= path %> { {% set path = "/" %}
location {{ path }} {
## If you use HTTPS make sure you disable gzip compression ## If you use HTTPS make sure you disable gzip compression
## to be safe against BREACH attack. ## to be safe against BREACH attack.
{{ 'gzip off;' if cfg_https else ''}} {{ 'gzip off;' if cfg_https else ''}}
...@@ -118,10 +119,18 @@ server { ...@@ -118,10 +119,18 @@ server {
proxy_http_version 1.1; proxy_http_version 1.1;
<% @proxy_set_headers.each do |header| %> # NOTE(slapos) proxy headers are defined upstream in omnibus-gitlab in:
<% next if header[1].nil? %> # - files/gitlab-config-template/gitlab.rb.template nginx['proxy_set_headers']
proxy_set_header <%= header[0] %> <%= header[1] %>; # - files/gitlab-cookbooks/gitlab/attributes/default.rb default['gitlab']['nginx']['proxy_set_headers']
<% end %> # - files/gitlab-cookbooks/gitlab/libraries/gitlab.rb parse_nginx_proxy_headers()
# (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
{% if cfg_https %}
proxy_set_header X-Forwarded-Ssl on;
{% endif %}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto {{ "https" if cfg_https else "http" }};
proxy_pass http://gitlab-workhorse; proxy_pass http://gitlab-workhorse;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# see: # see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab-ssl # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab-ssl
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb
# (last updated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
{% from 'macrolib.cfg.in' import cfg with context %} {% from 'macrolib.cfg.in' import cfg with context %}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# see: # see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/rack_attack.rb.example # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/rack_attack.rb.example
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/rack_attack.rb.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/rack_attack.rb.erb
# (last updated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
{% from 'macrolib.cfg.in' import cfg with context %} {% from 'macrolib.cfg.in' import cfg with context %}
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
# see: # see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/resque.yml.example # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/resque.yml.example
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/resque.yml.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/resque.yml.erb
# (last udpdated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last udpdated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
production: unix://{{ redis.unixsocket }} production: unix://{{ redis.unixsocket }}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# see: # see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/smtp_settings.rb.sample # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/smtp_settings.rb.sample
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/smtp_settings.rb.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/smtp_settings.rb.erb
# (last updated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
{% from 'macrolib.cfg.in' import cfg, cfg_bool with context %} {% from 'macrolib.cfg.in' import cfg, cfg_bool with context %}
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/unicorn.rb.example # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/unicorn.rb.example
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/unicorn.rb.example.development # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/unicorn.rb.example.development
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/unicorn.rb.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/unicorn.rb.erb
# (last updated for omnibus-gitlab 8.4.4+ce.0-0-g1680742) # (last updated for omnibus-gitlab 8.5.1+ce.0-1-ge732b39)
{% from 'macrolib.cfg.in' import cfg with context %} {% from 'macrolib.cfg.in' import cfg with context %}
...@@ -72,8 +72,10 @@ stderr_path '{{ unicorn.log }}/unicorn_stderr.log' ...@@ -72,8 +72,10 @@ stderr_path '{{ unicorn.log }}/unicorn_stderr.log'
# Where stdout gets logged # Where stdout gets logged
stdout_path '{{ unicorn.log }}/unicorn_stdout.log' stdout_path '{{ unicorn.log }}/unicorn_stdout.log'
{# we do not support Relative url
<%- if @relative_url %> <%- if @relative_url %>
# Relative url from where GitLab is served # Relative url from where GitLab is served
ENV['RAILS_RELATIVE_URL_ROOT'] = "<%= @relative_url %>" ENV['RAILS_RELATIVE_URL_ROOT'] = "<%= @relative_url %>"
<%- end %> <%- end %>
#}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment