Drop Ubuntu Precise compatibility

Since we've already manually upgraded production to Ubuntu Trusty,
let's start with a clean slate for now and just target latest
Mediawiki on a fresh Trusty deployment. This simplifies or removes
some of the conditional logic in this module.

Change-Id: Ia8e74c85667719178c2f50b1458a9719582e8502
This commit is contained in:
Jeremy Stanley 2016-08-19 19:26:46 +00:00
parent 742d9c09a9
commit 670312c04a
6 changed files with 50 additions and 123 deletions

View File

@ -1,10 +1,6 @@
# Class: mediawiki::app # Class: mediawiki::app
# #
class mediawiki::app { class mediawiki::app ($revision = 'origin/REL1_27'){
$revision = $::lsbdistcodename ? {
'precise' => 'origin/master', # madness
'trusty' => 'origin/REL1_27',
}
vcsrepo { '/srv/mediawiki/w': vcsrepo { '/srv/mediawiki/w':
ensure => present, ensure => present,
provider => git, provider => git,

View File

@ -1,43 +1,16 @@
define mediawiki::extension ( define mediawiki::extension (
$type = 'extension', $type = 'extension',
$ensure = undef, $ensure = latest, # keep up to date
$source = undef, $source = "https://gerrit.wikimedia.org/r/p/mediawiki/${type}s/${name}.git",
$revision = undef, $revision = 'origin/REL1_27',
) { ) {
if $type != 'extension' and $type != 'skin' { if $type != 'extension' and $type != 'skin' {
fail( '$type must be extension or skin' ) fail( '$type must be extension or skin' )
} }
vcsrepo { "/srv/mediawiki/w/${type}s/${name}":
if $ensure == undef { ensure => $ensure,
$vcsensure = $::lsbdistcodename ? {
'precise' => present,
'trusty' => latest, # keep up to date
}
} else {
$vcsensure = $ensure
}
if $revision == undef {
$vcsrevision = $::lsbdistcodename ? {
'precise' => 'origin/master', # madness
'trusty' => 'origin/REL1_27',
}
} else {
$vcsrevision = $revision
}
if $type == 'extension' {
$path = "extensions/${name}"
} elsif $type == 'skin' {
$path = "skins/${name}"
}
if $source == undef {
$vcssource = "https://gerrit.wikimedia.org/r/p/mediawiki/${path}.git"
} else {
$vcssource = $source
}
vcsrepo { "/srv/mediawiki/w/${path}":
ensure => $vcsensure,
provider => git, provider => git,
source => $vcssource, source => $source,
revision => $vcsrevision, revision => $revision,
} }
} }

View File

@ -1,34 +1,11 @@
# Class: mediawiki::image_scaler # Class: mediawiki::image_scaler
# #
class mediawiki::image_scaler { class mediawiki::image_scaler {
if $::lsbdistcodename == 'precise' { # No ffmpeg - it should work without? If it's needed it could be a pain
package { [ # as Ubuntu doesn't package it for trusty
# TODO: This seems to have been copied from wikimedia's mediawiki::multimedia, package { [
# and wikimedia have the TimedMediaHandler extension installed which uses ffmpeg. 'djvulibre-bin',
# But we don't, so is this needed? 'ffmpeg2theora',
'ffmpeg',
'libvips15',
'ttf-arphic-ukai',
'ttf-arphic-uming',
'ttf-farsiweb',
'ttf-khmeros',
'ttf-lao',
'ttf-manchufont',
'ttf-mgopen',
'ttf-nafees',
'ttf-sil-abyssinica',
'ttf-sil-ezra',
'ttf-sil-padauk',
'ttf-takao-gothic',
'ttf-takao-mincho',
'ttf-thai-tlwg',
'ttf-tmuni']:
ensure => present,
}
} elsif $::lsbdistcodename == 'trusty' {
# No ffmpeg - it should work without?
# If it's needed it could be a pain as Ubuntu doesn't package it for trusty
package { [ 'libvips37',
'fonts-arphic-ukai', 'fonts-arphic-ukai',
'fonts-arphic-uming', 'fonts-arphic-uming',
'fonts-farsiweb', 'fonts-farsiweb',
@ -43,46 +20,43 @@ class mediawiki::image_scaler {
'fonts-takao-gothic', 'fonts-takao-gothic',
'fonts-takao-mincho', 'fonts-takao-mincho',
'fonts-thai-tlwg', 'fonts-thai-tlwg',
'fonts-tibetan-machine']: 'fonts-tibetan-machine',
ensure => present, 'ghostscript',
} 'gsfonts',
} 'imagemagick',
package { [ 'djvulibre-bin', 'libogg0',
'ffmpeg2theora', 'librsvg2-bin',
'ghostscript', 'libtheora0',
'gsfonts', 'libvips-tools',
'imagemagick', 'libvips37',
'libogg0', 'libvorbisenc2',
'librsvg2-bin', 'netpbm',
'libtheora0', 'oggvideotools',
'libvips-tools', 'texlive-fonts-recommended',
'libvorbisenc2', 'ttf-alee',
'netpbm', 'ttf-arabeyes',
'oggvideotools', 'ttf-bengali-fonts',
'texlive-fonts-recommended', 'ttf-devanagari-fonts',
'ttf-alee', 'ttf-gujarati-fonts',
'ttf-arabeyes', 'ttf-kacst',
'ttf-bengali-fonts', 'ttf-kannada-fonts',
'ttf-devanagari-fonts', 'ttf-liberation',
'ttf-gujarati-fonts', 'ttf-linux-libertine',
'ttf-kacst', 'ttf-malayalam-fonts',
'ttf-kannada-fonts', 'ttf-oriya-fonts',
'ttf-liberation', 'ttf-punjabi-fonts',
'ttf-linux-libertine', 'ttf-sil-scheherazade',
'ttf-malayalam-fonts', 'ttf-sil-yi',
'ttf-oriya-fonts', 'ttf-tamil-fonts',
'ttf-punjabi-fonts', 'ttf-ubuntu-font-family',
'ttf-sil-scheherazade', 'ttf-unfonts-extra',
'ttf-sil-yi', 'ttf-wqy-zenhei',
'ttf-tamil-fonts', 'xfonts-100dpi',
'ttf-ubuntu-font-family', 'xfonts-75dpi',
'ttf-unfonts-extra', 'xfonts-base',
'ttf-wqy-zenhei', 'xfonts-mplus',
'xfonts-100dpi', 'xfonts-scalable',
'xfonts-75dpi', ]:
'xfonts-base',
'xfonts-mplus',
'xfonts-scalable']:
ensure => present, ensure => present,
} }
include ::tmpreaper include ::tmpreaper

View File

@ -78,11 +78,6 @@ class mediawiki(
source => 'https://github.com/HydraWiki/mediawiki-embedvideo.git', source => 'https://github.com/HydraWiki/mediawiki-embedvideo.git',
revision => 'origin/master', # Not from Wikimedia repos :( revision => 'origin/master', # Not from Wikimedia repos :(
} }
if $::lsbdistcodename == 'precise' {
# On trusty we use 1.27, which has this extension merged into core
# See https://phabricator.wikimedia.org/T108213
mediawiki::extension { 'OpenSearchXml': }
}
mediawiki::extension { 'strapping': mediawiki::extension { 'strapping':
type => 'skin', type => 'skin',

View File

@ -282,11 +282,6 @@ include_once("$IP/extensions/Mantle/Mantle.php");
require_once("$IP/extensions/MobileFrontend/MobileFrontend.php"); require_once("$IP/extensions/MobileFrontend/MobileFrontend.php");
$wgMFAutodetectMobileView = true; $wgMFAutodetectMobileView = true;
if ( file_exists( "$IP/extensions/OpenSearchXml" ) ) {
# Needed by MobileFrontend
require_once( "$IP/extensions/OpenSearchXml/OpenSearchXml.php" );
}
require_once( "$IP/extensions/SubPageList3/SubPageList3.php" ); require_once( "$IP/extensions/SubPageList3/SubPageList3.php" );
require_once( "$IP/extensions/EmbedVideo/EmbedVideo.php" ); require_once( "$IP/extensions/EmbedVideo/EmbedVideo.php" );

View File

@ -73,13 +73,7 @@
php_admin_flag engine off php_admin_flag engine off
</Directory> </Directory>
<Directory "<%= scope.lookupvar('mediawiki::mediawiki_location') %>"> <Directory "<%= scope.lookupvar('mediawiki::mediawiki_location') %>">
<IfVersion >= 2.4>
Require all granted Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
allow from all
</IfVersion>
</Directory> </Directory>
<IfModule mod_expires.c> <IfModule mod_expires.c>
ExpiresActive On ExpiresActive On