jenkins-bot has submitted this change and it was merged.
Change subject: Add Puppet role for multimedia development
......................................................................
Add Puppet role for multimedia development
Creates a new `role::multimedia' Puppet class. At the moment, this configures
the MediaWiki Apache site to automatically generate thumbnails that are not
found on disk by setting up thumb.php as the 404 handler for missing
thumbnails.
Change-Id: I497b8ef62403c5f0f3a1505b8c79e52974b56b8f
---
M puppet/manifests/roles.pp
M puppet/modules/mediawiki/manifests/apache.pp
A puppet/templates/thumb_on_404.conf.erb
3 files changed, 31 insertions(+), 6 deletions(-)
Approvals:
Ori.livneh: Looks good to me, approved
jenkins-bot: Verified
diff --git a/puppet/manifests/roles.pp b/puppet/manifests/roles.pp
index 5a886f8..7bc3646 100644
--- a/puppet/manifests/roles.pp
+++ b/puppet/manifests/roles.pp
@@ -360,3 +360,23 @@
require => Package['php5-xdebug'],
}
}
+
+# == Class: role::multimedia
+# This class configures MediaWiki for multimedia development.
+class role::multimedia {
+ include role::mediawiki
+
+ # Enable dynamic thumbnail generation via the thumb.php
+ # script for 404 thumb images.
+ @mediawiki::settings { 'thumb.php on 404':
+ values => {
+ wgThumbnailScriptPath => false,
+ wgGenerateThumbnailOnParse => false,
+ },
+ }
+
+ @apache::conf { 'thumb.php on 404':
+ site => $mediawiki::wiki_name,
+ content => template('thumb_on_404.conf.erb'),
+ }
+}
diff --git a/puppet/modules/mediawiki/manifests/apache.pp
b/puppet/modules/mediawiki/manifests/apache.pp
index 1b67421..766f73b 100644
--- a/puppet/modules/mediawiki/manifests/apache.pp
+++ b/puppet/modules/mediawiki/manifests/apache.pp
@@ -6,12 +6,6 @@
include ::mediawiki
include ::apache
- file { '/etc/apache2/sites-enabled/000-default':
- ensure => absent,
- require => Package['apache2'],
- before => Exec['mediawiki setup'],
- }
-
@apache::site { 'default':
ensure => absent,
}
diff --git a/puppet/templates/thumb_on_404.conf.erb
b/puppet/templates/thumb_on_404.conf.erb
new file mode 100644
index 0000000..c54d4d1
--- /dev/null
+++ b/puppet/templates/thumb_on_404.conf.erb
@@ -0,0 +1,11 @@
+RewriteEngine On
+
+# call thumb.php for thumb images not on disk
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$
/w/thumb.php?f=$1&width=$2 [PT,QSA,B]
+
+# call thumb.php for thumb archive images not on disk
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule
^/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$
/w/thumb.php?f=$1&width=$2&archived=1 [PT,QSA,B]
--
To view, visit https://gerrit.wikimedia.org/r/78409
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I497b8ef62403c5f0f3a1505b8c79e52974b56b8f
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits