2014-10-28 17:32:49 +01:00
|
|
|
<?php
|
|
|
|
|
2014-10-29 11:36:03 +01:00
|
|
|
use Icinga\Application\Icinga;
|
2014-10-30 10:37:51 +01:00
|
|
|
use Icinga\Application\Config;
|
2014-10-29 11:36:03 +01:00
|
|
|
use Icinga\Application\Platform;
|
|
|
|
use Icinga\Web\Wizard;
|
2014-10-28 17:32:49 +01:00
|
|
|
|
2014-10-29 11:36:03 +01:00
|
|
|
$setupTokenPath = rtrim(Icinga::app()->getConfigDir(), '/') . '/setup.token';
|
2014-10-28 17:32:49 +01:00
|
|
|
|
2014-10-29 11:36:03 +01:00
|
|
|
?>
|
|
|
|
<div class="welcome-page">
|
2014-11-10 10:30:52 +01:00
|
|
|
<h2><?= t('Welcome to the configuration of Icinga Web 2!') ?></h2>
|
2014-10-29 11:36:03 +01:00
|
|
|
<!-- 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;">
|
|
|
|
Icinga Web 2 is still in development and not meant for production deployment.
|
|
|
|
Watch the <a href="https://dev.icinga.org/projects/icingaweb2/roadmap">development roadmap</a> and
|
|
|
|
<a href="https://www.icinga.org/">Icinga website</a> for release schedule updates!
|
|
|
|
</div>
|
|
|
|
<div class="info">
|
|
|
|
<p><?= sprintf(
|
|
|
|
t(
|
|
|
|
'Icinga Web 2 is the next generation monitoring web interface,'
|
|
|
|
. ' framework and CLI tool developed by the %s.'
|
|
|
|
),
|
|
|
|
'<a href="https://www.icinga.org/community/team/">' . t('Icinga Project') . '</a>'
|
|
|
|
); ?></p>
|
|
|
|
<p><?= t(
|
|
|
|
'Responsive and fast, rewritten from scratch supporting multiple backends and'
|
|
|
|
. ' providing a CLI tool. Compatible with Icinga Core 2.x and 1.x.'
|
|
|
|
); ?></p>
|
|
|
|
<p><?= sprintf(
|
|
|
|
t('Check the Icinga website for some %s.', 'setup.welcome.screenshots'),
|
|
|
|
'<a href="https://www.icinga.org/icinga/screenshots/icinga-web-2/">'
|
|
|
|
. t('insights', 'setup.welcome.screenshots.label') . '</a>'
|
|
|
|
); ?></p>
|
|
|
|
</div>
|
2014-10-30 10:37:51 +01:00
|
|
|
<?php if (false === file_exists($setupTokenPath) && file_exists(Config::resolvePath('config.ini'))): ?>
|
|
|
|
<p class="restart-warning"><?= t(
|
2014-11-10 10:30:52 +01:00
|
|
|
'You\'ve already completed the configuration of Icinga Web 2. Note that most of your configuration'
|
2014-10-30 10:37:51 +01:00
|
|
|
. ' files will be overwritten in case you\'ll re-configure Icinga Web 2 using this wizard!'
|
|
|
|
); ?></p>
|
|
|
|
<?php else: ?>
|
2014-10-29 11:36:03 +01:00
|
|
|
<p><?= t(
|
2014-11-10 10:30:52 +01:00
|
|
|
'This wizard will guide you through the configuration of Icinga Web 2. Once completed and successfully'
|
2014-10-29 11:36:03 +01:00
|
|
|
. ' finished you are able to log in and to explore all the new and stunning features!'
|
|
|
|
); ?></p>
|
2014-10-30 10:37:51 +01:00
|
|
|
<?php endif ?>
|
2014-10-29 11:36:03 +01:00
|
|
|
<form id="<?= $form->getName(); ?>" name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>">
|
|
|
|
<?= $form->getElement('token'); ?>
|
|
|
|
<?= $form->getElement($form->getTokenElementName()); ?>
|
|
|
|
<?= $form->getElement($form->getUidElementName()); ?>
|
2014-10-28 17:32:49 +01:00
|
|
|
<div class="buttons">
|
2014-10-29 11:36:03 +01:00
|
|
|
<?= $form->getElement(Wizard::BTN_NEXT); ?>
|
2014-10-28 17:32:49 +01:00
|
|
|
</div>
|
2014-10-29 11:36:03 +01:00
|
|
|
</form>
|
|
|
|
<div class="note">
|
|
|
|
<div class="title">
|
|
|
|
<img src="<?= $this->href('img/icons/comment.png'); ?>" alt="<?= t('Note'); ?>">
|
|
|
|
<strong>Generating a New Setup Token</strong>
|
2014-10-28 17:32:49 +01:00
|
|
|
</div>
|
|
|
|
<div>
|
2014-10-29 11:36:03 +01:00
|
|
|
<p><?=
|
|
|
|
t('To run this wizard a user needs to authenticate using a token which is usually'
|
|
|
|
. ' provided to him by an administrator who\'d followed the instructions below.'
|
|
|
|
); ?></p>
|
|
|
|
<p><?= t('If you\'ve got the IcingaCLI installed you can do the following:'); ?></p>
|
|
|
|
<div class="code">
|
2014-11-10 16:45:20 +01:00
|
|
|
<span>icingacli setup config createDirectory <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?>;</span>
|
|
|
|
<span>icingacli setup token create;</span>
|
2014-10-29 11:36:03 +01:00
|
|
|
</div>
|
|
|
|
<p><?= t('In case the IcingaCLI is missing you can create the token manually:'); ?></p>
|
|
|
|
<div class="code">
|
2014-11-10 09:19:38 +01:00
|
|
|
<span>su <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?> && mkdir -m 2775 <?= dirname($setupTokenPath); ?>;</span>
|
|
|
|
<span>head -c 12 /dev/urandom | base64 | tee <?= $setupTokenPath; ?>;</span>
|
|
|
|
<span>chmod 0660 <?= $setupTokenPath; ?>;</span>
|
2014-10-29 11:36:03 +01:00
|
|
|
</div>
|
|
|
|
<p style="font-size: 85%;"><?= sprintf(
|
|
|
|
t('Please see the %s for an extensive description on how to access and use this wizard.'),
|
2014-10-30 09:54:14 +01:00
|
|
|
'<a href="http://docs.icinga.org/">' . t('Icinga Web 2 documentation') . '</a>' // TODO: Add link to iw2 docs which points to the installation topic
|
2014-10-29 11:36:03 +01:00
|
|
|
); ?></p>
|
2014-10-28 17:32:49 +01:00
|
|
|
</div>
|
2014-10-29 11:36:03 +01:00
|
|
|
</div>
|
2014-10-28 17:32:49 +01:00
|
|
|
</div>
|