Skip to content

A free open source IT asset/license management system

adding --force to `php artistan snipeit:legacy-recrypt` (#4232)

Kaseyd3b51715dcbf
diff --git a/app/Console/Commands/RecryptFromMcrypt.php b/app/Console/Commands/RecryptFromMcrypt.php
index bb38f098f9..f9b39183ab 100644
--- a/app/Console/Commands/RecryptFromMcrypt.php
+++ b/app/Console/Commands/RecryptFromMcrypt.php
@@ -16,7 +16,8 @@ class RecryptFromMcrypt extends Command
*
* @var string
*/
- protected $signature = 'snipeit:legacy-recrypt';
+ protected $signature = 'snipeit:legacy-recrypt
+ {--force : Force a re-crypt of encrypted data from MCRYPT.}';
/**
* The console command description.
@@ -81,7 +82,9 @@ class RecryptFromMcrypt extends Command
$this->error('================================!!!! WARNING !!!!================================');
$this->comment("This tool will attempt to decrypt your old Snipe-IT (mcrypt, now deprecated) encrypted data and re-encrypt it using OpenSSL. \n\nYou should only continue if you have backed up any and all old APP_KEYs and have backed up your data.");
- if ($this->confirm("Are you SURE you wish to continue?")) {
+ $force = ($this->option('force')) ? true : false;
+
+ if ($force || ($this->confirm("Are you SURE you wish to continue?"))) {
$backup_file = 'backups/env-backups/'.'app_key-'.date('Y-m-d-gis');