Commit 2937feca authored by Bas Couwenberg's avatar Bas Couwenberg

New upstream version 2.5.0

parent c9542faa
Alexander A. Klimov <alexander.klimov@icinga.com> <Alexander.Klimov@netways.de>
Alexander A. Klimov <alexander.klimov@icinga.com> <alexander.klimov@netways.de>
Alexander A. Klimov <alexander.klimov@icinga.com> <Al2Klimov@users.noreply.github.com>
Bernd Erk <bernd.erk@icinga.com> <bernd.erk@netways.de>
Bernd Erk <bernd.erk@icinga.com><berk@nb-berk.int.netways.de>
Bernd Erk <bernd.erk@icinga.com><berk@nb-berk.local>
Bernd Erk <bernd.erk@icinga.com><bernd.erk@icinga.com>
Bernd Erk <bernd.erk@icinga.com><bernd.erk@icinga.org>
Blerim Sheqa <blerim.sheqa@icinga.com> <blerim.sheqa@netways.de>
Carlos Cesario <carloscesario@gmail.com> <ccesario@tecnomega.com.br>
Christopher Rüll <christopher.ruell@netways.de> <Christopher.Ruell@netways.de>
Eric Lippmann <eric.lippmann@icinga.com> <eric.lippmann@netways.de>
......@@ -12,8 +14,9 @@ Eric Lippmann <eric.lippmann@icinga.com> <lippserd@googlemail.com>
Florian Strohmaier <florian.strohmaier@icinga.com> <florian.strohmaier@netways.de>
Florian Strohmaier <florian.strohmaier@icinga.com> <hello@florianstrohmaier.com>
Gunnar Beutner <gunnar.beutner@netways.de> <gunnar@beutner.name>
Johannes Meyer <johannes.meyer@icinga.com> <johannes.meyer@netways.de>
Jannis Moßhammer <jannis.mosshammer@netways.de>
Johannes Meyer <johannes.meyer@icinga.com> <johannes.meyer@netways.de>
Jennifer Mourek <jennifer.mourek@icinga.com> <jennifer.mourek@netways.de>
Markus Frosch <markus.frosch@icinga.com> <lazyfrosch@icinga.org>
Markus Frosch <markus.frosch@icinga.com> <markus.frosch@netways.de>
Markus Frosch <markus.frosch@icinga.com> <markus@lazyfrosch.de>
......@@ -21,6 +24,7 @@ Matthias Jentsch <matthias.jentsch@netways.de> <mjentsch@localhost.int.netways.d
Michael Friedrich <michael.friedrich@icinga.com> <Michael.Friedrich@netways.de>
Michael Friedrich <michael.friedrich@icinga.com> <michael.friedrich@gmail.com>
Michael Friedrich <michael.friedrich@icinga.com> <michael.friedrich@netways.de>
Nicolai Buchwitz <nicolai.buchwitz@enda.eu> <nbuchwitz@users.noreply.github.com>
Noah Hilverling <noah.hilverling@icinga.com> <noah.hilverling@netways.de>
Sylph Lin <sylph.lin@gmail.com>
Thomas Gelf <thomas.gelf@icinga.com> <root@squeeze-devel1.osmc.lab>
......
language: php
dist: trusty
sudo: false
php:
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
matrix:
include:
- php: '5.3'
dist: precise
sudo: required
env:
- PHPCS_VERSION=2.9.1
- LOCALE_GEN=1
- ENABLE_LDAP=1
services:
- mysql
- postgresql
cache:
directories:
- vendor
branches:
only:
- master
- /^v\d/
notifications:
email: false
# also see: test/setup_vendor.sh
before_script:
- php -m
- sh -c '[ -z $LOCALE_GEN ] || sudo locale-gen en_US.UTF-8 de_DE.UTF-8 fr_FR.UTF-8'
- sh -c '[ -z $ENABLE_LDAP ] || phpenv config-add test/travis-ldap.ini'
- test/travis_database.sh
- test/setup_vendor.sh
script:
# also see: modules/test/application/clicommands/PhpCommand.php
- php phpcs.phar
- php phpunit.phar -c modules/test/phpunit.xml --verbose
......@@ -6,27 +6,35 @@ Bence Nagy <bence@underyx.me>
Benedikt Heine <bebe@bebehei.de>
Bernd Erk <bernd.erk@icinga.com>
Bernhard Friedreich <bernhard.friedreich@brz.gv.at>
Blerim Sheqa <blerim.sheqa@icinga.com>
Boden Garman <boden.garman@spintel.net.au>
Carlos Cesario <carloscesario@gmail.com>
Chris Reeves <chris.reeves@york.ac.uk>
Christoph Wiechert <wio@psitrax.de>
Christopher Rüll <christopher.ruell@netways.de>
Cornelius Wachinger <cornelius@dercorn.com>
Daniel <d.lorych@gmail.com>
Daniel Shirley <aditaa@ig2ad.com>
Davide Demuru <davide.demuru@buongiorno.com>
Dirk Goetz <dirk.goetz@netways.de>
Emil Vikström <emil@pixelstore.se>
Eric Jaw <naisanza@gmail.com>
Eric Lippmann <eric.lippmann@icinga.com>
Florian Strohmaier <florian.strohmaier@icinga.com>
Francesco Colista <fcolista@alpinelinux.org>
Goran Rakic <grakic@devbase.net>
Gunnar Beutner <gunnar.beutner@netways.de>
Hector Sanjuan <hector.sanjuan@nugg.ad>
Heike Jurzik <huhn@lion-3.fritz.box>
Ian Shearin <ishearin@womply.com>
Jannis Moßhammer <jannis.mosshammer@netways.de>
Jennifer Mourek <jennifer.mourek@netways.de>
Jennifer Mourek <jennifer.mourek@icinga.com>
Jo Rhett <jo@chegg.com>
Joe Doherty <git@pjuu.com>
Johannes Meyer <johannes.meyer@icinga.com>
Joonas Kylmälä <joonas.kylmala@kirjastot.fi>
Ken Jungclaus <lum33n@web.de>
Klaus Jrgensen <klaus@blackwoodseven.com>
Lee Clemens <java@leeclemens.net>
Louis Sautier <sautier.louis@gmail.com>
Marc DeTrano <marc@gridshield.net>
......@@ -35,22 +43,29 @@ Marius Hein <marius.hein@netways.de>
Markus Frosch <markus.frosch@icinga.com>
Matthias Jentsch <matthias.jentsch@netways.de>
Michael Friedrich <michael.friedrich@icinga.com>
Mikesch-mp <Mikesch-mp@koebbes.de>
Mikko Peltokangas <mikko@peltokangas.org>
Munzir Taha <munzirtaha@gmail.com>
Nicolai Buchwitz <nicolai.buchwitz@enda.eu>
Noah Hilverling <noah.hilverling@icinga.com>
Paul Richards <paul@minimoo.org>
Pavlos Daoglou <pdaoglou@gmail.com>
Pieter Lexis <pieter.lexis@powerdns.com>
Ramy Talal <ramy@thinkquality.nl>
Raphael Bicker <raphael@bicker.ch>
Rene Moser <rene.moser@swisstxt.ch>
Roland Hopferwieser <rhopfer@ica.jku.at>
Rune Darrud <theflyingcorpse@gmail.com>
Russell Kubik <russkubik@3d-p.com>
Sander Ferdinand <sa.ferdinand@gmail.com>
Simone Orsi <simahawk@users.noreply.github.com>
Susanne Vestner-Ludwig <susanne.vestner-ludwig@inserteffect.com>
Sylph Lin <sylph.lin@gmail.com>
Thomas Gelf <thomas.gelf@icinga.com>
Tim Helfensdörfer <tim@visualappeal.de>
Tobias von der Krone <tobias.vonderkrone@profitbricks.com>
Tom Ford <exptom@users.noreply.github.com>
Tomas Barton <barton.tomas@gmail.com>
Ulf Lange <mopp@gmx.net>
Uwe Ebel <kobmaki@aol.com>
Vladislav Ponomarev <vponomarev@team.mobile.de>
......@@ -58,9 +73,12 @@ Yuri Konotopov <ykonotopov@gmail.com>
ayoubabid <ayoubabid@users.noreply.github.com>
baufrecht <baufrecht@users.noreply.github.com>
bradynathan <bradynathan@gmail.com>
cstegm <cstegm@users.noreply.github.com>
hailthemelody@rm-laptop04 <hailthemelody@rm-laptop04>
mbaschnitzi <mbaschnitzi@users.noreply.github.com>
rbelinsky <rbelinsky@dalet.com>
realitygaps <github@gapsinreality.com>
rkcpi <thieme.sandra@gmail.com>
ss23 <stephen@zxsecurity.co.nz>
tfylling <torbfylling@gmail.com>
xert <xert@users.noreply.github.com>
# Icinga Web 2 Changelog
Please make sure to always read our [Upgrading](doc/80-Upgrading.md) documentation before switching to a new version.
## What's New
### What's New in Version 2.5.0
You can find issues and features related to this release on our [Roadmap](https://github.com/Icinga/icingaweb2/milestone/45?closed=1).
#### Raised PHP Version Dependency
Icinga Web 2 now requires at least PHP 5.6.
#### UI Changes
The style of the login screen and menu have been changed. Also, the menu of Icinga Web 2 is now collapsible.
Browser tabs will not auto-refresh if they are inactive. Users are now allowed to change the default pagination limit
via their preferences.
#### Domain-aware Authentication for Active Directory and LDAP Backends
If there are multiple AD/LDAP authentication backends with distinct domains, you are now able to make Icinga Web 2
aware of the domains. This can be done by configuring each AD/LDAP backend's domain. You can also use the GUI for this
purpose. Please read our [documentation](doc/05-Authentication.md#domain-aware-auth) for more information about this
feature.
#### Changes in Packaging and Dependencies
Valid for distributions:
* RHEL / CentOS 6 + 7
* Upgrading to PHP 7.0 / 7.1 via RedHat SCL (new dependency)
* See [Upgrading to FPM](doc/02-Installation.md#upgrading-to-fpm) for manual steps that are required
* SUSE SLE 12
* Upgrading PHP to >= 5.6.0 via the alternative packages.
You might have to confirm the replacement of PHP < 5.6 - but that should work with any other PHP app as well
* Make sure to enable the new Apache module `a2enmod php7` and restart `apache2`
#### Discontinued Package Updates
For the following distributions Icinga Web 2 won't be updated past 2.4.x anymore:
* Debian 7 wheezy
* Ubuntu 14.04 LTS (trusty)
* SUSE SLE 11 (all service packs)
Please think about replacing your central Icinga system to a newer distribution release.
Also see [packages.icinga.com](https://packages.icinga.com) for the currently supported distributions.
### What's New in Version 2.4.2
#### Bugfixes
......
This diff is collapsed.
# Icinga Web 2
[![Build Status](https://travis-ci.org/Icinga/icingaweb2.png?branch=master)](https://travis-ci.org/Icinga/icingaweb2)
[![Github Tag](https://img.shields.io/github/tag/Icinga/icingaweb2.svg)](https://github.com/Icinga/icingaweb2)
![Icinga Logo](https://www.icinga.com/wp-content/uploads/2014/06/icinga_logo.png)
1. [About](#about)
......@@ -15,7 +18,8 @@
and command-line interface developed by the [Icinga Project](https://www.icinga.com/), supporting Icinga 2,
Icinga Core and any other monitoring backend compatible with the IDO database.
![Icinga Web 2](https://www.icinga.com/wp-content/uploads/2016/12/Icinga-Web-2-v2.4.0.png "Icinga Web 2")
![Icinga Web 2 with Graphite](https://www.icinga.com/wp-content/uploads/2017/11/Icinga-Web-2-graphite.png "Icinga Web 2 with Graphite")
![Icinga Web 2 Sidebar Collapsed](https://www.icinga.com/wp-content/uploads/2017/11/Icinga-Web-2-collapsed-sidebar.png "Icinga Web 2 Sidebar Collapsed")
## License
......@@ -39,6 +43,8 @@ or ask an Icinga partner for [professional support](https://www.icinga.com/servi
## Contributing
There are many ways to contribute to Icinga -- whether it be creating pull requests on
[GitHub](https://github.com/Icinga/icingaweb2), sending patches, testing, reporting bugs,
or reviewing and updating the documentation. Every contribution is appreciated.
There are many ways to contribute to Icinga -- whether it be sending patches,
testing, reporting bugs, or reviewing and updating the documentation. Every
contribution is appreciated!
Please continue reading in the [contributing chapter](CONTRIBUTING.md).
7cec28a31fdff0feb470ec001838bc1dec9c4b69 2017-09-28 14:16:31 +0200
ebe1917b152b786cc708abe5215fd0c4be7c4237 2017-11-27 17:03:03 +0100
......@@ -78,7 +78,9 @@ class ModuleCommand extends Command
"%-14s %-9s %-9s %s\n",
$module,
$mod->getVersion(),
($type === 'enabled' || $this->modules->hasEnabled($module)) ? 'enabled' : 'disabled',
($type === 'enabled' || $this->modules->hasEnabled($module))
? $this->modules->hasInstalled($module) ? 'enabled' : 'dangling'
: 'disabled',
$dir
);
}
......
......@@ -9,6 +9,25 @@ use Icinga\Exception\IcingaException;
class WebCommand extends Command
{
/**
* Serve Icinga Web 2 with PHP's built-in web server
*
* USAGE
*
* icingacli web serve [options] [<document-root>]
*
* OPTIONS
*
* --daemonize Run in background
* --port=<port> The port to listen on
* --listen=<host:port> The address to listen on
* <document-root> The document root directory of Icinga Web 2 (e.g. ./public)
*
* EXAMPLES
*
* icingacli web serve --port=8080
* icingacli web serve --listen=127.0.0.1:8080 ./public
*/
public function serveAction()
{
$minVersion = '5.4.0';
......@@ -21,12 +40,17 @@ class WebCommand extends Command
}
$fork = $this->params->get('daemonize');
$listen = $this->params->get('listen');
$port = $this->params->get('port');
$documentRoot = $this->params->shift();
$socket = $this->params->shift();
if ($listen === null) {
$socket = $port === null ? $this->params->shift() : '0.0.0.0:' . $port;
} else {
$socket = $listen;
}
// TODO: Sanity check!!
if ($socket === null) {
$socket = $this->Config()->get('standalone','listen','0.0.0.0:80');
$socket = $this->Config()->get('standalone', 'listen', '0.0.0.0:80');
}
if ($documentRoot === null) {
$documentRoot = Icinga::app()->getBaseDir('public');
......@@ -68,7 +92,7 @@ class WebCommand extends Command
$pid = pcntl_fork();
if ($pid == -1) {
throw new IcingaException('Could not fork');
} else if ($pid) {
} elseif ($pid) {
echo $this->screen->colorize('[OK]')
. " Icinga Web server forked successfully\n";
fclose(STDIN);
......
......@@ -30,7 +30,7 @@ class AnnouncementsController extends Controller
$repo = new AnnouncementIniRepository();
$this->view->announcements = $repo
->select(array('id', 'author', 'message', 'start', 'end'))
->order('start');
->order('start', 'DESC');
}
/**
......
......@@ -102,6 +102,7 @@ class ConfigController extends Controller
$this->view->modules = Icinga::app()->getModuleManager()->select()
->from('modules')
->order('enabled', 'desc')
->order('installed', 'asc')
->order('name');
$this->setupLimitControl();
$this->setupPaginationControl($this->view->modules);
......@@ -113,7 +114,7 @@ class ConfigController extends Controller
$app = Icinga::app();
$manager = $app->getModuleManager();
$name = $this->getParam('name');
if ($manager->hasInstalled($name)) {
if ($manager->hasInstalled($name) || $manager->hasEnabled($name)) {
$this->view->moduleData = $manager->select()->from('modules')->where('name', $name)->fetchRow();
if ($manager->hasLoaded($name)) {
$module = $manager->getModule($name);
......
......@@ -181,7 +181,7 @@ class DashboardController extends ActionController
try {
$dashboardConfig->saveIni();
Notification::success(t('Dashlet has been removed from') . ' ' . $pane->getTitle());
} catch (Exception $e) {
} catch (Exception $e) {
$action->view->error = $e;
$action->view->config = $dashboardConfig;
$action->render('error');
......@@ -217,7 +217,7 @@ class DashboardController extends ActionController
try {
$dashboardConfig->saveIni();
Notification::success(t('Dashboard has been removed') . ': ' . $pane->getTitle());
} catch (Exception $e) {
} catch (Exception $e) {
$action->view->error = $e;
$action->view->config = $dashboardConfig;
$action->render('error');
......
......@@ -6,9 +6,7 @@ namespace Icinga\Controllers;
use Zend_Controller_Plugin_ErrorHandler;
use Icinga\Application\Icinga;
use Icinga\Application\Logger;
use Icinga\Exception\Http\HttpBadRequestException;
use Icinga\Exception\Http\HttpMethodNotAllowedException;
use Icinga\Exception\Http\HttpNotFoundException;
use Icinga\Exception\Http\HttpExceptionInterface;
use Icinga\Exception\MissingParameterException;
use Icinga\Security\SecurityException;
use Icinga\Web\Controller\ActionController;
......@@ -24,6 +22,14 @@ class ErrorController extends ActionController
*/
protected $requiresAuthentication = false;
/**
* {@inheritdoc}
*/
public function init()
{
$this->rerenderLayout = $this->params->has('renderLayout');
}
/**
* Display exception
*/
......@@ -59,12 +65,11 @@ class ErrorController extends ActionController
break;
default:
switch (true) {
case $exception instanceof HttpMethodNotAllowedException:
$this->getResponse()->setHttpResponseCode(405);
$this->getResponse()->setHeader('Allow', $exception->getAllowedMethods());
break;
case $exception instanceof HttpNotFoundException:
$this->getResponse()->setHttpResponseCode(404);
case $exception instanceof HttpExceptionInterface:
$this->getResponse()->setHttpResponseCode($exception->getStatusCode());
foreach ($exception->getHeaders() as $name => $value) {
$this->getResponse()->setHeader($name, $value, true);
}
break;
case $exception instanceof MissingParameterException:
$this->getResponse()->setHttpResponseCode(400);
......@@ -73,9 +78,6 @@ class ErrorController extends ActionController
'Missing parameter ' . $exception->getParameter()
);
break;
case $exception instanceof HttpBadRequestException:
$this->getResponse()->setHttpResponseCode(400);
break;
case $exception instanceof SecurityException:
$this->getResponse()->setHttpResponseCode(403);
break;
......
......@@ -5,12 +5,14 @@ namespace Icinga\Controllers;
use Exception;
use Icinga\Application\Logger;
use Icinga\Authentication\User\DomainAwareInterface;
use Icinga\Data\DataArray\ArrayDatasource;
use Icinga\Data\Filter\Filter;
use Icinga\Data\Reducible;
use Icinga\Exception\NotFoundError;
use Icinga\Forms\Config\UserGroup\AddMemberForm;
use Icinga\Forms\Config\UserGroup\UserGroupForm;
use Icinga\User;
use Icinga\Web\Controller\AuthBackendController;
use Icinga\Web\Form;
use Icinga\Web\Notification;
......@@ -27,7 +29,9 @@ class GroupController extends AuthBackendController
$this->assertPermission('config/authentication/groups/show');
$this->createListTabs()->activate('group/list');
$backendNames = array_map(
function ($b) { return $b->getName(); },
function ($b) {
return $b->getName();
},
$this->loadUserGroupBackends('Icinga\Data\Selectable')
);
if (empty($backendNames)) {
......@@ -295,8 +299,27 @@ class GroupController extends AuthBackendController
$users = array();
foreach ($this->loadUserBackends('Icinga\Data\Selectable') as $backend) {
try {
foreach ($backend->select(array('user_name')) as $row) {
$users[] = $row;
if ($backend instanceof DomainAwareInterface) {
$domain = $backend->getDomain();
} else {
$domain = null;
}
foreach ($backend->select(array('user_name')) as $user) {
$userObj = new User($user->user_name);
if ($domain !== null) {
if ($userObj->hasDomain() && $userObj->getDomain() !== $domain) {
// Users listed in a user backend which is configured to be responsible for a domain should
// not have a domain in their username. Ultimately, if the username has a domain, it must
// not differ from the backend's domain. We could log here - but hey, who cares :)
continue;
} else {
$userObj->setDomain($domain);
}
}
$user->user_name = $userObj->getUsername();
$users[] = $user;
}
} catch (Exception $e) {
Logger::error($e);
......
......@@ -27,10 +27,7 @@ class ListController extends Controller
{
$this->getTabs()->add($action, array(
'label' => ucfirst($action),
'url' => Url::fromPath(
'list/'
. str_replace(' ', '', $action)
)
'url' => Url::fromPath('list/' . str_replace(' ', '', $action))
))->extend(new OutputFormat())->extend(new DashboardAction())->extend(new MenuAction())->activate($action);
}
......
......@@ -5,6 +5,7 @@ namespace Icinga\Controllers;
use Exception;
use Icinga\Application\Config;
use Icinga\Application\Icinga;
use Icinga\Exception\NotFoundError;
use Icinga\Data\DataArray\ArrayDatasource;
use Icinga\Data\Filter\FilterMatchCaseInsensitive;
......@@ -407,4 +408,25 @@ class NavigationController extends Controller
$this->httpNotFound(sprintf($this->translate('Navigation item "%s" not found'), $form->getValue('name')));
}
}
public function dashboardAction()
{
$name = $this->params->getRequired('name');
$this->getTabs()->add('dashboard', array(
'active' => true,
'label' => ucwords($name),
'url' => Url::fromRequest()
));
$menu = Icinga::app()->getMenu();
$navigation = $menu->findItem($name);
if ($navigation === null) {
$this->httpNotFound($this->translate('Navigation not found'));
}
$this->view->navigation = $navigation;
}
}