-
- = sprintf(
- t(
- 'Icinga Web 2 is the next generation monitoring web interface,'
- . ' framework and CLI tool developed by the %s.'
- ),
- '' . t('Icinga Project') . ''
- ); ?>
-
-
= t('Responsive and fast, rewritten from scratch supporting multiple backends and providing a CLI tool. ' .
- ' Compatible with Icinga Core 2.x and 1.x.') ?>
-
-
- = sprintf(
- t('Check the Icinga website for some %s.', 'setup.welcome.screenshots'),
- ''
- . t('insights', 'setup.welcome.screenshots.label') . ''
- ) ?>
-
-
-
- = t('This wizard will guide you through the installation of Icinga Web 2. Once completed and successfully ' .
- 'finished you are able to log in and to explore all the new and stunning features!') ?>
-
- = $form->getElement('token') ?>
- = $form->getElement($form->getTokenElementName()) ?>
- = $form->getElement($form->getUidElementName()) ?>
+
+
= t('Welcome to the installation of Icinga Web 2!') ?>
+
+
+
+
= sprintf(
+ t(
+ 'Icinga Web 2 is the next generation monitoring web interface,'
+ . ' framework and CLI tool developed by the %s.'
+ ),
+ '' . t('Icinga Project') . ''
+ ); ?>
+
= t(
+ 'Responsive and fast, rewritten from scratch supporting multiple backends and'
+ . ' providing a CLI tool. Compatible with Icinga Core 2.x and 1.x.'
+ ); ?>
+
= sprintf(
+ t('Check the Icinga website for some %s.', 'setup.welcome.screenshots'),
+ ''
+ . t('insights', 'setup.welcome.screenshots.label') . ''
+ ); ?>
+
+
= t(
+ 'This wizard will guide you through the installation of Icinga Web 2. Once completed and successfully'
+ . ' finished you are able to log in and to explore all the new and stunning features!'
+ ); ?>
+
-
-
-
-
-
- Generating a new Security Token:
+
+
+
+
+
Generating a New Setup Token
-
- = t('As the Icinga Web 2 administrator you need set a security token, so the installer can authorize its user:') ?>
-
-
sudo icingacli setup generateToken
-
- = t('If you don\'t have IcingaCLI available, you can set it yourself:') ?>
-
-
- head -c 12 /dev/urandom | base64 | sudo -u 'apache' tee = $setupToken ?>;
- sudo chmod 0660 = $setupToken ?>;
-
-
- = t('For further help, please check out the IcingaWeb2 Documentation on this topic.') ?>
-
+
=
+ 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.'
+ ); ?>
+
= t('If you\'ve got the IcingaCLI installed you can do the following:'); ?>
+
+ sudo icingacli setup createConfigDirectory = Platform::getPhpUser(); ?>;
+ sudo icingacli setup generateToken;
+
+
= t('In case the IcingaCLI is missing you can create the token manually:'); ?>
+
+ sudo mkdir -m 2775 = dirname($setupTokenPath); ?> && sudo chgrp = Platform::getPhpUser(); ?> = dirname($setupTokenPath); ?>;
+ head -c 12 /dev/urandom | base64 | sudo -u '= Platform::getPhpUser(); ?>' tee = $setupTokenPath; ?>;
+ sudo chmod 0660 = $setupTokenPath; ?>;
+
+
= sprintf(
+ t('Please see the %s for an extensive description on how to access and use this wizard.'),
+ '' . t('Icinga Web 2 documentation') . ''
+ ); ?>
+
\ No newline at end of file
diff --git a/library/Icinga/Application/Platform.php b/library/Icinga/Application/Platform.php
index d31fce70e..62efdf40e 100644
--- a/library/Icinga/Application/Platform.php
+++ b/library/Icinga/Application/Platform.php
@@ -141,6 +141,21 @@ class Platform
return phpversion();
}
+ /**
+ * Return the username PHP is running as
+ *
+ * @return string
+ */
+ public static function getPhpUser()
+ {
+ if (static::isWindows()) {
+ return get_current_user(); // http://php.net/manual/en/function.get-current-user.php#75059
+ }
+
+ $userInfo = posix_getpwuid(posix_geteuid());
+ return $userInfo['name'];
+ }
+
/**
* Test for php extension
*
diff --git a/public/css/icinga/setup.less b/public/css/icinga/setup.less
index f3bee2cda..4e9837dfd 100644
--- a/public/css/icinga/setup.less
+++ b/public/css/icinga/setup.less
@@ -290,7 +290,8 @@
}
}
-#setup_welcome {
+.welcome-page {
+ margin-top: 3em;
text-align: center;
h2 {
@@ -304,6 +305,45 @@
background-color: #eee;
border: 1px solid lightgrey;
}
+
+ div.note {
+ width: 40%;
+ padding: 1em;
+ margin: 3em auto 0;
+ text-align: left;
+ border-radius: 0.5em;
+ border: 1px solid #eee;
+
+ div.title {
+ padding: 0.2em;
+ margin: -1em -1em 1em;
+ text-align: center;
+ background-color: #eee;
+ border-top-left-radius: 0.5em;
+ border-top-right-radius: 0.5em;
+ }
+
+ img {
+ float: right;
+ }
+
+ p {
+ margin: 2em 0 1em 0;
+
+ &:first-child {
+ margin-top: 1em;
+ }
+ }
+
+ div.code {
+ margin: 0 2em;
+
+ span {
+ display: block;
+ font-family: monospace;
+ }
+ }
+ }
}
#setup {
@@ -373,12 +413,3 @@
}
}
}
-
-.code {
- font-family: monospace;
- display: inline-block;
- padding: 1 1em;
- border-radius: 1em;
- min-width: 42em;
- text-align: left;
-}
\ No newline at end of file