From dc007b347369ab7790e7d061cdb75e27f4772951 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 28 Feb 2017 17:48:46 +0000 Subject: [PATCH] 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 --- manifests/init.pp | 1 + templates/apache/mediawiki.erb | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 243b062..7174f39 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, ) { diff --git a/templates/apache/mediawiki.erb b/templates/apache/mediawiki.erb index eeae7d5..5d87dea 100644 --- a/templates/apache/mediawiki.erb +++ b/templates/apache/mediawiki.erb @@ -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'] %> + "> + Require all granted + +<% end %> + <% if scope['mediawiki::disallow_robots'] == true %> # Request that search engines not index this site Alias /robots.txt /srv/mediawiki/robots.txt