Merge branch 'sh-pages-default-https-false' into 'master'

Default GitLab Pages not to redirect to HTTPS

Closes #2128

See merge request !1425
This commit is contained in:
DJ Mountney 2017-03-23 22:30:47 +00:00 committed by Lin Jen-Shin
parent 4ba90ff8ad
commit 1ece24806b
2 changed files with 5 additions and 6 deletions

View File

@ -527,7 +527,7 @@ default['gitlab']['gitlab-pages']['pages_path'] = nil
default['gitlab']['gitlab-pages']['domain'] = nil
default['gitlab']['gitlab-pages']['cert'] = nil
default['gitlab']['gitlab-pages']['cert_key'] = nil
default['gitlab']['gitlab-pages']['redirect_http'] = true
default['gitlab']['gitlab-pages']['redirect_http'] = false
default['gitlab']['gitlab-pages']['use_http2'] = true
default['gitlab']['gitlab-pages']['dir'] = "/var/opt/gitlab/gitlab-pages"
default['gitlab']['gitlab-pages']['log_directory'] = "/var/log/gitlab/gitlab-pages"

View File

@ -18,7 +18,7 @@ describe 'gitlab::gitlab-pages' do
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-daemon-gid})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-pages-root="/var/opt/gitlab/gitlab-rails/shared/pages"})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-pages-domain="pages.example.com"})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-redirect-http=true})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-redirect-http=false})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-use-http2=true})
expect(chef_run).to_not render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-listen-http})
@ -34,10 +34,9 @@ describe 'gitlab::gitlab-pages' do
stub_gitlab_rb(
pages_external_url: 'https://pages.example.com',
gitlab_pages: {
metrics_address: 'localhost:1234',
redirect_http: false,
external_https: 'external_pages.example.com',
cert: '/etc/gitlab/pages.crt'
metrics_address: 'localhost:1234',
redirect_http: true
}
)
end
@ -48,7 +47,7 @@ describe 'gitlab::gitlab-pages' do
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-daemon-gid})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-pages-root="/var/opt/gitlab/gitlab-rails/shared/pages"})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-pages-domain="pages.example.com"})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-redirect-http=false})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-redirect-http=true})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-use-http2=true})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-metrics-address="localhost:1234"})
expect(chef_run).to render_file("/opt/gitlab/sv/gitlab-pages/run").with_content(%r{-root-cert="\/etc\/gitlab\/pages.crt"})