X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/e34ca91857cf6277ca9db6c8971d9de4ad2b9ebf..1213ebaa3aac144fc3052839f9ead718e553ebec:/cookbooks/mediawiki/providers/site.rb diff --git a/cookbooks/mediawiki/providers/site.rb b/cookbooks/mediawiki/providers/site.rb index 8d003480c..c422b9c2f 100644 --- a/cookbooks/mediawiki/providers/site.rb +++ b/cookbooks/mediawiki/providers/site.rb @@ -87,12 +87,21 @@ action :create do mediawiki_reference = "REL#{new_resource.version}".tr(".", "_") + git "#{mediawiki_directory}/vendor" do + action :nothing + repository "https://gerrit.wikimedia.org/r/p/mediawiki/vendor.git" + revision mediawiki_reference + user node[:mediawiki][:user] + group node[:mediawiki][:group] + end + 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] + notifies :sync, "git[#{mediawiki_directory}/vendor]", :immediately notifies :run, "execute[#{mediawiki_directory}/maintenance/install.php]", :immediately notifies :run, "execute[#{mediawiki_directory}/maintenance/update.php]" end @@ -182,7 +191,11 @@ action :create do mediawiki_extension "Cite" do site new_resource.name - template "mw-ext-Cite.inc.php.erb" + update_site false + end + + mediawiki_extension "CiteThisPage" do + site new_resource.name update_site false end @@ -244,6 +257,7 @@ action :create do mediawiki_extension "SimpleAntiSpam" do site new_resource.name update_site false + action :delete end mediawiki_extension "SpamBlacklist" do @@ -270,7 +284,7 @@ action :create do # MediaWiki Language Extension Bundle # FIXME: should automatically resolve tag - mw_lang_ext_bundle_tag = "2015.03" + mw_lang_ext_bundle_tag = "2015.10" mediawiki_extension "Babel" do site new_resource.name @@ -281,6 +295,7 @@ action :create do mediawiki_extension "cldr" do site new_resource.name + template "mw-ext-cldr.inc.php.erb" tag mw_lang_ext_bundle_tag update_site false end @@ -324,6 +339,7 @@ action :create do mediawiki_extension "AntiSpoof" do site new_resource.name + template "mw-ext-AntiSpoof.inc.php.erb" update_site false end @@ -357,6 +373,7 @@ action :create do mediawiki_extension "osmtaginfo" do site new_resource.name + template "mw-ext-osmtaginfo.inc.php.erb" repository "git://github.com/Firefishy/osmtaginfo.git" tag "live" update_site false @@ -364,6 +381,7 @@ action :create do mediawiki_extension "SimpleMap" do site new_resource.name + template "mw-ext-SimpleMap.inc.php.erb" repository "git://github.com/Firefishy/SimpleMap.git" tag "live" update_site false @@ -371,11 +389,36 @@ action :create do mediawiki_extension "SlippyMap" do site new_resource.name + template "mw-ext-SlippyMap.inc.php.erb" repository "git://github.com/Firefishy/SlippyMap.git" tag "live" update_site false end + mediawiki_extension "Mantle" do + site new_resource.name + update_site false + action :delete + end + + mediawiki_extension "MobileFrontend" do + site new_resource.name + template "mw-ext-MobileFrontend.inc.php.erb" + update_site false + end + + mediawiki_extension "DisableAccount" do + site new_resource.name + template "mw-ext-DisableAccount.inc.php.erb" + update_site false + end + + mediawiki_extension "VisualEditor" do + site new_resource.name + template "mw-ext-VisualEditor.inc.php.erb" + update_site false + end + cookbook_file "#{site_directory}/cc-wiki.png" do cookbook "mediawiki" owner node[:mediawiki][:user] @@ -400,13 +443,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 +467,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