From 913ee6d399004cf2d7081d8be23bfca1edaa2875 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Sun, 9 Aug 2015 11:49:49 +0100 Subject: [PATCH] Add mp3 support to Foundation wiki site --- cookbooks/foundation/recipes/wiki.rb | 1 + cookbooks/mediawiki/resources/site.rb | 2 ++ cookbooks/mediawiki/templates/default/LocalSettings.php.erb | 3 +++ 3 files changed, 6 insertions(+) diff --git a/cookbooks/foundation/recipes/wiki.rb b/cookbooks/foundation/recipes/wiki.rb index 4385bb607..b89bfe192 100644 --- a/cookbooks/foundation/recipes/wiki.rb +++ b/cookbooks/foundation/recipes/wiki.rb @@ -39,6 +39,7 @@ mediawiki_site "wiki.osmfoundation.org" do private_accounts true recaptcha_public_key "6LflIQATAAAAAMXyDWpba-FgipVzE-aGF4HIR59N" recaptcha_private_key passwords["wiki"]["recaptcha"] + extra_file_extensions ["mp3"] end mediawiki_skin "osmf" do diff --git a/cookbooks/mediawiki/resources/site.rb b/cookbooks/mediawiki/resources/site.rb index fa97814f0..32916d2bc 100644 --- a/cookbooks/mediawiki/resources/site.rb +++ b/cookbooks/mediawiki/resources/site.rb @@ -46,6 +46,7 @@ attribute :private_accounts, :kind_of => [TrueClass, FalseClass], :default => fa attribute :private, :kind_of => [TrueClass, FalseClass], :default => false attribute :recaptcha_public_key, :kind_of => String attribute :recaptcha_private_key, :kind_of => String +attribute :extra_file_extensions, :kind_of => [String, Array] attribute :reload_apache, :kind_of => [TrueClass, FalseClass], :default => true def after_created @@ -74,6 +75,7 @@ def mediawiki_params :site_notice => site_notice, :site_readonly => site_readonly, :ssl_enabled => ssl_enabled, + :extra_file_extensions => extra_file_extensions, :private_accounts => private_accounts, :private => private } diff --git a/cookbooks/mediawiki/templates/default/LocalSettings.php.erb b/cookbooks/mediawiki/templates/default/LocalSettings.php.erb index b460c98d0..4d0ed1e58 100644 --- a/cookbooks/mediawiki/templates/default/LocalSettings.php.erb +++ b/cookbooks/mediawiki/templates/default/LocalSettings.php.erb @@ -95,6 +95,9 @@ $wgFileExtensions[] = 'pdf'; $wgFileExtensions[] = 'odt'; $wgFileExtensions[] = 'odp'; $wgFileExtensions[] = 'svg'; +<% @mediawiki[:extra_file_extensions].each do |mw_extra_file_extension| -%> + $wgFileExtensions[] = '<%= mw_extra_file_extension %>'; +<% end -%> $wgSVGConverters = array( 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input'); $wgSVGConverter = 'rsvg'; -- 2.39.5