parent
6c664b72aa
commit
79493592bb
|
@ -18,7 +18,7 @@ class SetupCommand extends Command
|
||||||
/**
|
/**
|
||||||
* Display the current setup token
|
* Display the current setup token
|
||||||
*
|
*
|
||||||
* Shows you the current setup token used to authenticate when installing Icinga Web 2 using the web-based wizard
|
* Shows you the current setup token used to authenticate when setting up Icinga Web 2 using the web-based wizard
|
||||||
*
|
*
|
||||||
* USAGE:
|
* USAGE:
|
||||||
*
|
*
|
||||||
|
@ -39,7 +39,7 @@ class SetupCommand extends Command
|
||||||
/**
|
/**
|
||||||
* Create a new setup token
|
* Create a new setup token
|
||||||
*
|
*
|
||||||
* Re-generates the setup token used to authenticate when installing Icinga Web 2 using the web-based wizard.
|
* Re-generates the setup token used to authenticate when setting up Icinga Web 2 using the web-based wizard.
|
||||||
*
|
*
|
||||||
* USAGE:
|
* USAGE:
|
||||||
*
|
*
|
||||||
|
|
|
@ -107,7 +107,7 @@ class AuthenticationController extends ActionController
|
||||||
throw new ConfigurationError(
|
throw new ConfigurationError(
|
||||||
$this->translate(
|
$this->translate(
|
||||||
'No authentication methods available. Did you create'
|
'No authentication methods available. Did you create'
|
||||||
. ' authentication.ini when installing Icinga Web 2?'
|
. ' authentication.ini when setting up Icinga Web 2?'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
use Icinga\Application\WebSetup;
|
use Icinga\Application\WebWizard;
|
||||||
use Icinga\Web\Controller\ActionController;
|
use Icinga\Web\Controller\ActionController;
|
||||||
|
|
||||||
class SetupController extends ActionController
|
class SetupController extends ActionController
|
||||||
|
@ -17,15 +17,15 @@ class SetupController extends ActionController
|
||||||
protected $requiresAuthentication = false;
|
protected $requiresAuthentication = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the web wizard and run the installation once finished
|
* Show the web wizard and run the configuration once finished
|
||||||
*/
|
*/
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$wizard = new WebSetup();
|
$wizard = new WebWizard();
|
||||||
|
|
||||||
if ($wizard->isFinished()) {
|
if ($wizard->isFinished()) {
|
||||||
$installer = $wizard->getInstaller();
|
$setup = $wizard->getSetup();
|
||||||
$success = $installer->run();
|
$success = $setup->run();
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$wizard->clearSession();
|
$wizard->clearSession();
|
||||||
} else {
|
} else {
|
||||||
|
@ -33,7 +33,7 @@ class SetupController extends ActionController
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->success = $success;
|
$this->view->success = $success;
|
||||||
$this->view->report = $installer->getReport();
|
$this->view->report = $setup->getReport();
|
||||||
} else {
|
} else {
|
||||||
$wizard->handleRequest();
|
$wizard->handleRequest();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,8 @@ class DbResourcePage extends Form
|
||||||
'description',
|
'description',
|
||||||
array(
|
array(
|
||||||
'value' => t(
|
'value' => t(
|
||||||
'Now please configure your database resource. Note that the database itself does not need'
|
'Now please configure your database resource. Note that the database itself does not need to'
|
||||||
. ' to exist at this time as it is going to be created when installing Icinga Web 2.'
|
. ' exist at this time as it is going to be created once the wizard is about to be finished.'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@ use Icinga\Web\Form;
|
||||||
use Icinga\Web\Setup\Requirements;
|
use Icinga\Web\Setup\Requirements;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wizard page to list installation requirements
|
* Wizard page to list setup requirements
|
||||||
*/
|
*/
|
||||||
class RequirementsPage extends Form
|
class RequirementsPage extends Form
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Icinga\Web\Form;
|
||||||
class SummaryPage extends Form
|
class SummaryPage extends Form
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The title of what is being installed
|
* The title of what is being set up
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
@ -35,7 +35,7 @@ class SummaryPage extends Form
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the title of what is being installed
|
* Set the title of what is being set up
|
||||||
*
|
*
|
||||||
* @param string $title
|
* @param string $title
|
||||||
*/
|
*/
|
||||||
|
@ -45,7 +45,7 @@ class SummaryPage extends Form
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the title of what is being installed
|
* Return the title of what is being set up
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
t(
|
t(
|
||||||
'You seem not to have Icinga Web 2 configured yet so it\'s not possible to log in without any defined '
|
'You seem not to have Icinga Web 2 configured yet so it\'s not possible to log in without any defined '
|
||||||
. 'authentication method. Please define a authentication method by following the instructions in the'
|
. 'authentication method. Please define a authentication method by following the instructions in the'
|
||||||
. ' %1$sdocumentation%3$s or by using our %2$sweb-based installer%3$s.'
|
. ' %1$sdocumentation%3$s or by using our %2$sweb-based setup-wizard%3$s.'
|
||||||
),
|
),
|
||||||
'<a href="' . 'documention-link-here' . '" title="Icinga Web 2 Documentation">', // TODO: Documentation link
|
'<a href="' . 'documention-link-here' . '" title="Icinga Web 2 Documentation">', // TODO: Documentation link
|
||||||
'<a href="' . $this->href('setup') . '" title="Icinga Web 2 Installer">',
|
'<a href="' . $this->href('setup') . '" title="Icinga Web 2 Setup-Wizard">',
|
||||||
'</a>'
|
'</a>'
|
||||||
); ?></div>
|
); ?></div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
|
@ -4,7 +4,7 @@ use Icinga\Web\Wizard;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="module-menu">
|
<div class="module-menu">
|
||||||
<p><?= t('The following modules are available for installation using a web-based wizard as well. To install a module, just complete its wizard and advance to the summary!'); ?></p>
|
<p><?= t('The following modules can be set up by using a web-based wizard as well. To setup a module, just complete its wizard and advance to the summary!'); ?></p>
|
||||||
<p><?= t('You can freely switch to a module\'s wizard by clicking its name below. The wizard you are currently looking at is written in bold. A small tick is shown on the right once a wizard has been completed.'); ?></p>
|
<p><?= t('You can freely switch to a module\'s wizard by clicking its name below. The wizard you are currently looking at is written in bold. A small tick is shown on the right once a wizard has been completed.'); ?></p>
|
||||||
<form name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>">
|
<form name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>">
|
||||||
<?= $form->getElement($form->getTokenElementName()); ?>
|
<?= $form->getElement($form->getTokenElementName()); ?>
|
||||||
|
|
|
@ -5,9 +5,9 @@ use Icinga\Web\Wizard;
|
||||||
?>
|
?>
|
||||||
<p><?= sprintf(
|
<p><?= sprintf(
|
||||||
t(
|
t(
|
||||||
'The wizard is now complete. You can review the changes supposed to be made before issuing the actual installation'
|
'The wizard is now complete. You can review the changes supposed to be made before setting up %1$s.'
|
||||||
. ' of %1$s. Make sure that everything is correct (Feel free to navigate back to make any corrections!) so'
|
. ' Make sure that everything is correct (Feel free to navigate back to make any corrections!) so'
|
||||||
. ' that you can start using %1$s right after the installation has been finished.'
|
. ' that you can start using %1$s right after it has successfully been set up.'
|
||||||
),
|
),
|
||||||
$form->getSubjectTitle()
|
$form->getSubjectTitle()
|
||||||
); ?></p>
|
); ?></p>
|
||||||
|
@ -25,6 +25,6 @@ use Icinga\Web\Wizard;
|
||||||
<?= $form->getElement($form->getUidElementName()); ?>
|
<?= $form->getElement($form->getUidElementName()); ?>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<?= $form->getElement(Wizard::BTN_PREV); ?>
|
<?= $form->getElement(Wizard::BTN_PREV); ?>
|
||||||
<?= $form->getElement(Wizard::BTN_NEXT)->setAttrib('class', 'install'); ?>
|
<?= $form->getElement(Wizard::BTN_NEXT)->setAttrib('class', 'finish'); ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
|
@ -9,7 +9,7 @@ $setupTokenPath = rtrim(Icinga::app()->getConfigDir(), '/') . '/setup.token';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="welcome-page">
|
<div class="welcome-page">
|
||||||
<h2><?= t('Welcome to the installation of Icinga Web 2!') ?></h2>
|
<h2><?= t('Welcome to the configuration of Icinga Web 2!') ?></h2>
|
||||||
<!-- TODO: Remove this once we release the first public version -->
|
<!-- TODO: Remove this once we release the first public version -->
|
||||||
<div style="border:1px solid #777;border-radius:1em;background-color:beige;padding:1em;margin-bottom:1em;display:inline-block;">
|
<div style="border:1px solid #777;border-radius:1em;background-color:beige;padding:1em;margin-bottom:1em;display:inline-block;">
|
||||||
Icinga Web 2 is still in development and not meant for production deployment.
|
Icinga Web 2 is still in development and not meant for production deployment.
|
||||||
|
@ -36,12 +36,12 @@ $setupTokenPath = rtrim(Icinga::app()->getConfigDir(), '/') . '/setup.token';
|
||||||
</div>
|
</div>
|
||||||
<?php if (false === file_exists($setupTokenPath) && file_exists(Config::resolvePath('config.ini'))): ?>
|
<?php if (false === file_exists($setupTokenPath) && file_exists(Config::resolvePath('config.ini'))): ?>
|
||||||
<p class="restart-warning"><?= t(
|
<p class="restart-warning"><?= t(
|
||||||
'You\'ve already completed the installation of Icinga Web 2. Note that most of your configuration'
|
'You\'ve already completed the configuration of Icinga Web 2. Note that most of your configuration'
|
||||||
. ' files will be overwritten in case you\'ll re-configure Icinga Web 2 using this wizard!'
|
. ' files will be overwritten in case you\'ll re-configure Icinga Web 2 using this wizard!'
|
||||||
); ?></p>
|
); ?></p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<p><?= t(
|
<p><?= t(
|
||||||
'This wizard will guide you through the installation of Icinga Web 2. Once completed and successfully'
|
'This wizard will guide you through the configuration of Icinga Web 2. Once completed and successfully'
|
||||||
. ' finished you are able to log in and to explore all the new and stunning features!'
|
. ' finished you are able to log in and to explore all the new and stunning features!'
|
||||||
); ?></p>
|
); ?></p>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
|
@ -125,7 +125,7 @@ if ($notifications->hasMessages()) {
|
||||||
</tr></tbody></table>
|
</tr></tbody></table>
|
||||||
</div>
|
</div>
|
||||||
<div class="step" style="width: 10%;">
|
<div class="step" style="width: 10%;">
|
||||||
<h1><?= t('Installation', 'setup.progress'); ?></h1>
|
<h1><?= t('Finish', 'setup.progress'); ?></h1>
|
||||||
<?php $stateClass = $finished ? ' active' : ''; ?>
|
<?php $stateClass = $finished ? ' active' : ''; ?>
|
||||||
<table><tbody><tr>
|
<table><tbody><tr>
|
||||||
<td class="left"><div class="line left<?= $stateClass; ?>"></div></td>
|
<td class="left"><div class="line left<?= $stateClass; ?>"></div></td>
|
||||||
|
@ -137,7 +137,7 @@ if ($notifications->hasMessages()) {
|
||||||
</div>
|
</div>
|
||||||
<div class="setup-content">
|
<div class="setup-content">
|
||||||
<?php if ($finished): ?>
|
<?php if ($finished): ?>
|
||||||
<?= $this->render('setup/parts/install.phtml'); ?>
|
<?= $this->render('setup/parts/finish.phtml'); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?= $this->render('setup/parts/wizard.phtml'); ?>
|
<?= $this->render('setup/parts/wizard.phtml'); ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div id="installer">
|
<div id="setup-finish">
|
||||||
<div class="report">
|
<div class="report">
|
||||||
<?php $firstLine = true; ?>
|
<?php $firstLine = true; ?>
|
||||||
<?php foreach ($report as $entry): ?>
|
<?php foreach ($report as $entry): ?>
|
||||||
|
@ -11,9 +11,9 @@
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php if ($success): ?>
|
<?php if ($success): ?>
|
||||||
<p class="success"><?= t('Congratulations! The installation of Icinga Web 2 has been successfully completed.'); ?></p>
|
<p class="success"><?= t('Congratulations! Icinga Web 2 has been successfully set up.'); ?></p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<p class="failure"><?= t('Sorry! The installation of Icinga Web 2 has failed.'); ?></p>
|
<p class="failure"><?= t('Sorry! Failed to set up Icinga Web 2 successfully.'); ?></p>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
|
@ -26,8 +26,8 @@ use Icinga\Installation\AuthenticationStep;
|
||||||
use Icinga\Web\Form;
|
use Icinga\Web\Form;
|
||||||
use Icinga\Web\Wizard;
|
use Icinga\Web\Wizard;
|
||||||
use Icinga\Web\Request;
|
use Icinga\Web\Request;
|
||||||
|
use Icinga\Web\Setup\Setup;
|
||||||
use Icinga\Web\Setup\DbTool;
|
use Icinga\Web\Setup\DbTool;
|
||||||
use Icinga\Web\Setup\Installer;
|
|
||||||
use Icinga\Web\Setup\MakeDirStep;
|
use Icinga\Web\Setup\MakeDirStep;
|
||||||
use Icinga\Web\Setup\SetupWizard;
|
use Icinga\Web\Setup\SetupWizard;
|
||||||
use Icinga\Web\Setup\Requirements;
|
use Icinga\Web\Setup\Requirements;
|
||||||
|
@ -35,7 +35,7 @@ use Icinga\Web\Setup\Requirements;
|
||||||
/**
|
/**
|
||||||
* Icinga Web 2 Setup Wizard
|
* Icinga Web 2 Setup Wizard
|
||||||
*/
|
*/
|
||||||
class WebSetup extends Wizard implements SetupWizard
|
class WebWizard extends Wizard implements SetupWizard
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The privileges required by Icinga Web 2 to setup the database
|
* The privileges required by Icinga Web 2 to setup the database
|
||||||
|
@ -138,7 +138,7 @@ class WebSetup extends Wizard implements SetupWizard
|
||||||
$page->setResourceConfig($this->getPageData('setup_db_resource'));
|
$page->setResourceConfig($this->getPageData('setup_db_resource'));
|
||||||
} elseif ($page->getName() === 'setup_summary') {
|
} elseif ($page->getName() === 'setup_summary') {
|
||||||
$page->setSubjectTitle('Icinga Web 2');
|
$page->setSubjectTitle('Icinga Web 2');
|
||||||
$page->setSummary($this->getInstaller()->getSummary());
|
$page->setSummary($this->getSetup()->getSummary());
|
||||||
} elseif ($page->getName() === 'setup_db_resource') {
|
} elseif ($page->getName() === 'setup_db_resource') {
|
||||||
$ldapData = $this->getPageData('setup_ldap_resource');
|
$ldapData = $this->getPageData('setup_ldap_resource');
|
||||||
if ($ldapData !== null && $request->getPost('name') === $ldapData['name']) {
|
if ($ldapData !== null && $request->getPost('name') === $ldapData['name']) {
|
||||||
|
@ -251,7 +251,7 @@ class WebSetup extends Wizard implements SetupWizard
|
||||||
if ($index === 0) {
|
if ($index === 0) {
|
||||||
$page->getElement(static::BTN_NEXT)->setLabel(t('Start', 'setup.welcome.btn.next'));
|
$page->getElement(static::BTN_NEXT)->setLabel(t('Start', 'setup.welcome.btn.next'));
|
||||||
} elseif ($index === count($pages) - 1) {
|
} elseif ($index === count($pages) - 1) {
|
||||||
$page->getElement(static::BTN_NEXT)->setLabel(t('Install Icinga Web 2', 'setup.summary.btn.finish'));
|
$page->getElement(static::BTN_NEXT)->setLabel(t('Setup Icinga Web 2', 'setup.summary.btn.finish'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,12 +270,12 @@ class WebSetup extends Wizard implements SetupWizard
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SetupWizard::getInstaller()
|
* @see SetupWizard::getSetup()
|
||||||
*/
|
*/
|
||||||
public function getInstaller()
|
public function getSetup()
|
||||||
{
|
{
|
||||||
$pageData = $this->getPageData();
|
$pageData = $this->getPageData();
|
||||||
$installer = new Installer();
|
$setup = new Setup();
|
||||||
|
|
||||||
if (isset($pageData['setup_db_resource'])
|
if (isset($pageData['setup_db_resource'])
|
||||||
&& ! $pageData['setup_db_resource']['skip_validation']
|
&& ! $pageData['setup_db_resource']['skip_validation']
|
||||||
|
@ -283,7 +283,7 @@ class WebSetup extends Wizard implements SetupWizard
|
||||||
|| ! $pageData['setup_database_creation']['skip_validation']
|
|| ! $pageData['setup_database_creation']['skip_validation']
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$installer->addStep(
|
$setup->addStep(
|
||||||
new DatabaseStep(array(
|
new DatabaseStep(array(
|
||||||
'tables' => $this->databaseTables,
|
'tables' => $this->databaseTables,
|
||||||
'privileges' => $this->databaseUsagePrivileges,
|
'privileges' => $this->databaseUsagePrivileges,
|
||||||
|
@ -298,7 +298,7 @@ class WebSetup extends Wizard implements SetupWizard
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$installer->addStep(
|
$setup->addStep(
|
||||||
new GeneralConfigStep(array(
|
new GeneralConfigStep(array(
|
||||||
'generalConfig' => $pageData['setup_general_config'],
|
'generalConfig' => $pageData['setup_general_config'],
|
||||||
'preferencesType' => $pageData['setup_preferences_type']['type'],
|
'preferencesType' => $pageData['setup_preferences_type']['type'],
|
||||||
|
@ -320,7 +320,7 @@ class WebSetup extends Wizard implements SetupWizard
|
||||||
$adminAccountData['password'] = $pageData['setup_admin_account']['new_user_password'];
|
$adminAccountData['password'] = $pageData['setup_admin_account']['new_user_password'];
|
||||||
}
|
}
|
||||||
$authType = $pageData['setup_authentication_type']['type'];
|
$authType = $pageData['setup_authentication_type']['type'];
|
||||||
$installer->addStep(
|
$setup->addStep(
|
||||||
new AuthenticationStep(array(
|
new AuthenticationStep(array(
|
||||||
'adminAccountData' => $adminAccountData,
|
'adminAccountData' => $adminAccountData,
|
||||||
'fileMode' => $pageData['setup_general_config']['global_filemode'],
|
'fileMode' => $pageData['setup_general_config']['global_filemode'],
|
||||||
|
@ -332,7 +332,7 @@ class WebSetup extends Wizard implements SetupWizard
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($pageData['setup_db_resource']) || isset($pageData['setup_ldap_resource'])) {
|
if (isset($pageData['setup_db_resource']) || isset($pageData['setup_ldap_resource'])) {
|
||||||
$installer->addStep(
|
$setup->addStep(
|
||||||
new ResourceStep(array(
|
new ResourceStep(array(
|
||||||
'fileMode' => $pageData['setup_general_config']['global_filemode'],
|
'fileMode' => $pageData['setup_general_config']['global_filemode'],
|
||||||
'dbResourceConfig' => isset($pageData['setup_db_resource'])
|
'dbResourceConfig' => isset($pageData['setup_db_resource'])
|
||||||
|
@ -346,7 +346,7 @@ class WebSetup extends Wizard implements SetupWizard
|
||||||
}
|
}
|
||||||
|
|
||||||
$configDir = $this->getConfigDir();
|
$configDir = $this->getConfigDir();
|
||||||
$installer->addStep(
|
$setup->addStep(
|
||||||
new MakeDirStep(
|
new MakeDirStep(
|
||||||
array(
|
array(
|
||||||
$configDir . '/modules',
|
$configDir . '/modules',
|
||||||
|
@ -359,11 +359,11 @@ class WebSetup extends Wizard implements SetupWizard
|
||||||
|
|
||||||
foreach ($this->getPage('setup_modules')->setPageData($this->getPageData())->getWizards() as $wizard) {
|
foreach ($this->getPage('setup_modules')->setPageData($this->getPageData())->getWizards() as $wizard) {
|
||||||
if ($wizard->isFinished()) {
|
if ($wizard->isFinished()) {
|
||||||
$installer->addSteps($wizard->getInstaller()->getSteps());
|
$setup->addSteps($wizard->getSetup()->getSteps());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $installer;
|
return $setup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -5,10 +5,10 @@
|
||||||
namespace Icinga\Exception;
|
namespace Icinga\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class InstallException
|
* Class SetupException
|
||||||
*
|
*
|
||||||
* Used to indicate that a installation should be aborted.
|
* Used to indicate that a setup should be aborted.
|
||||||
*/
|
*/
|
||||||
class InstallException extends IcingaException
|
class SetupException extends IcingaException
|
||||||
{
|
{
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@ use PDOException;
|
||||||
use Icinga\Web\Setup\Step;
|
use Icinga\Web\Setup\Step;
|
||||||
use Icinga\Web\Setup\DbTool;
|
use Icinga\Web\Setup\DbTool;
|
||||||
use Icinga\Application\Icinga;
|
use Icinga\Application\Icinga;
|
||||||
use Icinga\Exception\InstallException;
|
use Icinga\Exception\SetupException;
|
||||||
|
|
||||||
class DatabaseStep extends Step
|
class DatabaseStep extends Step
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ class DatabaseStep extends Step
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->error = $e;
|
$this->error = $e;
|
||||||
throw new InstallException();
|
throw new SetupException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->error = false;
|
$this->error = false;
|
||||||
|
|
|
@ -13,7 +13,7 @@ use Icinga\Util\File;
|
||||||
use Icinga\Exception\ConfigurationError;
|
use Icinga\Exception\ConfigurationError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class to ease working with databases when installing Icinga Web 2 or one of its modules
|
* Utility class to ease working with databases when setting up Icinga Web 2 or one of its modules
|
||||||
*/
|
*/
|
||||||
class DbTool
|
class DbTool
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,8 +45,8 @@ class MakeDirStep extends Step
|
||||||
|
|
||||||
public function getSummary()
|
public function getSummary()
|
||||||
{
|
{
|
||||||
// This step is usually being used for directories which are required for the installation but are
|
// This step is usually being used for directories which are required for the configuration but
|
||||||
// not configured in any way by the user. So there is no need to show a summary for this step.
|
// are not defined in any way by the user. So there is no need to show a summary for this step.
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getReport()
|
public function getReport()
|
||||||
|
|
|
@ -6,12 +6,12 @@ namespace Icinga\Web\Setup;
|
||||||
|
|
||||||
use ArrayIterator;
|
use ArrayIterator;
|
||||||
use IteratorAggregate;
|
use IteratorAggregate;
|
||||||
use Icinga\Exception\InstallException;
|
use Icinga\Exception\SetupException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container for multiple installation steps
|
* Container for multiple configuration steps
|
||||||
*/
|
*/
|
||||||
class Installer implements IteratorAggregate
|
class Setup implements IteratorAggregate
|
||||||
{
|
{
|
||||||
protected $steps;
|
protected $steps;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class Installer implements IteratorAggregate
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the installation and return whether it succeeded
|
* Run the configuration and return whether it succeeded
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
@ -57,7 +57,7 @@ class Installer implements IteratorAggregate
|
||||||
foreach ($this->steps as $step) {
|
foreach ($this->steps as $step) {
|
||||||
$this->state &= $step->apply();
|
$this->state &= $step->apply();
|
||||||
}
|
}
|
||||||
} catch (InstallException $e) {
|
} catch (SetupException $_) {
|
||||||
$this->state = false;
|
$this->state = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,16 +5,16 @@
|
||||||
namespace Icinga\Web\Setup;
|
namespace Icinga\Web\Setup;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for setup wizards providing an installer and requirements
|
* Interface for wizards providing a setup and requirements
|
||||||
*/
|
*/
|
||||||
interface SetupWizard
|
interface SetupWizard
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Return the installer for this wizard
|
* Return the setup for this wizard
|
||||||
*
|
*
|
||||||
* @return Installer
|
* @return Setup
|
||||||
*/
|
*/
|
||||||
public function getInstaller();
|
public function getSetup();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the requirements of this wizard
|
* Return the requirements of this wizard
|
||||||
|
|
|
@ -5,26 +5,26 @@
|
||||||
namespace Icinga\Web\Setup;
|
namespace Icinga\Web\Setup;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to implement functionality for a single installation step
|
* Class to implement functionality for a single setup step
|
||||||
*/
|
*/
|
||||||
abstract class Step
|
abstract class Step
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Apply this step's installation changes
|
* Apply this step's configuration changes
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
abstract public function apply();
|
abstract public function apply();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a HTML representation of this step's installation changes supposed to be made
|
* Return a HTML representation of this step's configuration changes supposed to be made
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
abstract public function getSummary();
|
abstract public function getSummary();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a HTML representation of this step's installation changes that were made
|
* Return a HTML representation of this step's configuration changes that were made
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,7 +20,10 @@ class WelcomePage extends Form
|
||||||
new Note(
|
new Note(
|
||||||
'welcome',
|
'welcome',
|
||||||
array(
|
array(
|
||||||
'value' => mt('monitoring', 'Welcome to the installation of the monitoring module for Icinga Web 2!'),
|
'value' => mt(
|
||||||
|
'monitoring',
|
||||||
|
'Welcome to the configuration of the monitoring module for Icinga Web 2!'
|
||||||
|
),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper',
|
'ViewHelper',
|
||||||
array('HtmlTag', array('tag' => 'h2'))
|
array('HtmlTag', array('tag' => 'h2'))
|
||||||
|
|
|
@ -18,7 +18,7 @@ $this->provideConfigTab('security', array(
|
||||||
'title' => 'Security',
|
'title' => 'Security',
|
||||||
'url' => 'config/security'
|
'url' => 'config/security'
|
||||||
));
|
));
|
||||||
$this->provideSetupWizard('Icinga\Module\Monitoring\Setup');
|
$this->provideSetupWizard('Icinga\Module\Monitoring\MonitoringWizard');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Available Search Urls
|
* Available Search Urls
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Icinga\Module\Monitoring;
|
||||||
use Icinga\Web\Form;
|
use Icinga\Web\Form;
|
||||||
use Icinga\Web\Wizard;
|
use Icinga\Web\Wizard;
|
||||||
use Icinga\Web\Request;
|
use Icinga\Web\Request;
|
||||||
use Icinga\Web\Setup\Installer;
|
use Icinga\Web\Setup\Setup;
|
||||||
use Icinga\Web\Setup\MakeDirStep;
|
use Icinga\Web\Setup\MakeDirStep;
|
||||||
use Icinga\Web\Setup\EnableModuleStep;
|
use Icinga\Web\Setup\EnableModuleStep;
|
||||||
use Icinga\Web\Setup\SetupWizard;
|
use Icinga\Web\Setup\SetupWizard;
|
||||||
|
@ -26,7 +26,7 @@ use Icinga\Module\Monitoring\Form\Setup\LivestatusResourcePage;
|
||||||
/**
|
/**
|
||||||
* Monitoring Module Setup Wizard
|
* Monitoring Module Setup Wizard
|
||||||
*/
|
*/
|
||||||
class Setup extends Wizard implements SetupWizard
|
class MonitoringWizard extends Wizard implements SetupWizard
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @see Wizard::init()
|
* @see Wizard::init()
|
||||||
|
@ -50,7 +50,7 @@ class Setup extends Wizard implements SetupWizard
|
||||||
if ($page->getName() === 'setup_requirements') {
|
if ($page->getName() === 'setup_requirements') {
|
||||||
$page->setRequirements($this->getRequirements());
|
$page->setRequirements($this->getRequirements());
|
||||||
} elseif ($page->getName() === 'setup_summary') {
|
} elseif ($page->getName() === 'setup_summary') {
|
||||||
$page->setSummary($this->getInstaller()->getSummary());
|
$page->setSummary($this->getSetup()->getSummary());
|
||||||
$page->setSubjectTitle(mt('monitoring', 'the monitoring module', 'setup.summary.subject'));
|
$page->setSubjectTitle(mt('monitoring', 'the monitoring module', 'setup.summary.subject'));
|
||||||
} elseif (
|
} elseif (
|
||||||
$this->getDirection() === static::FORWARD
|
$this->getDirection() === static::FORWARD
|
||||||
|
@ -114,27 +114,27 @@ class Setup extends Wizard implements SetupWizard
|
||||||
$page->getElement(static::BTN_NEXT)->setLabel(t('Start', 'setup.welcome.btn.next'));
|
$page->getElement(static::BTN_NEXT)->setLabel(t('Start', 'setup.welcome.btn.next'));
|
||||||
} elseif ($index === count($pages) - 1) {
|
} elseif ($index === count($pages) - 1) {
|
||||||
$page->getElement(static::BTN_NEXT)->setLabel(
|
$page->getElement(static::BTN_NEXT)->setLabel(
|
||||||
mt('monitoring', 'Install the monitoring module for Icinga Web 2', 'setup.summary.btn.finish')
|
mt('monitoring', 'Setup the monitoring module for Icinga Web 2', 'setup.summary.btn.finish')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SetupWizard::getInstaller()
|
* @see SetupWizard::getSetup()
|
||||||
*/
|
*/
|
||||||
public function getInstaller()
|
public function getSetup()
|
||||||
{
|
{
|
||||||
$pageData = $this->getPageData();
|
$pageData = $this->getPageData();
|
||||||
$installer = new Installer();
|
$setup = new Setup();
|
||||||
|
|
||||||
$installer->addStep(
|
$setup->addStep(
|
||||||
new MakeDirStep(
|
new MakeDirStep(
|
||||||
array($this->getConfigDir() . '/modules/monitoring'),
|
array($this->getConfigDir() . '/modules/monitoring'),
|
||||||
$pageData['setup_general_config']['global_filemode']
|
$pageData['setup_general_config']['global_filemode']
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$installer->addStep(
|
$setup->addStep(
|
||||||
new BackendStep(array(
|
new BackendStep(array(
|
||||||
'backendConfig' => $pageData['setup_monitoring_backend'],
|
'backendConfig' => $pageData['setup_monitoring_backend'],
|
||||||
'resourceConfig' => isset($pageData['setup_monitoring_ido'])
|
'resourceConfig' => isset($pageData['setup_monitoring_ido'])
|
||||||
|
@ -144,23 +144,23 @@ class Setup extends Wizard implements SetupWizard
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
|
||||||
$installer->addStep(
|
$setup->addStep(
|
||||||
new InstanceStep(array(
|
new InstanceStep(array(
|
||||||
'instanceConfig' => $pageData['setup_monitoring_instance'],
|
'instanceConfig' => $pageData['setup_monitoring_instance'],
|
||||||
'fileMode' => $pageData['setup_general_config']['global_filemode']
|
'fileMode' => $pageData['setup_general_config']['global_filemode']
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
|
||||||
$installer->addStep(
|
$setup->addStep(
|
||||||
new SecurityStep(array(
|
new SecurityStep(array(
|
||||||
'securityConfig' => $pageData['setup_monitoring_security'],
|
'securityConfig' => $pageData['setup_monitoring_security'],
|
||||||
'fileMode' => $pageData['setup_general_config']['global_filemode']
|
'fileMode' => $pageData['setup_general_config']['global_filemode']
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
|
||||||
$installer->addStep(new EnableModuleStep('monitoring'));
|
$setup->addStep(new EnableModuleStep('monitoring'));
|
||||||
|
|
||||||
return $installer;
|
return $setup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -36,7 +36,6 @@
|
||||||
<file>../../application/forms/Config/LoggingForm.php</file>
|
<file>../../application/forms/Config/LoggingForm.php</file>
|
||||||
<file>../../application/forms/Config/ConfirmRemovalForm.php</file>
|
<file>../../application/forms/Config/ConfirmRemovalForm.php</file>
|
||||||
<directory suffix=".php">../../application/forms/Authentication</directory>
|
<directory suffix=".php">../../application/forms/Authentication</directory>
|
||||||
<directory suffix=".php">../../application/forms/Install</directory>
|
|
||||||
<directory suffix=".php">../../application/forms/Dashboard</directory>
|
<directory suffix=".php">../../application/forms/Dashboard</directory>
|
||||||
<directory suffix=".php">../../application/forms/Preference</directory>
|
<directory suffix=".php">../../application/forms/Preference</directory>
|
||||||
<!-- application/views -->
|
<!-- application/views -->
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.install, &.login {
|
&.finish, &.login {
|
||||||
width: 25em;
|
width: 25em;
|
||||||
color: #fffafa;
|
color: #fffafa;
|
||||||
background: #aaa;
|
background: #aaa;
|
||||||
|
@ -250,7 +250,7 @@
|
||||||
border-radius: 1em;
|
border-radius: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#installer {
|
#setup-finish {
|
||||||
div.report {
|
div.report {
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
border-radius: 2em;
|
border-radius: 2em;
|
||||||
|
|
Loading…
Reference in New Issue