Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Console/Commands/Overrides/KeyGenerateCommand.php
7460 views
1
<?php
2
3
namespace Pterodactyl\Console\Commands\Overrides;
4
5
use Illuminate\Foundation\Console\KeyGenerateCommand as BaseKeyGenerateCommand;
6
7
class KeyGenerateCommand extends BaseKeyGenerateCommand
8
{
9
/**
10
* Override the default Laravel key generation command to throw a warning to the user
11
* if it appears that they have already generated an application encryption key.
12
*/
13
public function handle()
14
{
15
if (!empty(config('app.key')) && $this->input->isInteractive()) {
16
$this->output->warning('It appears you have already configured an application encryption key. Continuing with this process with overwrite that key and cause data corruption for any existing encrypted data. DO NOT CONTINUE UNLESS YOU KNOW WHAT YOU ARE DOING.');
17
if (!$this->confirm('I understand the consequences of performing this command and accept all responsibility for the loss of encrypted data.')) {
18
return;
19
}
20
21
if (!$this->confirm('Are you sure you wish to continue? Changing the application encryption key WILL CAUSE DATA LOSS.')) {
22
return;
23
}
24
}
25
26
parent::handle();
27
}
28
}
29
30