This document contains necessary information how you can use your own custom configuration for this application.
Prologue ᐞ
This application is using Dotenv
component parses .env
files to make environment variables stored in them
accessible via $_ENV
or $_SERVER
.
To get basic knowledge how this works you should see External links / resources section of this document.
Within this application we define all environment specified settings to
separate application.json
file that we can easily use with Symfony
configuration part.
Creating custom files ᐞ
Starting to use custom configuration is quite easy, all you need to do is following:
cp /app/.env /app/.env.local
cp /app/secrets/application.json /app/secrets/application.local.json
sed -i "s/application\.json/application\.local\.json/g" .env.local
OR
make local-configuration
With these commands you created your own configuration that application will use on next start up. So all that you need to do is to make necessary changes to those newly created files.
Making necessary changes to those files should be quite self explanatory -
just take a look what those files contains. And most likely you only need
to make changes to that secrets/application.local.json
file.
Detailed configuration ᐞ
Below you can see all the current configuration values that are defined in
application.json
and those are used on Symfony configuration files.
DATABASE_NAME = Self explanatory
DATABASE_URL = Self explanatory
JWT_SECRET_KEY = Where private JWT key is stored
JWT_PUBLIC_KEY = Where public JWT key is stored
JWT_PASSPHRASE = Used passphrase for that private key
CORS_ALLOW_ORIGIN = Which IP addresses are allowed to make CORS
requests
REQUEST_LOG_SENSITIVE_PROPERTIES = Which request parameters are "sensitive"
ones, this prevent writing those to request
log
External links / resources ᐞ
- Nov 2018 Changes to .env & How to Update
- New in Symfony 4.2: Define env vars per environment
- How to Master and Create new Environments
- Configuring Symfony (and Environments)
- Improvements to the Handling of .env Files for all Symfony Versions