Skip to content

Commit

Permalink
configure landing page using environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
EmTeedee authored and nilmerg committed Sep 7, 2023
1 parent d8e313a commit e66f76e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ class IndexController extends ActionController
public function preDispatch()
{
if ($this->getRequest()->getActionName() !== 'welcome') {
$landingPage = getenv('ICINGAWEB_LANDING_PAGE');
if (! $landingPage) {
$landingPage = 'dashboard';
}

// @TODO(el): Avoid landing page redirects: https://dev.icinga.com/issues/9656
$this->redirectNow(Url::fromRequest()->setPath('dashboard'));
$this->redirectNow(Url::fromRequest()->setPath($landingPage));
}
}

Expand Down
26 changes: 26 additions & 0 deletions doc/20-Advanced-Topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This chapter provides details for advanced Icinga Web 2 topics.
* [Source installation](20-Advanced-Topics.md#installing-from-source)
* [Automated setup](20-Advanced-Topics.md#web-setup-automation)
* [Kiosk Mode Configuration](20-Advanced-Topics.md#kiosk-mode)
* [Customizing the Landing Page](20-Advanced-Topics.md#landing-page)

## Global URL Parameters <a id="global-url-parameters"></a>

Expand Down Expand Up @@ -412,3 +413,28 @@ If you want to show a specific Dashboard you can enforce this onto the kiosk use
```

Replace Remote_Addr with the IP where the kiosk user is accessing the Web to restrict further usage from other IPs.

## Customizing the Landing Page <a id="landing-page"></a>

The default landing page of `dashboard` can be customized using the environment variable `ICINGAWEB_LANDING_PAGE`.

Example on RHEL/CentOS:

```
vim /etc/httpd/conf.d/web.icinga.com.conf
<VirtualHost *:80>
...
<Directory "/usr/share/icingaweb2/public">
...
SetEnv ICINGAWEB_LANDING_PAGE "icingadb/services/grid?problems"
...
</Directory>
</VirtualHost>
```

0 comments on commit e66f76e

Please sign in to comment.