mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Allow to override the root user CLI check with COMPOSER_ALLOW_SUPERUSER
This commit is contained in:
parent
7f78822a12
commit
aa0ec15e67
1 changed files with 5 additions and 0 deletions
|
@ -55,6 +55,11 @@ class ConsoleEnsureWebserverUserListener
|
||||||
|
|
||||||
//Check if we are trying to run as root
|
//Check if we are trying to run as root
|
||||||
if ($this->isRunningAsRoot()) {
|
if ($this->isRunningAsRoot()) {
|
||||||
|
//If the COMPOSER_ALLOW_SUPERUSER environment variable is set, we allow running as root
|
||||||
|
if ($_SERVER['COMPOSER_ALLOW_SUPERUSER'] ?? false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$io->warning('You are running this command as root. This is not recommended, as it can cause permission problems. Please run this command as the webserver user "'. ($webserver_user ?? '??') . '" instead.');
|
$io->warning('You are running this command as root. This is not recommended, as it can cause permission problems. Please run this command as the webserver user "'. ($webserver_user ?? '??') . '" instead.');
|
||||||
$io->info('You might have already caused permission problems by running this command as wrong user. If you encounter issues with Part-DB, delete the var/cache directory completely and let it be recreated by Part-DB.');
|
$io->info('You might have already caused permission problems by running this command as wrong user. If you encounter issues with Part-DB, delete the var/cache directory completely and let it be recreated by Part-DB.');
|
||||||
if ($input->isInteractive() && !$io->confirm('Do you want to continue?', false)) {
|
if ($input->isInteractive() && !$io->confirm('Do you want to continue?', false)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue