-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
feat: interactive env:encrypt & env:decrypt #53081
Changes from 2 commits
8033af2
80b0d32
13abe03
84a9bbd
f8789d3
6a12016
5ac6f93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,8 @@ class EnvironmentEncryptCommand extends Command | |
{--cipher= : The encryption cipher} | ||
{--env= : The environment to be encrypted} | ||
{--prune : Delete the original environment file} | ||
{--force : Overwrite the existing encrypted environment file}'; | ||
{--force : Overwrite the existing encrypted environment file} | ||
{--interactive : Prompt the encryption key}'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should just use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did not know the existence of this one. Have used that instead. However, I've then also added a |
||
|
||
/** | ||
* The console command description. | ||
|
@@ -62,6 +63,10 @@ public function handle() | |
|
||
$key = $this->option('key'); | ||
|
||
if (! $key && $this->option('interactive')) { | ||
$key = $this->ask('Encryption key'); | ||
} | ||
|
||
$keyPassed = $key !== null; | ||
|
||
$environmentFile = $this->option('env') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to use https://laravel.com/docs/11.x/prompts#password
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea, have changed this now