Skip to content
Snippets Groups Projects
Commit 1daeb331beac authored by Alishan Ladhani's avatar Alishan Ladhani
Browse files

Add matomo_disable_cookies setting

parent 68dd1b76fe20
No related branches found
No related tags found
1 merge request!26GitLab 13.9
---
title: Add matomo_disable_cookies setting
merge_request: 4979
author:
type: added
......@@ -618,6 +618,7 @@
# gitlab_rails['extra_google_tag_manager_id'] = '_your_tracking_id'
# gitlab_rails['extra_matomo_url'] = '_your_matomo_url'
# gitlab_rails['extra_matomo_site_id'] = '_your_matomo_site_id'
# gitlab_rails['extra_matomo_disable_cookies'] = false
##! Docs: https://docs.gitlab.com/omnibus/settings/environment-variables.html
# gitlab_rails['env'] = {
......
......@@ -384,6 +384,7 @@
default['gitlab']['gitlab-rails']['extra_google_tag_manager_id'] = nil
default['gitlab']['gitlab-rails']['extra_matomo_url'] = nil
default['gitlab']['gitlab-rails']['extra_matomo_site_id'] = nil
default['gitlab']['gitlab-rails']['extra_matomo_disable_cookies'] = nil
default['gitlab']['gitlab-rails']['rack_attack_git_basic_auth'] = nil
default['gitlab']['gitlab-rails']['db_adapter'] = "postgresql"
......
......@@ -930,6 +930,7 @@
## matomo analytics.
matomo_url: <%= quote(@extra_matomo_url) %>
matomo_site_id: <%= quote(@extra_matomo_site_id) %>
matomo_disable_cookies: <%= @extra_matomo_disable_cookies %>
<% end %>
rack_attack:
......
......@@ -392,6 +392,50 @@
end
end
context 'matomo_disable_cookies' do
context 'when true' do
before do
stub_gitlab_rb(
gitlab_rails: { extra_matomo_disable_cookies: true }
)
end
it 'should set matomo_disable_cookies to true' do
expect(chef_run).to create_templatesymlink('Create a gitlab.yml and create a symlink to Rails root').with_variables(
hash_including(
'extra_matomo_disable_cookies' => true
)
)
end
end
context 'when false' do
before do
stub_gitlab_rb(
gitlab_rails: { extra_matomo_disable_cookies: false }
)
end
it 'should set matomo_disable_cookies to false' do
expect(chef_run).to create_templatesymlink('Create a gitlab.yml and create a symlink to Rails root').with_variables(
hash_including(
'extra_matomo_disable_cookies' => false
)
)
end
end
context 'when absent' do
it 'should set matomo_disable_cookies to nil' do
expect(chef_run).to create_templatesymlink('Create a gitlab.yml and create a symlink to Rails root').with_variables(
hash_including(
'extra_matomo_disable_cookies' => nil
)
)
end
end
end
context 'when sentry is disabled' do
it 'should set sentry variable to nil' do
expect(chef_run).to create_templatesymlink('Create a gitlab.yml and create a symlink to Rails root').with_variables(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment