Browse Source

Move cache directory out of mediawiki Git worktree

For improved sanitation, have the application write its cache files
in a directory parallel to the Git worktree rather than inside it.

Change-Id: Idcfcf0e3709a03696966aa8c27b897d5be7a1970
changes/62/688762/1
Jeremy Stanley 2 years ago
parent
commit
08f1087ece
  1. 7
      manifests/app.pp
  2. 9
      manifests/init.pp
  3. 2
      templates/Settings.php.erb

7
manifests/app.pp

@ -7,13 +7,6 @@ class mediawiki::app ($revision = 'origin/REL1_28'){
source => 'https://gerrit.wikimedia.org/r/mediawiki/core.git',
revision => $revision,
}
file { '/srv/mediawiki/w/cache':
ensure => directory,
recurse => true,
owner => 'www-data',
group => 'www-data',
require => Vcsrepo['/srv/mediawiki/w'],
}
}
# vim:sw=2:ts=2:expandtab:textwidth=79

9
manifests/init.pp

@ -2,6 +2,7 @@
#
class mediawiki(
$mediawiki_location = '/srv/mediawiki/w',
$mediawiki_cache_location = '/srv/mediawiki/cache',
$mediawiki_images_location = '/srv/mediawiki-data/images',
$role = 'all',
$site_hostname = $::fqdn,
@ -39,6 +40,14 @@ class mediawiki(
ensure => directory,
}
file { $mediawiki_cache_location:
ensure => directory,
recurse => true,
owner => 'www-data',
group => 'www-data',
require => File['/srv/mediawiki'],
}
file { '/srv/mediawiki-data':
ensure => directory,
}

2
templates/Settings.php.erb

@ -64,7 +64,7 @@ $wgShowIPinHeader = false;
$wgDisableCounters = true;
$wgCacheDirectory = "$IP/cache";
$wgCacheDirectory = "<%= @mediawiki_cache_location %>";
# New-style Object cache (and session) settings
$wgObjectCaches['memcached-pecl'] = array(

Loading…
Cancel
Save