From f77932a6174ba5d9df7ede454bf05646cdb6a491 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 10 Oct 2021 21:08:22 +0300 Subject: [PATCH] cmd(upgrade): Attempt to gain users attention during upgrade (#3678) * cmd(upgrade): Attempt to gain users attention during upgrade Changes color of the user and group to gain attention, common issue is having wrong user/group which breaks the panel. Outputs termination message when users spam enter skipping the upgrade wondering why it didn't upgrade. Reminder to update wings, because users forget it. * cmd(upgrade): Display wings upgrade documentation link --- app/Console/Commands/UpgradeCommand.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/UpgradeCommand.php b/app/Console/Commands/UpgradeCommand.php index feb21ec60..224329869 100644 --- a/app/Console/Commands/UpgradeCommand.php +++ b/app/Console/Commands/UpgradeCommand.php @@ -57,7 +57,7 @@ class UpgradeCommand extends Command $userDetails = posix_getpwuid(fileowner('public')); $user = $userDetails['name'] ?? 'www-data'; - if (!$this->confirm("Your webserver user has been detected as [{$user}]: is this correct?", true)) { + if (!$this->confirm("Your webserver user has been detected as [{$user}]: is this correct?", true)) { $user = $this->anticipate( 'Please enter the name of the user running your webserver process. This varies from system to system, but is generally "www-data", "nginx", or "apache".', [ @@ -73,7 +73,7 @@ class UpgradeCommand extends Command $groupDetails = posix_getgrgid(filegroup('public')); $group = $groupDetails['name'] ?? 'www-data'; - if (!$this->confirm("Your webserver group has been detected as [{$group}]: is this correct?", true)) { + if (!$this->confirm("Your webserver group has been detected as [{$group}]: is this correct?", true)) { $group = $this->anticipate( 'Please enter the name of the group running your webserver process. Normally this is the same as your user.', [ @@ -86,6 +86,7 @@ class UpgradeCommand extends Command } if (!$this->confirm('Are you sure you want to run the upgrade process for your Panel?')) { + $this->warn('Upgrade process terminated by user.'); return; } } @@ -173,8 +174,8 @@ class UpgradeCommand extends Command $this->call('up'); }); - $this->newLine(); - $this->info('Finished running upgrade.'); + $this->newLine(2); + $this->info('Panel has been successfully upgraded. Please ensure you also update any Wings instances: https://pterodactyl.io/wings/1.0/upgrading.html'); } protected function withProgress(ProgressBar $bar, Closure $callback)