Gilles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/256687

Change subject: Fall back to mediawiki for formats Thumbor doesn't support
......................................................................

Fall back to mediawiki for formats Thumbor doesn't support

Bug: T120215
Change-Id: I291c6fc4595eb9698b1f05e8fc542d420e6d2c67
---
M puppet/modules/role/manifests/thumbor.pp
M puppet/modules/role/templates/thumbor/local_repo.php.erb
2 files changed, 20 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/87/256687/1

diff --git a/puppet/modules/role/manifests/thumbor.pp 
b/puppet/modules/role/manifests/thumbor.pp
index c9782f1..6877173 100644
--- a/puppet/modules/role/manifests/thumbor.pp
+++ b/puppet/modules/role/manifests/thumbor.pp
@@ -8,6 +8,7 @@
     require ::role::memcached
     require ::role::sentry
     require ::role::swift
+    require ::role::thumb_on_404
     include ::apache::mod::proxy
     include ::apache::mod::proxy_http
     include ::apache::mod::headers
@@ -22,6 +23,13 @@
     mediawiki::settings { 'thumbor':
         values => {
             'wgIgnoreImageErrors' => true,
+            'wgFileExtensions'    => [
+                'png',
+                'gif',
+                'jpg',
+                'jpeg',
+                'xcf',
+            ],
         },
     }
 }
diff --git a/puppet/modules/role/templates/thumbor/local_repo.php.erb 
b/puppet/modules/role/templates/thumbor/local_repo.php.erb
index 54871fe..cb01e4b 100644
--- a/puppet/modules/role/templates/thumbor/local_repo.php.erb
+++ b/puppet/modules/role/templates/thumbor/local_repo.php.erb
@@ -5,7 +5,18 @@
        'directory'         => $wgUploadDirectory,
        'scriptDirUrl'      => $wgScriptPath,
        'scriptExtension'   => $wgScriptExtension,
-       'url'               => 'http://127.0.0.1:6081' . $wgUploadPath,
+       // Formats unsupported by thumbor hit mediawiki
+       'url'               => $wgUploadPath,
+       'zones'                         => array(
+               'thumb' => array(
+                       // Formats supported by thumbor hit varnish
+                       'urlsByExt' => array (
+                               'jpg' => 'http://127.0.0.1:6081' . 
$wgUploadPath . '/thumb',
+                               'png' => 'http://127.0.0.1:6081' . 
$wgUploadPath . '/thumb',
+                               'gif' => 'http://127.0.0.1:6081' . 
$wgUploadPath . '/thumb',
+                       ),
+               ),
+       ),
        'hashLevels'        => $wgHashedUploadDirectory ? 2 : 0,
        'thumbScriptUrl'    => $wgThumbnailScriptPath,
        'transformVia404'   => !$wgGenerateThumbnailOnParse,

-- 
To view, visit https://gerrit.wikimedia.org/r/256687
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I291c6fc4595eb9698b1f05e8fc542d420e6d2c67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gilles <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to