From: Grant Slater Date: Sun, 9 Aug 2015 10:49:49 +0000 (+0100) Subject: Add mp3 support to Foundation wiki site X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/913ee6d399004cf2d7081d8be23bfca1edaa2875?hp=4c86175022c9036999f9d8341e48cbd884448709 Add mp3 support to Foundation wiki site --- 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';