Merge pull request #6820 from betagouv/improve-env-var-organization

Amélioration des variables d'environnement (ajout et renommage)
This commit is contained in:
Pierre de La Morinerie 2022-01-19 15:48:21 +01:00 committed by GitHub
commit d1a941d908
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 20 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

@ -47,7 +47,7 @@ class ActiveJob::ApplicationLogSubscriber < ::ActiveJob::LogSubscriber
end
data[:tags] = tags
data[:type] = 'tps'
data[:source] = ENV['SOURCE']
data[:source] = ENV['LOGRAGE_SOURCE']
log(data)
end

View file

@ -12,7 +12,6 @@ APP_HOST="localhost:3000"
# For production you MUST generate a new key, and keep it secret.
# Secrets must be long and random. Use bin/rails secret to get new unique secrets.
SECRET_KEY_BASE="05a2d479d8e412198dabd08ef0eee9d6e180f5cbb48661a35fd1cae287f0a93d40b5f1da08f06780d698bbd458a0ea97f730f83ee780de5d4e31f649a0130cf0"
SIGNING_KEY="aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017"
# Secret key for One-Time-Password codes, used for 2-factors authentication
OTP_SECRET_KEY=""
@ -21,7 +20,6 @@ OTP_SECRET_KEY=""
# SAML_IDP_CERTIFICATE="billybop"
# SAML_IDP_SECRET_KEY="-----BEGIN RSA PRIVATE KEY-----\nblabla+blabla\n-----END RSA PRIVATE KEY-----\n"
# SENDINBLUE_LOGIN_URL="https://app.sendinblue.com/account/saml/login/truc"
# Database credentials
DB_DATABASE="tps_development"
@ -69,16 +67,17 @@ 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"
SENDINBLUE_BALANCING=""
SENDINBLUE_BALANCING_VALUE=""
SENDINBLUE_ENABLED=""
SENDINBLUE_CLIENT_KEY=""
SENDINBLUE_SMTP_KEY=""
SENDINBLUE_USER_NAME=""
# SENDINBLUE_LOGIN_URL="https://app.sendinblue.com/account/saml/login/truc"
# SMTP Provider: Mailjet
MAILJET_API_KEY=""
@ -115,7 +114,7 @@ LOGRAGE_ENABLED="disabled"
# * For local development: tps_local
# * For preproduction: tps_staging
# * For production: tps_prod
SOURCE="tps_local"
LOGRAGE_SOURCE="tps_local"
# External service: timestamping a daily archive of dossiers status changes
UNIVERSIGN_API_URL="https://ws.universign.eu/tsa/post/"
@ -128,10 +127,6 @@ API_GEO_URL="https://geo.api.gouv.fr"
# External service: API Education
API_EDUCATION_URL="https://data.education.gouv.fr/api/records/1.0"
# Change the maximum number of times a job is retried
# MAX_ATTEMPTS_JOBS=25
# MAX_ATTEMPTS_API_ENTREPRISE_JOBS=5
# Encryption key for sensitive columns in the database
ENCRYPTION_SERVICE_SALT=""

View file

@ -14,6 +14,10 @@ DS_ENV="staging"
# Agent Connect usage
# AGENT_CONNECT_ENABLED="disabled" # "enabled" by default
# Configure the maximum number of times a job is retried
# MAX_ATTEMPTS_JOBS=25
# MAX_ATTEMPTS_API_ENTREPRISE_JOBS=5
# Instance customization: URLs for GTS and legal mentions
# CGU_URL=""
# MENTIONS_LEGALES_URL=""

View file

@ -12,7 +12,6 @@
defaults: &defaults
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
encryption_service_salt: <%= ENV["ENCRYPTION_SERVICE_SALT"] %>
signing_key: <%= ENV["SIGNING_KEY"] %>
otp_secret_key: <%= ENV["OTP_SECRET_KEY"] %>
basic_auth:
username: <%= ENV['BASIC_AUTH_USERNAME'] %>
@ -25,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'] %>
@ -56,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' %>
@ -85,7 +85,6 @@ test:
<<: *defaults
secret_key_base: aa52abc3f3a629d04a61e9899a24c12f52b24c679cbf45f8ec0cdcc64ab9526d673adca84212882dff3911ac98e0c32ec4729ca7b3429ba18ef4dfd1bd18bc7a
encryption_service_salt: QUDyMoXyw2YXU8pHnpts3w9MyMpsMQ6BgP62obgCf7PQv
signing_key: aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017
otp_secret_key: 78ddda3679dc0ba2c99f50bcff04f49d862358dbeb7ead50368fdd6de14392be884ee10a204a0375b4b382e1a842fafe40d7858b7ab4796ec3a67c518d31112b
api_entreprise:
key: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik9oIHllYWgiLCJpYXQiOjE1MTYyMzkwMjJ9.f06sBo3q2Yxnw_TYPFUEs0CozBmcV-XniH_DeKNWzKE"