Skip to content

Commit f77932a

Browse files
authored
cmd(upgrade): Attempt to gain users attention during upgrade (pterodactyl#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
1 parent c12f146 commit f77932a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/Console/Commands/UpgradeCommand.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function handle()
5757
$userDetails = posix_getpwuid(fileowner('public'));
5858
$user = $userDetails['name'] ?? 'www-data';
5959

60-
if (!$this->confirm("Your webserver user has been detected as [{$user}]: is this correct?", true)) {
60+
if (!$this->confirm("Your webserver user has been detected as <fg=blue>[{$user}]:</> is this correct?", true)) {
6161
$user = $this->anticipate(
6262
'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".',
6363
[
@@ -73,7 +73,7 @@ public function handle()
7373
$groupDetails = posix_getgrgid(filegroup('public'));
7474
$group = $groupDetails['name'] ?? 'www-data';
7575

76-
if (!$this->confirm("Your webserver group has been detected as [{$group}]: is this correct?", true)) {
76+
if (!$this->confirm("Your webserver group has been detected as <fg=blue>[{$group}]:</> is this correct?", true)) {
7777
$group = $this->anticipate(
7878
'Please enter the name of the group running your webserver process. Normally this is the same as your user.',
7979
[
@@ -86,6 +86,7 @@ public function handle()
8686
}
8787

8888
if (!$this->confirm('Are you sure you want to run the upgrade process for your Panel?')) {
89+
$this->warn('Upgrade process terminated by user.');
8990
return;
9091
}
9192
}
@@ -173,8 +174,8 @@ public function handle()
173174
$this->call('up');
174175
});
175176

176-
$this->newLine();
177-
$this->info('Finished running upgrade.');
177+
$this->newLine(2);
178+
$this->info('Panel has been successfully upgraded. Please ensure you also update any Wings instances: https://pterodactyl.io/wings/1.0/upgrading.html');
178179
}
179180

180181
protected function withProgress(ProgressBar $bar, Closure $callback)

0 commit comments

Comments
 (0)