]> git.openstreetmap.org Git - chef.git/commitdiff
mediawiki: Increase QuickInstantCommons apiMetadataExpiry
authorGrant Slater <github@firefishy.com>
Thu, 23 Jan 2025 01:06:31 +0000 (01:06 +0000)
committerGrant Slater <github@firefishy.com>
Thu, 23 Jan 2025 01:06:31 +0000 (01:06 +0000)
cookbooks/mediawiki/resources/site.rb
cookbooks/mediawiki/templates/default/mw-ext-QuickInstantCommons.inc.php.erb [new file with mode: 0644]

index 0bbddfe8174e2e3c869450f775afe99f28e768df..096484a9903cd960240c29d6e1a590b512de7a22 100644 (file)
@@ -425,6 +425,7 @@ action :create do
   if new_resource.commons
     mediawiki_extension "QuickInstantCommons" do
       site new_resource.site
+      template "mw-ext-QuickInstantCommons.inc.php.erb"
       update_site false
     end
   else
diff --git a/cookbooks/mediawiki/templates/default/mw-ext-QuickInstantCommons.inc.php.erb b/cookbooks/mediawiki/templates/default/mw-ext-QuickInstantCommons.inc.php.erb
new file mode 100644 (file)
index 0000000..0a5828c
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+wfLoadExtension( 'QuickInstantCommons' );
+$wgUseQuickInstantCommons = false; // Disable as we manually set via wgForeignFileRepos
+$wgForeignFileRepos[] = [
+       'class' => '\MediaWiki\Extension\QuickInstantCommons\Repo',
+       'name' => 'wikimediacommons',
+       'directory' => $wgUploadDirectory,
+       'apibase' => 'https://commons.wikimedia.org/w/api.php',
+       'hashLevels' => 2,
+       'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
+       'fetchDescription' => true,
+       'descriptionCacheExpiry' => 43200,
+       'transformVia404' => true,
+       'abbrvThreshold' => 160,
+       'apiMetadataExpiry' => 60*60*24*30,
+       'disabledMediaHandlers' => [TiffHandler::class]
+];