Skip to content
Commits on Source (7)
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>
Alexander A. Klimov <alexander.klimov@icinga.com> <grandmaster@al2klimov.de>
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>
......@@ -13,19 +14,23 @@ Eric Lippmann <eric.lippmann@icinga.com> <eric.lippmann@netways.de>
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>
Florian Strohmaier <florian.strohmaier@icinga.com> <florian.strohmaier@me.com>
Gunnar Beutner <gunnar.beutner@netways.de> <gunnar@beutner.name>
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>
Marius Hein <marius.hein@netways.de> <mhein@itsocks.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>
Matthias Jentsch <matthias.jentsch@netways.de> <mjentsch@localhost.int.netways.de>
Max Kozlov <m.v.kozlov@gmail.com> <M.V.Kozlov@gmail.com>
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>
Noah Hilverling <noah.hilverling@icinga.com> <noah@hilverling.com>
Sylph Lin <sylph.lin@gmail.com>
Thomas Gelf <thomas.gelf@icinga.com> <root@squeeze-devel1.osmc.lab>
Thomas Gelf <thomas.gelf@icinga.com> <tgelf@tgelf-web2dep.(none)>
......
......@@ -2,95 +2,116 @@ Aaron Collins <acollins@chegg.com>
Alexander A. Klimov <alexander.klimov@icinga.com>
Alexander Fuhr <alexander.fuhr@netways.de>
Alexander Wirt <formorer@debian.org>
ayoubabid <ayoubabid@users.noreply.github.com>
baufrecht <baufrecht@users.noreply.github.com>
Andreas Olsson <andreas@arrakis.se>
Bas Couwenberg <sebastic@xs4all.nl>
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>
bradynathan <bradynathan@gmail.com>
Carlos Cesario <carloscesario@gmail.com>
Carsten <carsten.koebke@gmx.de>
Carsten Koebke <carsten.koebke@koebbes.de>
Chris Reeves <chris.reeves@york.ac.uk>
Christopher Rüll <christopher.ruell@netways.de>
Christoph Niemann <kordolan@googlemail.com>
Christoph Wiechert <wio@psitrax.de>
Christopher Rüll <christopher.ruell@netways.de>
Constantin Matheis <constantin.matheis@gmail.com>
Cornelius Wachinger <cornelius@dercorn.com>
cstegm <cstegm@users.noreply.github.com>
Daniel <d.lorych@gmail.com>
Daniel Shirley <aditaa@ig2ad.com>
Davide Bizzarri <davide.bizzarri@wuerth-phoenix.com>
Davide Demuru <davide.demuru@buongiorno.com>
Dirk Goetz <dirk.goetz@netways.de>
Elias Probst <mail@eliasprobst.eu>
Emil Vikström <emil@pixelstore.se>
Eric Jaw <naisanza@gmail.com>
Eric Lippmann <eric.lippmann@icinga.com>
Feu Mourek <feu.mourek@icinga.com>
Florian Strohmaier <florian.strohmaier@icinga.com>
Francesco Colista <fcolista@alpinelinux.org>
Francesco Mazzi <fmazzi@comune.genova.it>
Goran Rakic <grakic@devbase.net>
Gunnar Beutner <gunnar.beutner@netways.de>
hailthemelody@rm-laptop04 <hailthemelody@rm-laptop04>
Hector Sanjuan <hector.sanjuan@nugg.ad>
Heike Jurzik <huhn@lion-3.fritz.box>
Ian Shearin <ishearin@womply.com>
Janne Heß <janne@hess.ooo>
Jannis Moßhammer <jannis.mosshammer@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>
Jo Rhett <jo@chegg.com>
Ken Jungclaus <lum33n@web.de>
Klaus Jrgensen <klaus@blackwoodseven.com>
Lee Clemens <java@leeclemens.net>
Loei Petrus Marogi <loeipetrus.marogi@netways.de>
Louis Sautier <sautier.louis@gmail.com>
mapa82 <maik.paetzold@akra.de>
Marc DeTrano <marc@gridshield.net>
Marcel Weinberg <marcel.weinberg@secucloud.com>
Marcus Cobden <marcus@marcuscobden.co.uk>
Marian Rainer-Harbach <marian@rainer-harbach.at>
Mario Rimann <mario@rimann.org>
Marius Hein <marius.hein@netways.de>
Markus Frosch <markus.frosch@icinga.com>
Matthias Jentsch <matthias.jentsch@netways.de>
Markus Opolka <opolkams@iis.fraunhofer.de>
Matthias <pub@matthias-henning.de>
Matthias Jentsch <matthias.jentsch@netways.de>
Max Kozlov <m.v.kozlov@gmail.com>
Max Stephan <xam.stephan@web.de>
mbaschnitzi <mbaschnitzi@users.noreply.github.com>
Michael Friedrich <michael.friedrich@icinga.com>
Michael T. DeGuzis <mdeguzis@users.noreply.github.com>
Mike Pennisi <mike@mikepennisi.com>
Mikesch-mp <Mikesch-mp@koebbes.de>
Mikko Peltokangas <mikko@peltokangas.org>
Munzir Taha <munzirtaha@gmail.com>
Nicolai Buchwitz <nicolai.buchwitz@enda.eu>
Niko Martini <niko.martini@netways.de>
Noah Hilverling <noah.hilverling@icinga.com>
Oliver Rahner <oliver@rahner.me>
Paolo Schiro <paolo.schiro@kpnqwest.it>
Paul Richards <paul@minimoo.org>
Pavlos Daoglou <pdaoglou@gmail.com>
Pieter Lexis <pieter.lexis@powerdns.com>
PunkoIvan <punkoivan@gmail.com>
Ramy Talal <ramy@thinkquality.nl>
Raphael Bicker <raphael@bicker.ch>
rbelinsky <rbelinsky@dalet.com>
realitygaps <github@gapsinreality.com>
Rene Moser <rene.moser@swisstxt.ch>
rkcpi <thieme.sandra@gmail.com>
Roland Hopferwieser <rhopfer@ica.jku.at>
Rudy Gevaert <rudy.gevaert@ugent.be>
Rune Darrud <theflyingcorpse@gmail.com>
Russell Kubik <russkubik@3d-p.com>
Sander Ferdinand <sa.ferdinand@gmail.com>
Simone Orsi <simahawk@users.noreply.github.com>
ss23 <stephen@zxsecurity.co.nz>
Susanne Vestner-Ludwig <susanne.vestner-ludwig@inserteffect.com>
Sylph Lin <sylph.lin@gmail.com>
tfylling <torbfylling@gmail.com>
Thomas Gelf <thomas.gelf@icinga.com>
Tim Helfensdörfer <tim@visualappeal.de>
Tobias von der Krone <tobias.vonderkrone@profitbricks.com>
Tomas Barton <barton.tomas@gmail.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>
xert <xert@users.noreply.github.com>
Yuri Konotopov <ykonotopov@gmail.com>
ayoubabid <ayoubabid@users.noreply.github.com>
baufrecht <baufrecht@users.noreply.github.com>
bradynathan <bradynathan@gmail.com>
chisatohasimoto <hasimoto@designet.co.jp>
cstegm <cstegm@users.noreply.github.com>
h0rmiga <github@hormiga.ru>
hailthemelody@rm-laptop04 <hailthemelody@rm-laptop04>
ignasr <ignas.linux@gmail.com>
mapa82 <maik.paetzold@akra.de>
mbaschnitzi <mbaschnitzi@users.noreply.github.com>
mdetrano <marc@gridshield.net>
p4k8 <pkuznetsunit@gmail.com>
rbelinsky <rbelinsky@dalet.com>
realitygaps <github@gapsinreality.com>
rkcpi <thieme.sandra@gmail.com>
sant-swedge <simon.wedge@sant.ox.ac.uk>
ss23 <stephen@zxsecurity.co.nz>
tfylling <torbfylling@gmail.com>
xert <xert@users.noreply.github.com>
......@@ -4,6 +4,84 @@ Please make sure to always read our [Upgrading](doc/80-Upgrading.md) documentati
## What's New
### What's New in Version 2.7.0
You can find issues related to this release on our [Roadmap](https://github.com/Icinga/icingaweb2/milestone/52?closed=1).
#### Icinga's Amazingness Spreads Further
All the Japanese and Ukrainian monitoring enthusiasts can now appreciate our web-frontend in their native tongue. Being
so late to the party is also of their advantage, though. Because they can adjust their dashboard without worrying it gets
broke with the next update. (All other admins with non-english users, please have a look at our
[upgrading documentation](doc/80-Upgrading.md#upgrading-to-icinga-web-2-27x-))
* Add Japanese language support [#3776](https://github.com/Icinga/icingaweb2/pull/3776)
* Add Ukrainian language support [#3828](https://github.com/Icinga/icingaweb2/pull/3828)
* Don't translate pane and dashlet names in configs [#3837](https://github.com/Icinga/icingaweb2/pull/3837)
#### Modules - Bonus Functionality Unleashed
With this release module developers got additional ways to customize Icinga Web 2. Whether you ever wanted to hook into
a configuration form's handling, to perform your very own Ajax requests or enhance our multi-select views with fancy
graphs. All is possible now.
* Allow to hook into a configuration form's handling [#3862](https://github.com/Icinga/icingaweb2/pull/3862)
* Allow to fully customize click and submit handling [#3794](https://github.com/Icinga/icingaweb2/issues/3767)
* Integrate DetailviewExtension into multi-select views [#3304](https://github.com/Icinga/icingaweb2/pull/3304)
#### UI - Your Daily Routine and Incident Management, Enhanced
Users with color deficiencies now have a built-in theme to ease navigating within Icinga Web 2. Also, our forms got
a long overdue re-design and now look less boring. Though, the best of all features is that clicking while holding
the Ctrl-key now actually opens a new browser tab! Lost comments? No more. Defining an expiry date again? No more!
* Add colorblind theme [#3743](https://github.com/Icinga/icingaweb2/pull/3743)
* Improve the look of forms [#3416](https://github.com/Icinga/icingaweb2/issues/3416)
* Make ctrl-click open new tab [#3723](https://github.com/Icinga/icingaweb2/pull/3723)
#### Stay Focused - More Room for More Important Stuff
Some of you know that some checks tend to produce walls of text or measure (too) many interfaces. Now, plugin output
and performance data will collapse if they exceed a certain height. If necessary they can of course be expanded and
keep that way across browser restarts. The same is also true for the sidebar. (Though, this one stays *collapsed*)
* Persistent Collapsible Containers [#3638](https://github.com/Icinga/icingaweb2/pull/3638)
* Collapsible plugin output [#3870](https://github.com/Icinga/icingaweb2/pull/3870)
* Collapsed sidebar should stay collapsed [#3682](https://github.com/Icinga/icingaweb2/issues/3628)
#### Markdown - Tables, Lists and Emphasized Text The Easy Way
Since we now have the possibility to collapse large content dynamically, we allow you to add entire wiki pages to hosts
and services. Though, if you prefer to use a real wiki to maintain those (what we'd strongly suggest) it's now easier
than ever before to link to it. Copy url, paste url, submit comment, Done.
* Make notes, comments and announcements markdown aware [#3814](https://github.com/Icinga/icingaweb2/pull/3814)
* Transform any URL in a Comment to a clickable Link [#3441](https://github.com/Icinga/icingaweb2/issues/3441)
* Support relative links in plugin output [#2916](https://github.com/Icinga/icingaweb2/issues/2916)
#### Things You Have Missed Previously
The tactical overview, our fancy pie charts, is now the very first result when you search something in the sidebar.
If you'll see two entirely green circles there, relax. Also overdue or unreachable checks are now appropriately marked
in list views and the service grid now allows you to switch between everything or problems only.
* Add tactical overview to global search [#3845](https://github.com/Icinga/icingaweb2/pull/3845)
* Servicegrid: Add toggle to show problems only [#3871](https://github.com/Icinga/icingaweb2/pull/3871)
* Make overdue/unreachable checks better visible [#3860](https://github.com/Icinga/icingaweb2/pull/3860)
#### Authorization - Knowing and Controlling What's Going On
Roles can now be even more tailored to users since the introduction of a new placeholder. This placeholder allows to
use a user's name in restrictions. Things like `_service_responsible_person=$user:local_name$` are now possible. The
audit log now receives failed login-attempts, that's been made possible since hooks can now run for anonymous users.
* Allow roles to filter for the currently logged in user [#3493](https://github.com/Icinga/icingaweb2/issues/3493)
* Add possibility to disable permission checks for hooks [#3849](https://github.com/Icinga/icingaweb2/pull/3849)
* Send failed login-attempts to the audit log [#3856](https://github.com/Icinga/icingaweb2/pull/3856)
See also the [audit module](https://github.com/Icinga/icingaweb2-module-audit/releases) which got an update and is
required for [#3856](https://github.com/Icinga/icingaweb2/pull/3856) to work.
### What's New in Version 2.6.3
You can find issues related to this release on our [Roadmap](https://github.com/Icinga/icingaweb2/milestone/54?closed=1).
......@@ -12,11 +90,11 @@ You can find issues related to this release on our [Roadmap](https://github.com/
Now supported. :tada:
#### LDAP - One part of our framework we'd want to NOT touch very often
#### LDAP - Community contributions, that's the spirit
That's especially the case if it's about establishing a connection. With the help of our users we've finally fixed the
issue that defining multiple hostnames and enabling STARTTLS has never properly worked. Also, they've identified that
defining multiple hostnames caused a customized port not being utilized and fixed it themselves.
With the help of our users we've finally fixed the issue that defining multiple hostnames and enabling STARTTLS has
never properly worked. Also, they've identified that defining multiple hostnames caused a customized port not being
utilized and fixed it themselves.
There has also a rare case been fixed that caused no group members being found in case object classes had a different
casing than what we expected. (Good news for all the non-OpenLdap and non-MSActiveDirectory users)
......
......@@ -50,3 +50,7 @@ testing, reporting bugs, or reviewing and updating the documentation. Every
contribution is appreciated!
Please continue reading in the [contributing chapter](CONTRIBUTING.md).
### Security Issues
For reporting security issues please visit [this page](https://icinga.com/contact/security/).
......@@ -25,7 +25,7 @@
Specify the release version.
```
VERSION=2.6.0
VERSION=2.6.3
```
Add your signing key to your Git configuration file, if not already there.
......@@ -46,7 +46,7 @@ Check issues at https://github.com/Icinga/icingaweb2
### Backport Commits <a id="backport-commits"></a>
For minor versions not branched off git master you need
to manually backports any and all commits from the
to manually backport any and all commits from the
master branch which should be part of this release.
### Authors <a id="authors"></a>
......@@ -69,8 +69,8 @@ Commands:
```
echo "v$VERSION" > VERSION
sed -i '' "s/const VERSION = '.*'/const VERSION = '$VERSION'/g" library/Icinga/Application/Version.php
find . -type f -name '*.info' -exec sed -i '' "s/Version: .*/Version: $VERSION/g" {} \;
sed -i "s/const VERSION = '.*'/const VERSION = '$VERSION'/g" library/Icinga/Application/Version.php
find . -type f -name '*.info' -exec sed -i "s/Version: .*/Version: $VERSION/g" {} \;
```
## Changelog <a id="changelog"></a>
......@@ -136,12 +136,12 @@ sed -i "s/Version: .*/Version: $VERSION/g" icingaweb2.spec
vim icingaweb2.spec
%changelog
* Fri Apr 27 2018 Eric.Lippmann <eric.lippmann@icinga.com> 2.5.3-1
- Update to 2.5.3
* Wed Apr 24 2019 Johannes Meyer <johannes.meyer@icinga.com> 2.6.3-1
- Update to 2.6.3
```
```
git commit -av -m "Release 2.5.3-1"
git commit -av -m "Release $VERSION-1"
git push
```
......@@ -174,37 +174,47 @@ git checkout release && git pull
#### Release Commit
Set the `Version`, `Revision` and `changelog` inside the spec file.
Set the `Version`, `Revision` and `changelog` by using the `dch` helper.
```
./dch 2.5.3-1 "Update to 2.5.3"
VERSION=2.6.3
./dch $VERSION-1 "Update to $VERSION"
```
```
git commit -av -m "Release 2.5.3-1"
git commit -av -m "Release $VERSION-1"
git push
```
**Note for major releases**: Update release branch to latest.
`git checkout release && git pull && git merge master && git push`
```
git checkout release && git pull && git merge master && git push
```
**Note for minor releases**: Cherry-pick the release commit into master.
`git checkout master && git pull && git cherry-pick release && git push`
```
git checkout master && git pull && git cherry-pick release && git push
```
#### DEB with dch on macOS
```
docker run -v `pwd`:/mnt/packaging -ti ubuntu:xenial bash
docker run -v `pwd`:/mnt/packaging -ti ubuntu:bionic bash
apt-get update
apt-get install git devscripts vim
apt-get update && apt-get install git ubuntu-dev-tools vim -y
cd /mnt/packaging
git config --global user.name "Eric Lippmann"
git config --global user.email "eric.lippmann@icinga.com"
./dch 2.5.3-1 "Update to 2.5.3"
VERSION=2.6.3
./dch $VERSION-1 "Update to $VERSION"
```
## Build Server <a id="build-server"></a>
......@@ -212,24 +222,70 @@ git config --global user.email "eric.lippmann@icinga.com"
* Verify package build changes for this version.
* Test the snapshot packages for all distributions beforehand.
* Build the newly created Git tag for Debian/RHEL/SuSE.
* Wait until all jobs have passed and then publish them one by one with `allow_release`
## Release Tests <a id="release-tests"></a>
* Provision the vagrant boxes and test the release packages.
* * Start a new docker container and install/run Icinga Web 2 & icingacli.
### CentOS
```
docker run -ti centos:latest bash
yum -y install https://packages.icinga.com/epel/icinga-rpm-release-7-latest.noarch.rpm
yum -y install centos-release-scl
yum -y install icingaweb2 icingacli
icingacli
```
### Debian
```
docker run -ti debian:stretch bash
apt-get update && apt-get install -y wget curl gnupg apt-transport-https
DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release); \
echo "deb https://packages.icinga.com/debian icinga-${DIST} main" > \
/etc/apt/sources.list.d/${DIST}-icinga.list
echo "deb-src https://packages.icinga.com/debian icinga-${DIST} main" >> \
/etc/apt/sources.list.d/${DIST}-icinga.list
curl https://packages.icinga.com/icinga.key | apt-key add -
apt-get -y install icingaweb2 icingacli
icingacli
```
## GitHub Release <a id="github-release"></a>
Create a new release for the newly created Git tag: https://github.com/Icinga/icingaweb2/releases
> Hint: Choose [tags](https://github.com/Icinga/icingaweb2/tags), pick one to edit and
> make this a release. You can also create a draft release.
The release body should contain a short changelog, with links
into the roadmap, changelog and blogpost.
### Online Documentation <a id="online-documentation"></a>
Ask @bobapple to update the documentation at docs.icinga.com.
This is built with a daily cronjob.
#### Manual Updates
SSH into the webserver or ask [bobapple](https://github.com/bobapple).
```
cd /usr/local/icinga-docs-tools && ./build-docs.rb -c /var/www/docs/config/icingaweb2-latest.yml
```
### Announcement <a id="announcement"></a>
* Create a new blog post on icinga.com/blog
* Social media: [Twitter](https://twitter.com/icinga), [Facebook](https://www.facebook.com/icinga), [Xing](https://www.xing.com/communities/groups/icinga-da4b-1060043), [LinkedIn](https://www.linkedin.com/groups/Icinga-1921830/about)
* Update IRC channel topic
* Create a new blog post on [icinga.com/blog](https://icinga.com/blog) including a featured image
* Create a release topic on [community.icinga.com](https://community.icinga.com)
* Release email to net-tech & team
### Project Management <a id="project-management"></a>
......
78d215ce36b9d2b64d8998a15fa80c1d46ef9ec4 2019-04-24 14:36:40 +0200
861c5601b6e01402a932687d7b59a037c72a6804 2019-07-30 10:49:59 +0200
<?php
/* Icinga Web 2 | (c) 2019 Icinga Development Team | GPLv2+ */
namespace Icinga\Clicommands;
use Icinga\Application\Version;
use Icinga\Application\Icinga;
use Icinga\Cli\Loader;
use Icinga\Cli\Command;
/**
* Shows version of Icinga Web 2, loaded modules and PHP
*
* The version command shows version numbers for Icinga Web 2, loaded modules and PHP.
*
* Usage: icingacli --version
*/
class VersionCommand extends Command
{
protected $defaultActionName = 'show';
/**
* Shows version of Icinga Web 2, loaded modules and PHP
*
* The version command shows version numbers for Icinga Web 2, loaded modules and PHP.
*
* Usage: icingacli --version
*/
public function showAction()
{
$getVersion = Version::get();
printf("%-12s %-9s \n", 'Icinga Web 2', $getVersion['appVersion']);
if (isset($getVersion['gitCommitID'])) {
printf("%-12s %-9s \n", 'Git Commit', $getVersion['gitCommitID']);
}
printf("%-12s %-9s \n", 'PHP Version', PHP_VERSION);
$modules = Icinga::app()->getModuleManager()->loadEnabledModules()->getLoadedModules();
$maxLength = 0;
foreach ($modules as $module) {
$length = strlen($module->getName());
if ($length > $maxLength) {
$maxLength = $length;
}
}
printf("%-${maxLength}s %-9s \n", 'MODULE', 'VERSION');
foreach ($modules as $module) {
printf("%-${maxLength}s %-9s \n", $module->getName(), $module->getVersion());
}
}
}
......@@ -55,20 +55,12 @@ class WebCommand extends Command
$this->forkAndExit();
}
echo "Serving Icinga Web 2 from directory $documentRoot and listening on $socket\n";
$cmd = sprintf(
'%s -S %s -t %s %s',
readlink('/proc/self/exe'),
$socket,
$documentRoot,
Icinga::app()->getLibraryDir('/Icinga/Application/webrouter.php')
);
// TODO: Store webserver log, switch uid, log index.php includes, pid file
if ($fork) {
exec($cmd);
} else {
passthru($cmd);
}
pcntl_exec(
readlink('/proc/self/exe'),
['-S', $socket, '-t', $documentRoot, Icinga::app()->getLibraryDir('/Icinga/Application/webrouter.php')]
);
}
public function stopAction()
......@@ -93,6 +85,17 @@ class WebCommand extends Command
// pcntl_wait($status);
} else {
// child
// Replace console with /dev/null by first freeing the (lowest possible) FDs 0, 1 and 2
// and then opening /dev/null once for every one of them (open(2) chooses the lowest free FD).
fclose(STDIN);
fclose(STDOUT);
fclose(STDERR);
fopen('/dev/null', 'rb');
fopen('/dev/null', 'wb');
fopen('/dev/null', 'wb');
}
}
}
......@@ -13,6 +13,7 @@ class AboutController extends Controller
{
$this->view->version = Version::get();
$this->view->modules = Icinga::app()->getModuleManager()->getLoadedModules();
$this->view->title = $this->translate('About');
$this->view->tabs = $this->getTabs()->add(
'about',
array(
......
......@@ -68,6 +68,7 @@ class AccountController extends Controller
$form->handleRequest();
$this->view->form = $form;
$this->view->title = $this->translate('My Account');
$this->getTabs()->activate('account');
}
}
......@@ -12,6 +12,13 @@ use Icinga\Web\Url;
class AnnouncementsController extends Controller
{
public function init()
{
$this->view->title = $this->translate('Announcements');
parent::init();
}
/**
* List all announcements
*/
......@@ -27,10 +34,26 @@ class AnnouncementsController extends Controller
)
);
$repo = new AnnouncementIniRepository();
$this->view->announcements = $repo
->select(array('id', 'author', 'message', 'start', 'end'))
->order('start', 'DESC');
$announcements = (new AnnouncementIniRepository())
->select([
'id',
'author',
'message',
'start',
'end'
]);
$sortAndFilterColumns = [
'author' => $this->translate('Author'),
'message' => $this->translate('Message'),
'start' => $this->translate('Start'),
'end' => $this->translate('End')
];
$this->setupSortControl($sortAndFilterColumns, $announcements, ['start' => 'desc']);
$this->setupFilterControl($announcements, $sortAndFilterColumns, ['message']);
$this->view->announcements = $announcements->fetchAll();
}
/**
......
......@@ -54,7 +54,7 @@ class AuthenticationController extends Controller
$form->handleRequest();
}
$this->view->form = $form;
$this->view->title = $this->translate('Icinga Web 2 Login');
$this->view->defaultTitle = $this->translate('Icinga Web 2 Login');
$this->view->requiresSetup = $requiresSetup;
}
......
......@@ -82,6 +82,7 @@ class ConfigController extends Controller
$form->handleRequest();
$this->view->form = $form;
$this->view->title = $this->translate('General');
$this->createApplicationTabs()->activate('general');
}
......@@ -107,6 +108,7 @@ class ConfigController extends Controller
->order('name');
$this->setupLimitControl();
$this->setupPaginationControl($this->view->modules);
$this->view->title = $this->translate('Modules');
}
public function moduleAction()
......@@ -137,6 +139,7 @@ class ConfigController extends Controller
$this->view->module = $module;
$this->view->toggleForm = $toggleForm;
$this->view->title = $module->getName();
$this->view->tabs = $module->getConfigTabs()->activate('info');
$this->view->moduleGitCommitId = Version::getGitHead($module->getBaseDir());
} else {
......@@ -209,6 +212,7 @@ class ConfigController extends Controller
$this->view->form = $form;
$this->view->backendNames = Config::app('groups');
$this->createApplicationTabs()->activate('authentication');
$this->view->title = $this->translate('Authentication');
$this->render('userbackend/reorder');
}
......@@ -255,6 +259,7 @@ class ConfigController extends Controller
});
$form->handleRequest();
$this->view->title = $this->translate('Authentication');
$this->renderForm($form, $this->translate('New User Backend'));
}
......@@ -293,6 +298,7 @@ class ConfigController extends Controller
$this->httpNotFound(sprintf($this->translate('User backend "%s" not found'), $backendName));
}
$this->view->title = $this->translate('Authentication');
$this->renderForm($form, $this->translate('Update User Backend'));
}
......@@ -325,6 +331,7 @@ class ConfigController extends Controller
});
$form->handleRequest();
$this->view->title = $this->translate('Authentication');
$this->renderForm($form, $this->translate('Remove User Backend'));
}
......@@ -338,6 +345,7 @@ class ConfigController extends Controller
->setKeyColumn('name')
->select()
->order('name');
$this->view->title = $this->translate('Resources');
$this->createApplicationTabs()->activate('resource');
}
......@@ -358,6 +366,7 @@ class ConfigController extends Controller
$form->handleRequest();
$this->view->form = $form;
$this->view->title = $this->translate('Resources');
$this->render('resource/create');
}
......@@ -377,6 +386,7 @@ class ConfigController extends Controller
$form->handleRequest();
$this->view->form = $form;
$this->view->title = $this->translate('Resources');
$this->render('resource/modify');
}
......@@ -441,6 +451,7 @@ class ConfigController extends Controller
}
$this->view->form = $form;
$this->view->title = $this->translate('Resources');
$this->render('resource/remove');
}
}
......@@ -106,29 +106,22 @@ class DashboardController extends ActionController
$action = $this;
$form->setOnSuccess(function (Form $form) use ($dashboard, $action) {
try {
$pane = $dashboard->getPane($form->getValue('pane'));
$pane = $dashboard->getPane($form->getValue('org_pane'));
$pane->setTitle($form->getValue('pane'));
} catch (ProgrammingError $e) {
$pane = new Dashboard\Pane($form->getValue('pane'));
$pane->setUserWidget();
$dashboard->addPane($pane);
}
try {
$dashlet = $pane->getDashlet($form->getValue('dashlet'));
$dashlet = $pane->getDashlet($form->getValue('org_dashlet'));
$dashlet->setTitle($form->getValue('dashlet'));
$dashlet->setUrl($form->getValue('url'));
} catch (ProgrammingError $e) {
$dashlet = new Dashboard\Dashlet($form->getValue('dashlet'), $form->getValue('url'), $pane);
$pane->addDashlet($dashlet);
}
$dashlet->setUserWidget();
// Rename dashlet
if ($form->getValue('org_dashlet') && $form->getValue('org_dashlet') !== $dashlet->getTitle()) {
$pane->removeDashlet($form->getValue('org_dashlet'));
}
// Move
if ($form->getValue('org_pane') && $form->getValue('org_pane') !== $pane->getTitle()) {
$oldPane = $dashboard->getPane($form->getValue('org_pane'));
$oldPane->removeDashlet($dashlet->getTitle());
}
$dashboardConfig = $dashboard->getConfig();
try {
$dashboardConfig->saveIni();
......@@ -269,7 +262,7 @@ class DashboardController extends ActionController
$action = $this;
$form->setOnSuccess(function (Form $form) use ($dashboard, $pane, $action) {
$pane = $dashboard->getPane($pane);
$dashboard->removePane($pane->getTitle());
$dashboard->removePane($pane->getName());
$dashboardConfig = $dashboard->getConfig();
try {
$dashboardConfig->saveIni();
......
......@@ -21,6 +21,13 @@ use Icinga\Web\Widget;
class GroupController extends AuthBackendController
{
public function init()
{
$this->view->title = $this->translate('User Groups');
parent::init();
}
/**
* List all user groups of a single backend
*/
......@@ -39,7 +46,7 @@ class GroupController extends AuthBackendController
}
$this->view->backendSelection = new Form();
$this->view->backendSelection->setAttrib('class', 'backend-selection');
$this->view->backendSelection->setAttrib('class', 'backend-selection icinga-controls');
$this->view->backendSelection->setUidDisabled();
$this->view->backendSelection->setMethod('GET');
$this->view->backendSelection->setTokenDisabled();
......@@ -121,6 +128,7 @@ class GroupController extends AuthBackendController
if ($this->hasPermission('config/authentication/groups/edit') && $backend instanceof Reducible) {
$removeForm = new Form();
$removeForm->setUidDisabled();
$removeForm->setAttrib('class', 'inline');
$removeForm->setAction(
Url::fromPath('group/removemember', array('backend' => $backend->getName(), 'group' => $groupName))
);
......
......@@ -54,5 +54,6 @@ class ListController extends Controller
$this->setupLimitControl();
$this->setupPaginationControl($this->view->logData);
$this->view->title = $this->translate('Application Log');
}
}
......@@ -127,6 +127,7 @@ class NavigationController extends Controller
$this->view->types = $this->listItemTypes();
$this->view->items = $query;
$this->view->title = $this->translate('Navigation');
$this->getTabs()
->add(
'account',
......@@ -166,6 +167,7 @@ class NavigationController extends Controller
$removeForm = new Form();
$removeForm->setUidDisabled();
$removeForm->setAttrib('class', 'inline');
$removeForm->addElement('hidden', 'name', array(
'decorators' => array('ViewHelper')
));
......@@ -187,6 +189,7 @@ class NavigationController extends Controller
$this->view->types = $this->listItemTypes();
$this->view->items = $query;
$this->view->title = $this->translate('Shared Navigation');
$this->getTabs()->add(
'navigation/shared',
array(
......@@ -242,6 +245,7 @@ class NavigationController extends Controller
});
$form->handleRequest();
$this->view->title = $this->translate('Navigation');
$this->renderForm($form, $this->translate('New Navigation Item'));
}
......@@ -297,6 +301,7 @@ class NavigationController extends Controller
$this->httpNotFound(sprintf($this->translate('Navigation item "%s" not found'), $itemName));
}
$this->view->title = $this->translate('Navigation');
$this->renderForm($form, $this->translate('Update Navigation Item'));
}
......@@ -340,6 +345,7 @@ class NavigationController extends Controller
});
$form->handleRequest();
$this->view->title = $this->translate('Navigation');
$this->renderForm($form, $this->translate('Remove Navigation Item'));
}
......@@ -428,5 +434,6 @@ class NavigationController extends Controller
}
$this->view->navigation = $navigation;
$this->view->title = $navigation->getLabel();
}
}
......@@ -4,12 +4,10 @@
namespace Icinga\Controllers;
use Icinga\Application\Config;
use Icinga\Exception\AlreadyExistsException;
use Icinga\Authentication\RolesConfig;
use Icinga\Exception\NotFoundError;
use Icinga\Forms\ConfirmRemovalForm;
use Icinga\Forms\Security\RoleForm;
use Icinga\Web\Controller\AuthBackendController;
use Icinga\Web\Notification;
/**
* Manage user permissions and restrictions based on roles
......@@ -18,6 +16,13 @@ use Icinga\Web\Notification;
*/
class RoleController extends AuthBackendController
{
public function init()
{
$this->view->title = $this->translate('Roles');
parent::init();
}
/**
* List roles
*
......@@ -38,28 +43,13 @@ class RoleController extends AuthBackendController
public function addAction()
{
$this->assertPermission('config/authentication/roles/add');
$role = new RoleForm(array(
'onSuccess' => function (RoleForm $role) {
$name = $role->getElement('name')->getValue();
$values = $role->getValues();
try {
$role->add($name, $values);
} catch (AlreadyExistsException $e) {
$role->addError($e->getMessage());
return false;
}
if ($role->save()) {
Notification::success(t('Role created'));
return true;
}
return false;
}
));
$role
->setSubmitLabel($this->translate('Create Role'))
->setIniConfig(Config::app('roles', true))
->setRedirectUrl('role/list')
->handleRequest();
$role = new RoleForm();
$role->setRedirectUrl('role/list');
$role->setRepository(new RolesConfig());
$role->setSubmitLabel($this->translate('Create Role'));
$role->add()->handleRequest();
$this->renderForm($role, $this->translate('New Role'));
}
......@@ -71,35 +61,20 @@ class RoleController extends AuthBackendController
public function editAction()
{
$this->assertPermission('config/authentication/roles/edit');
$name = $this->params->getRequired('role');
$role = new RoleForm();
$role->setRedirectUrl('role/list');
$role->setRepository(new RolesConfig());
$role->setSubmitLabel($this->translate('Update Role'));
$role->edit($name);
try {
$role
->setIniConfig(Config::app('roles', true))
->load($name);
} catch (NotFoundError $e) {
$this->httpNotFound($e->getMessage());
}
$role
->setOnSuccess(function (RoleForm $role) use ($name) {
$oldName = $name;
$name = $role->getElement('name')->getValue();
$values = $role->getValues();
try {
$role->update($name, $values, $oldName);
$role->handleRequest();
} catch (NotFoundError $e) {
$role->addError($e->getMessage());
return false;
$this->httpNotFound($this->translate('Role not found'));
}
if ($role->save()) {
Notification::success(t('Role updated'));
return true;
}
return false;
})
->setRedirectUrl('role/list')
->handleRequest();
$this->renderForm($role, $this->translate('Update Role'));
}
......@@ -109,35 +84,21 @@ class RoleController extends AuthBackendController
public function removeAction()
{
$this->assertPermission('config/authentication/roles/remove');
$name = $this->params->getRequired('role');
$role = new RoleForm();
try {
$role
->setIniConfig(Config::app('roles', true))
->load($name);
} catch (NotFoundError $e) {
$this->httpNotFound($e->getMessage());
}
$confirmation = new ConfirmRemovalForm(array(
'onSuccess' => function (ConfirmRemovalForm $confirmation) use ($name, $role) {
try {
$role->setRedirectUrl('role/list');
$role->setRepository(new RolesConfig());
$role->setSubmitLabel($this->translate('Remove Role'));
$role->remove($name);
try {
$role->handleRequest();
} catch (NotFoundError $e) {
Notification::error($e->getMessage());
return false;
$this->httpNotFound($this->translate('Role not found'));
}
if ($role->save()) {
Notification::success(t('Role removed'));
return true;
}
return false;
}
));
$confirmation
->setSubmitLabel($this->translate('Remove Role'))
->setRedirectUrl('role/list')
->handleRequest();
$this->renderForm($confirmation, $this->translate('Remove Role'));
$this->renderForm($role, $this->translate('Remove Role'));
}
/**
......
......@@ -20,6 +20,13 @@ use Icinga\Web\Widget;
class UserController extends AuthBackendController
{
public function init()
{
$this->view->title = $this->translate('Users');
parent::init();
}
/**
* List all users of a single backend
*/
......@@ -38,7 +45,7 @@ class UserController extends AuthBackendController
}
$this->view->backendSelection = new Form();
$this->view->backendSelection->setAttrib('class', 'backend-selection');
$this->view->backendSelection->setAttrib('class', 'backend-selection icinga-controls');
$this->view->backendSelection->setUidDisabled();
$this->view->backendSelection->setMethod('GET');
$this->view->backendSelection->setTokenDisabled();
......@@ -134,6 +141,7 @@ class UserController extends AuthBackendController
if ($this->hasPermission('config/authentication/groups/edit')) {
$removeForm = new Form();
$removeForm->setUidDisabled();
$removeForm->setAttrib('class', 'inline');
$removeForm->addElement('hidden', 'user_name', array(
'isArray' => true,
'value' => $userName,
......