Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0024b4e6
Commit
0024b4e6
authored
Nov 25, 2020
by
Stan Hu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rename-piwik-matomo' into 'master'
Rename Piwik to Matomo See merge request gitlab-org/gitlab!45658
parents
f4db04ef
49ed77a1
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
13 deletions
+36
-13
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+1
-1
app/views/layouts/_matomo.html.haml
app/views/layouts/_matomo.html.haml
+15
-0
changelogs/unreleased/rename-piwik-matomo.yml
changelogs/unreleased/rename-piwik-matomo.yml
+5
-0
config/gitlab.yml.example
config/gitlab.yml.example
+3
-3
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+2
-0
doc/.vale/gitlab/spelling-exceptions.txt
doc/.vale/gitlab/spelling-exceptions.txt
+1
-0
doc/development/fe_guide/security.md
doc/development/fe_guide/security.md
+2
-2
spec/views/layouts/_head.html.haml_spec.rb
spec/views/layouts/_head.html.haml_spec.rb
+7
-7
No files found.
app/views/layouts/_head.html.haml
View file @
0024b4e6
...
...
@@ -88,5 +88,5 @@
=
yield
:meta_tags
=
render
'layouts/google_analytics'
if
extra_config
.
has_key?
(
'google_analytics_id'
)
=
render
'layouts/
piwik'
if
extra_config
.
has_key?
(
'piwik_url'
)
&&
extra_config
.
has_key?
(
'piwik
_site_id'
)
=
render
'layouts/
matomo'
if
extra_config
.
has_key?
(
'matomo_url'
)
&&
extra_config
.
has_key?
(
'matomo
_site_id'
)
=
render
'layouts/snowplow'
app/views/layouts/_
piwik
.html.haml
→
app/views/layouts/_
matomo
.html.haml
View file @
0024b4e6
<!--
Piwik
-->
<!--
Matomo
-->
=
javascript_tag
nonce:
true
do
:plain
var _paq = _paq || [];
var _paq =
window._paq = window.
_paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//
#{
extra_config
.
piwik
_url
}
/";
_paq.push(['setTrackerUrl', u+'
piwik
.php']);
_paq.push(['setSiteId', "
#{
extra_config
.
piwik
_site_id
}
"]);
var u="//
#{
extra_config
.
matomo
_url
}
/";
_paq.push(['setTrackerUrl', u+'
matomo
.php']);
_paq.push(['setSiteId', "
#{
extra_config
.
matomo
_site_id
}
"]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.
defer=true; g.src=u+'piwik
.js'; s.parentNode.insertBefore(g,s);
g.type='text/javascript'; g.async=true; g.
src=u+'matomo
.js'; s.parentNode.insertBefore(g,s);
})();
<noscript><p><img
src=
"//
#{
extra_config
.
piwik_url
}
/piwik.php?idsite=
#{
extra_config
.
piwik
_site_id
}
"
style=
"border:0;"
alt=
""
/></p></noscript>
<!-- End
Piwik
Code -->
<noscript><p><img
src=
"//
#{
extra_config
.
matomo_url
}
/matomo.php?idsite=
#{
extra_config
.
matomo
_site_id
}
"
style=
"border:0;"
alt=
""
/></p></noscript>
<!-- End
Matomo
Code -->
changelogs/unreleased/rename-piwik-matomo.yml
0 → 100644
View file @
0024b4e6
---
title
:
Rename Piwik config items and layout file after rebranding to Matomo
merge_request
:
45658
author
:
Kate Grechishkina @kategrechishkina
type
:
changed
config/gitlab.yml.example
View file @
0024b4e6
...
...
@@ -1216,9 +1216,9 @@ production: &base
## Google tag manager
# google_tag_manager_id: '_your_tracking_id'
##
Piwik
analytics.
#
piwik_url: '_your_piwik
_url'
#
piwik_site_id: '_your_piwik
_site_id'
##
Matomo
analytics.
#
matomo_url: '_your_matomo
_url'
#
matomo_site_id: '_your_matomo
_site_id'
rack_attack:
git_basic_auth:
...
...
config/initializers/1_settings.rb
View file @
0024b4e6
...
...
@@ -785,6 +785,8 @@ Settings.forti_authenticator['port'] = 443 if Settings.forti_authenticator['port
# Extra customization
#
Settings
[
'extra'
]
||=
Settingslogic
.
new
({})
Settings
.
extra
[
'matomo_site_id'
]
||=
Settings
.
extra
[
'piwik_site_id'
]
Settings
.
extra
[
'matomo_url'
]
||=
Settings
.
extra
[
'piwik_url'
]
#
# Rack::Attack settings
...
...
doc/.vale/gitlab/spelling-exceptions.txt
View file @
0024b4e6
...
...
@@ -252,6 +252,7 @@ Markdown
markdownlint
matcher
matchers
Matomo
Mattermost
mbox
memoization
...
...
doc/development/fe_guide/security.md
View file @
0024b4e6
...
...
@@ -31,7 +31,7 @@ GitLab's CSP is used for the following:
Some exceptions include:
-
Scripts from Google Analytics and
Piwik
if either is enabled.
-
Scripts from Google Analytics and
Matomo
if either is enabled.
-
Connecting with GitHub, Bitbucket, GitLab.com, etc. to allow project importing.
-
Connecting with Google, Twitter, GitHub, etc. to allow OAuth authentication.
...
...
@@ -66,7 +66,7 @@ Some resources on implementing Subresource Integrity:
## Including external resources
External fonts, CSS, and JavaScript should never be used with the exception of
Google Analytics and
Piwik
- and only when the instance has enabled it. Assets
Google Analytics and
Matomo
- and only when the instance has enabled it. Assets
should always be hosted and served locally from the GitLab instance. Embedded
resources via
`iframes`
should never be used except in certain circumstances
such as with reCAPTCHA, which cannot be used without an
`iframe`
.
...
...
spec/views/layouts/_head.html.haml_spec.rb
View file @
0024b4e6
...
...
@@ -86,21 +86,21 @@ RSpec.describe 'layouts/_head' do
end
end
context
'when a
Piwik
config is set'
do
let
(
:
piwik_host
)
{
'piwik
.example.com'
}
context
'when a
Matomo
config is set'
do
let
(
:
matomo_host
)
{
'matomo
.example.com'
}
before
do
stub_config
(
extra:
{
piwik_url:
piwik
_host
,
piwik
_site_id:
12345
matomo_url:
matomo
_host
,
matomo
_site_id:
12345
})
end
it
'add a
Piwik
Javascript'
do
it
'add a
Matomo
Javascript'
do
render
expect
(
rendered
).
to
match
(
/<script.*>.*var u="\/\/
#{
piwik
_host
}
\/".*<\/script>/m
)
expect
(
rendered
).
to
match
(
%r(<noscript>.*<img src="//
#{
piwik_host
}
/piwik
.php.*</noscript>)
)
expect
(
rendered
).
to
match
(
/<script.*>.*var u="\/\/
#{
matomo
_host
}
\/".*<\/script>/m
)
expect
(
rendered
).
to
match
(
%r(<noscript>.*<img src="//
#{
matomo_host
}
/matomo
.php.*</noscript>)
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment