Skip to content

Commit

Permalink
Do not hardcode the php username dummy in Icinga\Application\Platform
Browse files Browse the repository at this point in the history
refs #7163
  • Loading branch information
Johannes Meyer committed Nov 7, 2014
1 parent eadc7d8 commit f85ddeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions application/views/scripts/form/setup-welcome.phtml
Expand Up @@ -65,13 +65,13 @@ $setupTokenPath = rtrim(Icinga::app()->getConfigDir(), '/') . '/setup.token';
); ?></p>
<p><?= t('If you\'ve got the IcingaCLI installed you can do the following:'); ?></p>
<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>
</div>
<p><?= t('In case the IcingaCLI is missing you can create the token manually:'); ?></p>
<div class="code">
<span>sudo mkdir -m 2775 <?= dirname($setupTokenPath); ?> && sudo chgrp <?= Platform::getPhpUser(); ?> <?= dirname($setupTokenPath); ?>;</span>
<span>head -c 12 /dev/urandom | base64 | sudo -u '<?= Platform::getPhpUser(); ?>' tee <?= $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 '<?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?>' tee <?= $setupTokenPath; ?>;</span>
<span>sudo chmod 0660 <?= $setupTokenPath; ?>;</span>
</div>
<p style="font-size: 85%;"><?= sprintf(
Expand Down
2 changes: 0 additions & 2 deletions library/Icinga/Application/Platform.php
Expand Up @@ -156,8 +156,6 @@ public static function getPhpUser()
$userInfo = posix_getpwuid(posix_geteuid());
return $userInfo['name'];
}

return 'php_username';
}

/**
Expand Down

0 comments on commit f85ddeb

Please sign in to comment.