Do not hardcode the php username dummy in Icinga\Application\Platform
refs #7163
This commit is contained in:
parent
eadc7d8415
commit
f85ddeb215
|
@ -65,13 +65,13 @@ $setupTokenPath = rtrim(Icinga::app()->getConfigDir(), '/') . '/setup.token';
|
||||||
); ?></p>
|
); ?></p>
|
||||||
<p><?= t('If you\'ve got the IcingaCLI installed you can do the following:'); ?></p>
|
<p><?= t('If you\'ve got the IcingaCLI installed you can do the following:'); ?></p>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<span>sudo icingacli setup createConfigDirectory <?= Platform::getPhpUser(); ?>;</span>
|
<span>sudo icingacli setup createConfigDirectory <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?>;</span>
|
||||||
<span>sudo icingacli setup generateToken;</span>
|
<span>sudo icingacli setup generateToken;</span>
|
||||||
</div>
|
</div>
|
||||||
<p><?= t('In case the IcingaCLI is missing you can create the token manually:'); ?></p>
|
<p><?= t('In case the IcingaCLI is missing you can create the token manually:'); ?></p>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<span>sudo mkdir -m 2775 <?= dirname($setupTokenPath); ?> && sudo chgrp <?= Platform::getPhpUser(); ?> <?= dirname($setupTokenPath); ?>;</span>
|
<span>sudo mkdir -m 2775 <?= dirname($setupTokenPath); ?> && sudo chgrp <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?> <?= dirname($setupTokenPath); ?>;</span>
|
||||||
<span>head -c 12 /dev/urandom | base64 | sudo -u '<?= Platform::getPhpUser(); ?>' tee <?= $setupTokenPath; ?>;</span>
|
<span>head -c 12 /dev/urandom | base64 | sudo -u '<?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?>' tee <?= $setupTokenPath; ?>;</span>
|
||||||
<span>sudo chmod 0660 <?= $setupTokenPath; ?>;</span>
|
<span>sudo chmod 0660 <?= $setupTokenPath; ?>;</span>
|
||||||
</div>
|
</div>
|
||||||
<p style="font-size: 85%;"><?= sprintf(
|
<p style="font-size: 85%;"><?= sprintf(
|
||||||
|
|
|
@ -156,8 +156,6 @@ class Platform
|
||||||
$userInfo = posix_getpwuid(posix_geteuid());
|
$userInfo = posix_getpwuid(posix_geteuid());
|
||||||
return $userInfo['name'];
|
return $userInfo['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'php_username';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue