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
{
key: matomo[:client_key],
enabled: matomo[:enabled]
enabled: matomo[:enabled],
host: matomo[:host],
key: matomo[:client_key]
}
end

View file

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

View file

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

View file

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