X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/e34ca91857cf6277ca9db6c8971d9de4ad2b9ebf..e52e599f2d422640f127026d75234093a2233dfc:/cookbooks/mediawiki/providers/site.rb diff --git a/cookbooks/mediawiki/providers/site.rb b/cookbooks/mediawiki/providers/site.rb index 8d003480c..7357e7d94 100644 --- a/cookbooks/mediawiki/providers/site.rb +++ b/cookbooks/mediawiki/providers/site.rb @@ -89,7 +89,7 @@ action :create do git mediawiki_directory do action :sync - repository "git://github.com/wikimedia/mediawiki" + repository "https://gerrit.wikimedia.org/r/p/mediawiki/core.git" revision mediawiki_reference user node[:mediawiki][:user] group node[:mediawiki][:group] @@ -376,6 +376,17 @@ action :create do update_site false end + mediawiki_extension "Mantle" do + site new_resource.name + update_site false + end + + mediawiki_extension "MobileFrontend" do + site new_resource.name + template "mw-ext-MobileFrontend.inc.php.erb" + update_site false + end + cookbook_file "#{site_directory}/cc-wiki.png" do cookbook "mediawiki" owner node[:mediawiki][:user] @@ -400,13 +411,15 @@ action :create do backup false end + ports = new_resource.ssl_enabled ? [80, 443] : [80] + apache_site new_resource.name do cookbook "mediawiki" template "apache.erb" directory site_directory variables :aliases => Array(new_resource.aliases), :private => new_resource.private, - :ssl_enabled => new_resource.ssl_enabled, + :ports => ports, :ssl_certificate => new_resource.ssl_certificate, :ssl_certificate_chain => new_resource.ssl_certificate_chain reload_apache false @@ -422,6 +435,31 @@ action :create do end end +action :update do + mediawiki_directory = "#{site_directory}/w" + + template "#{mediawiki_directory}/LocalSettings.php" do + cookbook "mediawiki" + source "LocalSettings.php.erb" + owner node[:mediawiki][:user] + group node[:mediawiki][:group] + mode 0664 + variables :name => new_resource.name, + :directory => mediawiki_directory, + :database_params => new_resource.database_params, + :mediawiki => new_resource.mediawiki_params + notifies :run, "execute[#{mediawiki_directory}/maintenance/update.php]" + end + + execute "#{mediawiki_directory}/maintenance/update.php" do + action :run + command "php maintenance/update.php --quick" + cwd mediawiki_directory + user node[:mediawiki][:user] + group node[:mediawiki][:group] + end +end + action :delete do apache_site new_resource.name do action :delete