You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/Console/Commands/UpgradeCommand.php
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ class UpgradeCommand extends Command
14
14
15
15
/** @var string */
16
16
protected$signature = 'p:upgrade
17
+
{--user= : The user that PHP runs under. All files will be owned by this user.}
17
18
{--url= : The specific archive to download.}
18
19
{--release= : A specific Pterodactyl version to download from GitHub. Leave blank to use latest.}
19
20
{--skip-download : If set no archive will be downloaded.}';
@@ -41,18 +42,35 @@ public function handle()
41
42
$this->line($this->getUrl());
42
43
}
43
44
45
+
$user = 'www-data';
44
46
if ($this->input->isInteractive()) {
45
47
if (!$skipDownload) {
46
48
$skipDownload = !$this->confirm('Would you like to download and unpack the archive files for the latest version?', true);
47
49
}
48
50
51
+
if (is_null($this->option('user'))) {
52
+
$details = posix_getpwuid(fileowner('public'));
53
+
$user = $details['name'] ?? 'www-data';
54
+
55
+
if (!$this->confirm("Your webserver user has been detected as [{$user}]: is this correct?", true)) {
56
+
$user = $this->anticipate(
57
+
'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".',
58
+
[
59
+
'www-data',
60
+
'apache',
61
+
'nginx',
62
+
]
63
+
);
64
+
}
65
+
}
66
+
49
67
if (!$this->confirm('Are you sure you want to run the upgrade process for your Panel?')) {
0 commit comments