Skip to content

Commit

Permalink
dev: Reorganize the env files
Browse files Browse the repository at this point in the history
.env and env.sample both had the descriptions of the variables, which
was painful to keep synchronized.

Now, the source of truth is env.sample, and .env only indicates to refer
to it.
  • Loading branch information
marien-probesys committed Aug 14, 2023
1 parent c590e40 commit b76098d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 48 deletions.
48 changes: 4 additions & 44 deletions .env
Original file line number Diff line number Diff line change
@@ -1,69 +1,29 @@
# Define the environment of the application. It can be: prod, dev, test
# Don't change this value unless you know what you do.
APP_ENV=dev
# This file defines a list of environment variables used to configure Bileto.
# PLEASE DON'T CHANGE THE VALUES OF THIS FILE! They are used by the development environment.
# To configure Bileto in production, copy the file env.sample as .env.local instead.

# A secret used to generate security tokens, **it must be changed!**
# Generate a token with the command: php bin/console app:secret
APP_ENV=dev
APP_SECRET=97cb420d0d43c4c786c51225db0b6018

# URL to connect to the database.
# Uncomment one of the two following line (depending on your database) and adapt the credentials.
DATABASE_URL="postgresql://postgres:postgres@pgsql:5432/bileto?serverVersion=11&charset=utf8"
# DATABASE_URL="mysql://root:mariadb@mariadb:3306/bileto?serverVersion=10.4.29-MariaDB"

# Configure your mail server. It is used to send email notifications to the users.
# Uncomment both MAILER_* lines and set them to your needs.
# More documentation at https://symfony.com/doc/7.0/mailer.html (“Transport Setup”).
MAILER_DSN=smtp://support%40example.com:secret@mailserver:3025
MAILER_FROM=[email protected]

# Configure the Symfony Messenger transport.
# You should not change this value unless you know what you're doing.
# More documentation at https://symfony.com/doc/current/messenger.html#transport-configuration
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0

######################
# LDAP configuration #
######################
# Set to true to use LDAP.
LDAP_ENABLED=false

# The hostname of the LDAP server.
LDAP_HOST="ldap"

# The port of the LDAP server.
LDAP_PORT=1389

# The version of LDAP used by the server.
LDAP_VERSION=3

# The encryption used to connect to the LDAP server (can be 'none', 'ssl', 'tls').
LDAP_ENCRYPTION="none"

# The base DN of the LDAP directory.
LDAP_BASE_DN="ou=users,dc=example,dc=com"

# The credentials of the admin user of the LDAP directory.
LDAP_ADMIN_DN="cn=admin,dc=example,dc=com"
LDAP_ADMIN_PASSWORD="secret"

# The DN to log a user in the LDAP directory. The {user_identifier} placeholder
# is replaced by the value entered by the users.
LDAP_USERS_DN="cn={user_identifier},ou=users,dc=example,dc=com"

# The search query to list all the users from the LDAP directory. This is used
# to synchronize automatically the list of users.
LDAP_QUERY_LIST_USERS="(cn=*)"

# The search query to find a user in the LDAP directory when they aren't known
# by Bileto. The {user_identifier} placeholder is replaced by the value entered
# by the user. If you use a different attribute than in LDAP_USERS_DN and
# LDAP_FIELD_IDENTIFIER, make sure that the values are identical in the LDAP
# directory.
LDAP_QUERY_SEARCH_USER="(cn={user_identifier})"

# The name of the LDAP attributes to search for the identifier, the email and
# the fullname of the users.
LDAP_FIELD_IDENTIFIER=cn
LDAP_FIELD_EMAIL=mail
LDAP_FIELD_FULLNAME=displayName
24 changes: 20 additions & 4 deletions env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# This file defines a list of environment variables used to configure Bileto.
# Please copy this file as .env.local to configure Bileto in production.

####################################
# Configuration of the application #
####################################
# Define the environment of the application. It can be: prod, dev, test
# Don't change this value unless you know what you do.
APP_ENV=prod
Expand All @@ -6,25 +12,35 @@ APP_ENV=prod
# Generate a token with the command: php bin/console app:secret
APP_SECRET=change-me

#################################
# Configuration of the database #
#################################
# URL to connect to the database.
# Uncomment one of the two following line (depending on your database) and adapt the credentials.
# Uncomment one of the two following line (depending on your database) and
# adapt the credentials and the serverVersion.
# DATABASE_URL="postgresql://user:password@localhost:5432/bileto_production?serverVersion=11&charset=utf8"
# DATABASE_URL="mysql://user:password@localhost:3306/bileto_production?serverVersion=10.4.29-MariaDB"

########################################
# Configuration of the SMTP mailserver #
########################################
# Configure your mail server. It is used to send email notifications to the users.
# Uncomment both MAILER_* lines and set them to your needs.
# More documentation at https://symfony.com/doc/7.0/mailer.html (“Transport Setup”).
# MAILER_DSN=smtp://user:[email protected]:465
# [email protected]

#####################################
# Configuration of the async system #
#####################################
# Configure the Symfony Messenger transport.
# You should not change this value unless you know what you're doing.
# More documentation at https://symfony.com/doc/current/messenger.html#transport-configuration
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0

######################
# LDAP configuration #
######################
#########################
# Configuration of LDAP #
#########################
# Set to true to use LDAP.
LDAP_ENABLED=false

Expand Down

0 comments on commit b76098d

Please sign in to comment.