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
# as Ubuntu doesn't package it for trusty
package { [ package { [
# TODO: This seems to have been copied from wikimedia's mediawiki::multimedia, 'djvulibre-bin',
# and wikimedia have the TimedMediaHandler extension installed which uses ffmpeg. 'ffmpeg2theora',
# But we don't, so is this needed?
'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,12 +20,7 @@ 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,
}
}
package { [ 'djvulibre-bin',
'ffmpeg2theora',
'ghostscript', 'ghostscript',
'gsfonts', 'gsfonts',
'imagemagick', 'imagemagick',
@ -56,6 +28,7 @@ class mediawiki::image_scaler {
'librsvg2-bin', 'librsvg2-bin',
'libtheora0', 'libtheora0',
'libvips-tools', 'libvips-tools',
'libvips37',
'libvorbisenc2', 'libvorbisenc2',
'netpbm', 'netpbm',
'oggvideotools', 'oggvideotools',
@ -82,7 +55,8 @@ class mediawiki::image_scaler {
'xfonts-75dpi', 'xfonts-75dpi',
'xfonts-base', 'xfonts-base',
'xfonts-mplus', 'xfonts-mplus',
'xfonts-scalable']: '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