Skip to content

Update secrets.rst #13655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions configuration/secrets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,18 @@ manually store this file somewhere and deploy it. There are 2 ways to do that:

1) Uploading the file:

The first option is to copy the **decryption key** -
``/config/secrets/prod/prod.decrypt.private.php`` to your server(s).
The first option is to copy the **production decryption key** -
``config/secrets/prod/prod.decrypt.private.php`` to your server(s).

2) Using an Environment Variable

The second way is to set the ``SYMFONY_DECRYPTION_SECRET`` environment variable
to the base64 encoded value of the **decryption key**. A fancy way to fetch the
value of the key is:
to the base64 encoded value of the **production decryption key**.
A fancy way to define it is:

.. code-block:: terminal

$ php -r 'echo base64_encode(require "config/secrets/prod/prod.decrypt.private.php");'
$ export SYMFONY_DECRYPTION_SECRET=`php -r 'echo base64_encode(require "config/secrets/prod/prod.decrypt.private.php");'`

To improve performance (i.e. avoid decrypting secrets at runtime), you can decrypt
your secrets during deployment to the "local" vault:
Expand All @@ -257,8 +257,8 @@ your secrets during deployment to the "local" vault:

$ php bin/console secrets:decrypt-to-local --force --env=prod

This will put all the decrypted secrets into ``.env.prod.local``. After doing this,
the decryption key does *not* need to remain on the server.
This will write all the decrypted secrets into the ``.env.prod.local`` file.
After doing this, the decryption key does *not* need to remain on the server.

Rotating Secrets
----------------
Expand Down