Optionally alias to a favicon.ico file if provided

Make it possible for calling manifests to pass in the path to a
static favicon.ico shortcut icon file on the filesystem, and if
there is one then alias /favicon.ico to it in the Apache vhost
configuration.

Change-Id: Iba36d169335b2b8ee278f3f4500893a1641e4b28
This commit is contained in:
Jeremy Stanley 2017-02-28 17:48:46 +00:00
parent dca11a634c
commit dc007b3473
2 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,7 @@ class mediawiki(
$wg_upgradekey = undef,
$wg_sitename = undef,
$wg_logo = undef,
$favicon_path = undef,
$wg_openidforcedprovider = 'https://login.launchpad.net/+openid',
$disallow_robots = false,
) {

View File

@ -98,6 +98,13 @@
Alias /w <%= scope['mediawiki::mediawiki_location'] %>
Alias /wiki <%= scope['mediawiki::mediawiki_location'] %>/index.php
<% if scope['mediawiki::favicon_path'] != nil %>
Alias /favicon.ico <%= scope['mediawiki::favicon_path'] %>
<Directory "<%= scope['mediawiki::favicon_path'] %>">
Require all granted
</Directory>
<% end %>
<% if scope['mediawiki::disallow_robots'] == true %>
# Request that search engines not index this site
Alias /robots.txt /srv/mediawiki/robots.txt