cli/setup: Do not use the webserver user's group but 'icingaweb2'

This commit is contained in:
Eric Lippmann 2014-12-30 15:22:53 +01:00
parent 861252b1e7
commit bad7aad05e
1 changed files with 18 additions and 18 deletions

View File

@ -14,30 +14,31 @@ class ConfigCommand extends Command
/** /**
* Create Icinga Web 2's configuration directory * Create Icinga Web 2's configuration directory
* *
* This command creates the configuration directory for Icinga Web 2. The `group' argument
* is mandatory and should be the groupname of the user your web server is running as.
*
* USAGE: * USAGE:
* *
* icingacli setup config directory <group> [options] * icingacli setup config directory [options]
* *
* OPTIONS: * OPTIONS:
* *
* --mode The access mode to use. Default is: 2770 * --mode=<mode> The access mode to use [2770]
* --path The path to the configuration directory. If omitted the default is used. *
* --path=<directory> Path to Icinga Web 2's configuration files [/etc/icingaweb2]
*
* --group=<group> Owner group for the configuration directory [icingaweb2]
* *
* EXAMPLES: * EXAMPLES:
* *
* icingacli setup config directory apache * icingacli setup config directory
* icingacli setup config directory apache --mode 2775 *
* icingacli setup config directory apache --path /some/path * icingacli setup config directory --mode 2775 --config /opt/icingaweb2/etc
*/ */
public function directoryAction() public function directoryAction()
{ {
$group = $this->params->getStandalone(); $group = trim($this->params->get('group', 'icingaweb2'));
if ($group === null) { if (strlen($group) === 0) {
$this->fail($this->translate('The `group\' argument is mandatory.')); $this->fail($this->translate(
return false; 'The argument --group expects a owner group for the configuration directory'
));
} }
$path = $this->params->get('path', $this->app->getConfigDir()); $path = $this->params->get('path', $this->app->getConfigDir());
@ -81,16 +82,15 @@ class ConfigCommand extends Command
* *
* --file=<filename> Write configuration to file [stdout] * --file=<filename> Write configuration to file [stdout]
* *
*
* EXAMPLES: * EXAMPLES:
* *
* icingacli setup config webserver apache * icingacli setup config webserver apache
* *
* icingacli setup config webserver apache --path /icingaweb2 --document-root /usr/share/icingaweb2/public --config=/etc/icingaweb2 * icingacli setup config webserver apache --path /icingaweb2 --document-root /usr/share/icingaweb2/public --config=/etc/icingaweb2
* *
* icingacli setup config webserver apache --file /etc/apache2/conf.d/icingaweb2.conf * icingacli setup config webserver apache --file /etc/apache2/conf.d/icingaweb2.conf
* *
* icingacli setup config webserver nginx * icingacli setup config webserver nginx
*/ */
public function webserverAction() public function webserverAction()
{ {