Separated user from group
This commit is contained in:
parent
2f6351ec00
commit
c56e699985
1 changed files with 25 additions and 11 deletions
|
@ -14,7 +14,8 @@ class UpgradeCommand extends Command
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $signature = 'p:upgrade
|
protected $signature = 'p:upgrade
|
||||||
{--user= : The user (and group) that PHP runs under. All files will be owned by this user (and group).}
|
{--user= : The user that PHP runs under. All files will be owned by this user.}
|
||||||
|
{--group= : The group that PHP runs under. All files will be owned by this group.}
|
||||||
{--url= : The specific archive to download.}
|
{--url= : The specific archive to download.}
|
||||||
{--release= : A specific Pterodactyl version to download from GitHub. Leave blank to use latest.}
|
{--release= : A specific Pterodactyl version to download from GitHub. Leave blank to use latest.}
|
||||||
{--skip-download : If set no archive will be downloaded.}';
|
{--skip-download : If set no archive will be downloaded.}';
|
||||||
|
@ -53,19 +54,32 @@ class UpgradeCommand extends Command
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_null($this->option('user'))) {
|
if (is_null($this->option('user'))) {
|
||||||
$user_details = posix_getpwuid(fileowner('public'));
|
$userDetails = posix_getpwuid(fileowner('public'));
|
||||||
$user = $user_details['name'] ?? 'www-data';
|
$user = $userDetails['name'] ?? 'www-data';
|
||||||
|
|
||||||
$group_details = posix_getgrgid(filegroup('public'));
|
|
||||||
$group = $group_details['name'] ?? 'www-data';
|
|
||||||
|
|
||||||
if (!$this->confirm("Your webserver user (and group) has been detected as [{$user}:{$group}]: is this correct?", true)) {
|
if (!$this->confirm("Your webserver user has been detected as [{$user}]: is this correct?", true)) {
|
||||||
$user = $this->anticipate(
|
$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:www-data", "nginx:nginx", or "apache:apache".',
|
'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".',
|
||||||
[
|
[
|
||||||
'www-data:www-data',
|
'www-data',
|
||||||
'nginx:nginx',
|
'nginx',
|
||||||
'apache:apache',
|
'apache',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_null($this->option('group'))) {
|
||||||
|
$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)) {
|
||||||
|
$group = $this->anticipate(
|
||||||
|
'Please enter the name of the group running your webserver process. Normally this is the same as your user.',
|
||||||
|
[
|
||||||
|
'www-data',
|
||||||
|
'nginx',
|
||||||
|
'apache',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue