From 338aafe86fd5a7b1c332e43f8a578531a4d51f0d Mon Sep 17 00:00:00 2001 From: Fabrice Gangler <fabrice.gangler@adullact.org> Date: Thu, 18 Jul 2024 17:52:30 +0200 Subject: [PATCH] chore: clean up .env files --- webapp/.env | 8 ++++---- webapp/.env.dev | 19 ++++++++----------- webapp/.env.prod | 10 +++++----- webapp/.env.test | 26 +++++++++++++++++--------- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/webapp/.env b/webapp/.env index ebcf4e5..60addbe 100644 --- a/webapp/.env +++ b/webapp/.env @@ -1,4 +1,4 @@ -######################################################################################################### +####################################################################################################################### # In all environments, the following files are loaded if they exist, # the latter taking precedence over the former: # @@ -18,7 +18,7 @@ # - APP_SECRET Application secret to generate CSRF tokens # - DATABASE_URL Database configuration (PostgreSQL) # - MAILER_DSN SMTP configuration -######################################################################################################################## +####################################################################################################################### # - WEBAPP_DEFAULT_URI Default URI used to generate URLs in a non-HTTP context # - WEBAPP_EMAIL_FROM Sender's email address to send emails from the web application # - WEBAPP_EMAIL_ALERTING_TO Email address for alert notifications (web application not working properly, ...) @@ -30,8 +30,8 @@ # - WEBAPP_TRUSTED_HOSTS List of allowed domains and IP to prevent HTTP Host header attacks ####################################################################################################################### # - WEBAPP_EXTERNAL_SILL_HOME_URL SILL website URL -# - WEBAPP_EXTERNAL_SILL_SOFWARE_FR_LINK SILL French URL to display a software. -# - WEBAPP_EXTERNAL_SILL_SOFWARE_EN_LINK SILL English URL to display a software. +# - WEBAPP_EXTERNAL_SILL_SOFWARE_FR_LINK SILL French URL to display a software +# - WEBAPP_EXTERNAL_SILL_SOFWARE_EN_LINK SILL English URL to display a software # - WEBAPP_EXTERNAL_SILL_JSON_DATA_URL URL of SILL data in JSON format ####################################################################################################################### # - WEBAPP_USER_CONFIG_RESET_PASSWORD_TOKEN_LIFETIME Lifetime of reset password token in seconds (default: 1200 = 20 minutes). diff --git a/webapp/.env.dev b/webapp/.env.dev index 8df8b80..bd02d75 100644 --- a/webapp/.env.dev +++ b/webapp/.env.dev @@ -1,4 +1,6 @@ -######################################################################################################### +####################################################################################################################### +# Committed environment variables for the DEV environment +####################################################################################################################### # In all environments, the following files are loaded if they exist, # the latter taking precedence over the former: # @@ -8,22 +10,16 @@ # * .env.$APP_ENV.local uncommitted environment-specific overrides # # Real environment variables win over .env files. -# -# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. -# https://symfony.com/doc/current/configuration/secrets.html -# -# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). -# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration -######################################################################################################### +####################################################################################################################### APP_ENV=dev -####################################################################### +####################################################################################################################### WEBAPP_TRUSTED_HOSTS='^127.0.0.1$' # WEBAPP_TRUSTED_HOSTS='^127.0.0.1$' # WEBAPP_TRUSTED_HOSTS='^localhost$' # WEBAPP_TRUSTED_HOSTS='^webapp\.localhost$' # WEBAPP_TRUSTED_HOSTS='^127.0.0.1$|^localhost$' # WEBAPP_TRUSTED_HOSTS='^127.0.0.1$|^localhost$|^webapp\.localhost$' -####################################################################### +####################################################################################################################### WEBAPP_NAME='Comptoir du Libre DEV' WEBAPP_SHORTNAME='Comptoir DEV' WEBAPP_EMAIL_ALERTING_TO=sysadmin@dev.example.org @@ -31,7 +27,7 @@ WEBAPP_EMAIL_FROM=no-reply@dev.example.org WEBAPP_I18N_DEFAULT_LOCALE='fr' # allowed values: 'en' or 'fr' #WEBAPP_TIMEZONE='Europe/Paris' #WEBAPP_TIMEZONE='America/New_York' -####################################################################### +####################################################################################################################### MAILER_DSN=smtp://127.0.0.1:1025 # MAILER_DSN=smtp://user%40example.org:password@mail.example.org:465 # MAILER_DSN=smtp://example.org:465 @@ -65,6 +61,7 @@ MAILER_DSN=smtp://127.0.0.1:1025 +####################################################################################################################### ####################################################################################################################### ####################################################################################################################### diff --git a/webapp/.env.prod b/webapp/.env.prod index 378c18f..dd514e5 100644 --- a/webapp/.env.prod +++ b/webapp/.env.prod @@ -1,4 +1,4 @@ -######################################################################################################### +####################################################################################################################### # In all environments, the following files are loaded if they exist, # the latter taking precedence over the former: # @@ -18,7 +18,7 @@ # - APP_SECRET Application secret to generate CSRF tokens # - DATABASE_URL Database configuration (PostgreSQL) # - MAILER_DSN SMTP configuration -######################################################################################################################## +####################################################################################################################### # - WEBAPP_DEFAULT_URI Default URI used to generate URLs in a non-HTTP context # - WEBAPP_EMAIL_FROM Sender's email address to send emails from the web application # - WEBAPP_EMAIL_ALERTING_TO Email address for alert notifications (web application not working properly, ...) @@ -79,11 +79,11 @@ WEBAPP_EMAIL_FROM=no-reply@example.org WEBAPP_EMAIL_ALERTING_TO=sysadmin@example.org # Webapp - Name of web application displayed to users -WEBAPP_NAME='Tajine - Registration authority (RA)' -WEBAPP_SHORTNAME='Tajine (RA)' +WEBAPP_NAME='Comptoir du Libre' +WEBAPP_SHORTNAME='Comptoir' # Webapp - User interface language -WEBAPP_I18N_DEFAULT_LOCALE='en' # allowed values: 'en' or 'fr' +WEBAPP_I18N_DEFAULT_LOCALE='fr' # allowed values: 'en' or 'fr' # Webapp - Lifetime of the session in seconds WEBAPP_SESSION_LIFETIME=3600 diff --git a/webapp/.env.test b/webapp/.env.test index 06c4e2b..ac2cff1 100644 --- a/webapp/.env.test +++ b/webapp/.env.test @@ -1,26 +1,34 @@ -# define your env variables for the test env here +####################################################################################################################### +# Comomn environment variables for the TEST environment +####################################################################################################################### +# In all environments, the following files are loaded if they exist, +# the latter taking precedence over the former: +# +# * .env contains default values for the environment variables needed by the app +# * .env.local uncommitted file with local overrides +# * .env.$APP_ENV committed environment-specific defaults +# * .env.$APP_ENV.local uncommitted environment-specific overrides +# +# Real environment variables win over .env files. +####################################################################################################################### KERNEL_CLASS='App\Kernel' APP_SECRET='$ecretf0rt3st' SYMFONY_DEPRECATIONS_HELPER=999999 PANTHER_APP_ENV=panther PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots - -####################################################################### +####################################################################################################################### #WEBAPP_TRUSTED_HOSTS='^127.0.0.1$' WEBAPP_TRUSTED_HOSTS='^localhost$' -####################################################################### +####################################################################################################################### WEBAPP_NAME='Comptoir du Libre TEST' WEBAPP_SHORTNAME='ComptoirTest' WEBAPP_EMAIL_ALERTING_TO=sysadmin@test.example.org WEBAPP_EMAIL_FROM=no-reply@test.example.org WEBAPP_I18N_DEFAULT_LOCALE='en' #WEBAPP_TIMEZONE='America/New_York' -####################################################################### +####################################################################################################################### MAILER_DSN=null://null -####################################################################### - - - +####################################################################################################################### ####################################################################################################################### ####################################################################################################################### -- GitLab