Skip to content

[secrets] Use APP_RUNTIME_ENV to define secrets #14457

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
Jul 27, 2021
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
6 changes: 3 additions & 3 deletions configuration/secrets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ running:

.. code-block:: terminal

$ php bin/console secrets:generate-keys --env=prod
$ APP_RUNTIME_ENV=prod php bin/console secrets:generate-keys

This will generate ``config/secrets/prod/prod.encrypt.public.php`` and
``config/secrets/prod/prod.decrypt.private.php``.
Expand Down Expand Up @@ -78,7 +78,7 @@ Suppose you want to store your database password as a secret. By using the
$ php bin/console secrets:set DATABASE_PASSWORD

# set your production value
$ php bin/console secrets:set DATABASE_PASSWORD --env=prod
$ APP_RUNTIME_ENV=prod php bin/console secrets:set DATABASE_PASSWORD

This will create a new file for the secret in ``config/secrets/dev`` and another
in ``config/secrets/prod``. You can also set the secret in a few other ways:
Expand Down Expand Up @@ -253,7 +253,7 @@ your secrets during deployment to the "local" vault:

.. code-block:: terminal

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

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(s).
Expand Down