Skip to content
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

[9.x] Allow to pass base64 key to env:encrypt command #45157

Merged

Conversation

ekateiva
Copy link
Contributor

@ekateiva ekateiva commented Dec 1, 2022

The idea is described in #45155

The thing is that it is not possible now to reuse automatically generated base64 key by env:encrypt (when --key option is not passed) for further encryptions of .env file:

php artisan env:encrypt --env=staging --force --key=base64:74yqwbohnT2S9UFILYaDv73lZTqiDBeUDvyWHT6V0pw=
>    ERROR  Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm.

And you would like to reuse the same encryption key between developers working on the same project and who needs to modify the .env (e.g. staging, production, etc.) files.

Fixes #45155

@ekateiva ekateiva force-pushed the feature/fix-env-encrypt-with-base64-key branch from 5cd1f71 to 081f135 Compare December 1, 2022 08:45
@driesvints driesvints requested a review from joedixon December 1, 2022 10:05
@joedixon
Copy link
Contributor

joedixon commented Dec 1, 2022

Thanks @ekateiva, this is a really nice addition and something I've been considering for a while.

I just simplified the PR a little - let me know if you have any feedback.

@ekateiva
Copy link
Contributor Author

ekateiva commented Dec 1, 2022

@joedixon Thanks for simplifying it... Looks good to me! 👍

@taylorotwell taylorotwell merged commit eb19ed8 into laravel:9.x Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

env:encrypt command can not deal with default base64 key
3 participants