parent
4974f582d3
commit
ca66480ba7
|
@ -124,12 +124,7 @@ class MonitoringWizard extends Wizard implements SetupWizard
|
||||||
$pageData = $this->getPageData();
|
$pageData = $this->getPageData();
|
||||||
$setup = new Setup();
|
$setup = new Setup();
|
||||||
|
|
||||||
$setup->addStep(
|
$setup->addStep(new MakeDirStep(array($this->getConfigDir() . '/modules/monitoring'), 0775));
|
||||||
new MakeDirStep(
|
|
||||||
array($this->getConfigDir() . '/modules/monitoring'),
|
|
||||||
$pageData['setup_general_config']['global_filemode']
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$setup->addStep(
|
$setup->addStep(
|
||||||
new BackendStep(array(
|
new BackendStep(array(
|
||||||
|
|
|
@ -20,13 +20,13 @@ class ConfigCommand extends Command
|
||||||
*
|
*
|
||||||
* OPTIONS:
|
* OPTIONS:
|
||||||
*
|
*
|
||||||
* --mode The access mode to use. Default is: 2775
|
* --mode The access mode to use. Default is: 2770
|
||||||
* --path The path to the configuration directory. If omitted the default is used.
|
* --path The path to the configuration directory. If omitted the default is used.
|
||||||
*
|
*
|
||||||
* EXAMPLES:
|
* EXAMPLES:
|
||||||
*
|
*
|
||||||
* icingacli setup config createDirectory apache
|
* icingacli setup config createDirectory apache
|
||||||
* icingacli setup config createDirectory apache --mode 2770
|
* icingacli setup config createDirectory apache --mode 2775
|
||||||
* icingacli setup config createDirectory apache --path /some/path
|
* icingacli setup config createDirectory apache --path /some/path
|
||||||
*/
|
*/
|
||||||
public function createDirectoryAction()
|
public function createDirectoryAction()
|
||||||
|
@ -43,7 +43,7 @@ class ConfigCommand extends Command
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mode = octdec($this->params->get('mode', '2775'));
|
$mode = octdec($this->params->get('mode', '2770'));
|
||||||
if (false === mkdir($path)) {
|
if (false === mkdir($path)) {
|
||||||
$this->fail(sprintf($this->translate('Unable to create path: %s'), $path));
|
$this->fail(sprintf($this->translate('Unable to create path: %s'), $path));
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -71,7 +71,7 @@ $cliPath = realpath(Icinga::app()->getApplicationDir() . '/../bin/icingacli');
|
||||||
</div>
|
</div>
|
||||||
<p><?= mt('setup', 'In case the IcingaCLI is missing you can create the token manually:'); ?></p>
|
<p><?= mt('setup', 'In case the IcingaCLI is missing you can create the token manually:'); ?></p>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<span>su <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?> && mkdir -m 2775 <?= dirname($setupTokenPath); ?>;</span>
|
<span>su <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?> && mkdir -m 2770 <?= dirname($setupTokenPath); ?>;</span>
|
||||||
<span>head -c 12 /dev/urandom | base64 | tee <?= $setupTokenPath; ?>;</span>
|
<span>head -c 12 /dev/urandom | base64 | tee <?= $setupTokenPath; ?>;</span>
|
||||||
<span>chmod 0660 <?= $setupTokenPath; ?>;</span>
|
<span>chmod 0660 <?= $setupTokenPath; ?>;</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,12 +16,12 @@ class MakeDirStep extends Step
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $paths
|
* @param array $paths
|
||||||
* @param string $dirmode
|
* @param int $dirmode
|
||||||
*/
|
*/
|
||||||
public function __construct($paths, $dirmode)
|
public function __construct($paths, $dirmode)
|
||||||
{
|
{
|
||||||
$this->paths = $paths;
|
$this->paths = $paths;
|
||||||
$this->dirmode = octdec($dirmode) | octdec('111'); // Make sure that the directories can be traversed
|
$this->dirmode = $dirmode;
|
||||||
$this->errors = array();
|
$this->errors = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -355,7 +355,7 @@ class WebWizard extends Wizard implements SetupWizard
|
||||||
$configDir . '/preferences',
|
$configDir . '/preferences',
|
||||||
$configDir . '/enabledModules'
|
$configDir . '/enabledModules'
|
||||||
),
|
),
|
||||||
$pageData['setup_general_config']['global_filemode']
|
0775
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue