config: add MATOMO_HOST environment variable

This commit is contained in:
Pierre de La Morinerie 2022-01-18 12:47:01 +01:00
parent cd7a86743b
commit d4fada9f6c
4 changed files with 10 additions and 9 deletions

View file

@ -276,8 +276,9 @@ class ApplicationController < ActionController::Base
matomo = Rails.application.secrets.matomo matomo = Rails.application.secrets.matomo
{ {
key: matomo[:client_key], enabled: matomo[:enabled],
enabled: matomo[:enabled] host: matomo[:host],
key: matomo[:client_key]
} }
end end

View file

@ -1,11 +1,10 @@
const { key, enabled } = gon.matomo || {}; const { enabled, host, key } = gon.matomo || {};
if (enabled) { if (enabled) {
window._paq = window._paq || []; window._paq = window._paq || [];
const url = '//stats.data.gouv.fr/'; const jsUrl = `//${host}/piwik.js`;
const trackerUrl = `${url}piwik.php`; const trackerUrl = `//${host}/piwik.php`;
const jsUrl = `${url}piwik.js`;
// //
// Configure Matomo analytics // Configure Matomo analytics

View file

@ -67,8 +67,8 @@ SENTRY_DSN_JS=""
# External service: Matomo web analytics # External service: Matomo web analytics
MATOMO_ENABLED="disabled" MATOMO_ENABLED="disabled"
MATOMO_ID="73" MATOMO_ID=""
# Missing MATOMO_HOST (thus hardcoded) MATOMO_HOST="matomo.organisme.fr"
# SMTP Provider: Send In Blue # SMTP Provider: Send In Blue
SENDINBLUE_ENABLED="disabled" SENDINBLUE_ENABLED="disabled"

View file

@ -24,7 +24,7 @@ defaults: &defaults
token_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/token token_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/token
userinfo_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/userinfo userinfo_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/userinfo
logout_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/logout logout_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/logout
agent_connect: agent_connect:
identifier: <%= ENV['AGENT_CONNECT_ID'] %> identifier: <%= ENV['AGENT_CONNECT_ID'] %>
secret: <%= ENV['AGENT_CONNECT_SECRET'] %> secret: <%= ENV['AGENT_CONNECT_SECRET'] %>
redirect_uri: <%= ENV['AGENT_CONNECT_REDIRECT'] %> redirect_uri: <%= ENV['AGENT_CONNECT_REDIRECT'] %>
@ -55,6 +55,7 @@ defaults: &defaults
api_v3_key: <%= ENV['SENDINBLUE_API_V3_KEY'] %> api_v3_key: <%= ENV['SENDINBLUE_API_V3_KEY'] %>
matomo: matomo:
enabled: <%= ENV['MATOMO_ENABLED'] == 'enabled' %> enabled: <%= ENV['MATOMO_ENABLED'] == 'enabled' %>
host: <%= ENV['MATOMO_HOST'] %>
client_key: <%= ENV['MATOMO_ID'] %> client_key: <%= ENV['MATOMO_ID'] %>
sentry: sentry:
enabled: <%= ENV['SENTRY_ENABLED'] == 'enabled' %> enabled: <%= ENV['SENTRY_ENABLED'] == 'enabled' %>