From: Tom Hughes Date: Sun, 29 Mar 2015 13:22:21 +0000 (+0100) Subject: Convert mediawiki_site to an LWRP X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/1b2a50a03b5beaf0d4f2e126bee875b6f66fc1bd Convert mediawiki_site to an LWRP --- diff --git a/cookbooks/foundation/recipes/board.rb b/cookbooks/foundation/recipes/board.rb index 45c3538fb..24c925a4d 100644 --- a/cookbooks/foundation/recipes/board.rb +++ b/cookbooks/foundation/recipes/board.rb @@ -23,9 +23,9 @@ passwords = data_bag_item("foundation", "passwords") mediawiki_site "board.osmfoundation.org" do directory "/srv/board.osmfoundation.org" - enable_ssl true + ssl_enabled true database_name "board-wiki" - database_username "board-wikiuser" + database_user "board-wikiuser" database_password passwords["board"]["database"] admin_password passwords["board"]["admin"] logo "/Wiki.png" diff --git a/cookbooks/foundation/recipes/wiki.rb b/cookbooks/foundation/recipes/wiki.rb index 9033f98f5..37bb45bf7 100644 --- a/cookbooks/foundation/recipes/wiki.rb +++ b/cookbooks/foundation/recipes/wiki.rb @@ -25,9 +25,9 @@ mediawiki_site "wiki.osmfoundation.org" do aliases "www.osmfoundation.org", "osmfoundation.org" sitename "OpenStreetMap Foundation Wiki" directory "/srv/wiki.osmfoundation.org" - enable_ssl true + ssl_enabled true database_name "osmf-wiki" - database_username "osmf-wikiuser" + database_user "osmf-wikiuser" database_password passwords["wiki"]["database"] skin "osmf" logo "/Wiki.png" diff --git a/cookbooks/mediawiki/.foodcritic b/cookbooks/mediawiki/.foodcritic index e9a7c9233..3907cff00 100644 --- a/cookbooks/mediawiki/.foodcritic +++ b/cookbooks/mediawiki/.foodcritic @@ -1,2 +1 @@ ~FC001 -~FC015 diff --git a/cookbooks/mediawiki/providers/extension.rb b/cookbooks/mediawiki/providers/extension.rb index 4a8943941..959940b93 100644 --- a/cookbooks/mediawiki/providers/extension.rb +++ b/cookbooks/mediawiki/providers/extension.rb @@ -55,7 +55,7 @@ action :create do end if new_resource.template # ~FC023 - template "#{site_directory}/LocalSettings.d/Ext-#{new_resource.name}.inc.php" do + template "#{mediawiki_directory}/LocalSettings.d/Ext-#{new_resource.name}.inc.php" do cookbook "mediawiki" source new_resource.template user node[:mediawiki][:user] @@ -67,7 +67,7 @@ action :create do extension_script = "#{extension_directory}/#{new_resource.name}.php" - file "#{site_directory}/LocalSettings.d/Ext-#{new_resource.name}.inc.php" do + file "#{mediawiki_directory}/LocalSettings.d/Ext-#{new_resource.name}.inc.php" do action :create content " [:create, :enable] do - name = params[:name] +require "securerandom" - # /etc/cron.d names cannot contain a dot - cron_name = name.tr(".", "_") +include Chef::Mixin::EditFile - aliases = Array(params[:aliases]) - - site_directory = params[:directory] || "/srv/#{name}" - - database_params = { - :host => params[:database_host] || "localhost", - :name => params[:database_name], - :username => params[:database_username], - :password => params[:database_password] - } - - mediawiki_repository = "git://github.com/wikimedia/mediawiki-core" - mediawiki_version = params[:version] || "1.22" - mediawiki_reference = "refs/heads/REL#{mediawiki_version}".tr(".", "_") +def whyrun_supported? + true +end - mediawiki = { - :directory => "#{site_directory}/w", - :site => name, - :sitename => params[:sitename] || "OpenStreetMap Wiki", - :metanamespace => params[:metanamespace] || "OpenStreetMap", - :logo => params[:logo] || "$wgStylePath/common/images/wiki.png", - :email_contact => params[:email_contact] || "", - :email_sender => params[:email_sender] || "", - :email_sender_name => params[:email_sender_name] || "MediaWiki Mail", - :commons => params[:commons] || TRUE, - :skin => params[:skin] || "vector", - :site_notice => params[:site_notice] || "", - :site_readonly => params[:site_readonly] || FALSE, - :site_admin_user => "Admin", - :site_admin_pw => params[:admin_password], - :enable_ssl => params[:enable_ssl] || FALSE, - :private_accounts => params[:private_accounts] || FALSE, - :private => params[:private] || FALSE, - :recaptcha_public => params[:recaptcha_public_key], - :recaptcha_private => params[:recaptcha_private_key] - } +use_inline_resources - #---------------- +action :create do + node.set_unless[:mediawiki][:sites][new_resource.name] = {} - node.set_unless[:mediawiki][:sites][name] = {} - node.set[:mediawiki][:sites][name][:site_directory] = site_directory - node.set[:mediawiki][:sites][name][:directory] = mediawiki[:directory] - node.set[:mediawiki][:sites][name][:version] = mediawiki_version - node.set_unless[:mediawiki][:sites][name][:wgSecretKey] = random_password(64) + node.set[:mediawiki][:sites][new_resource.name][:directory] = site_directory + node.set[:mediawiki][:sites][new_resource.name][:version] = new_resource.version - #---------------- + node.set_unless[:mediawiki][:sites][new_resource.name][:wgSecretKey] = SecureRandom.base64(48) - mysql_user "#{database_params[:username]}@localhost" do - password database_params[:password] + mysql_user "#{new_resource.database_user}@localhost" do + password new_resource.database_password end - mysql_database database_params[:name] do - permissions "#{database_params[:username]}@localhost" => :all + mysql_database new_resource.database_name do + permissions "#{new_resource.database_user}@localhost" => :all end + mediawiki_directory = "#{site_directory}/w" + ruby_block "rename-installer-localsettings" do action :nothing block do - ::File.rename("#{mediawiki[:directory]}/LocalSettings.php", "#{mediawiki[:directory]}/LocalSettings-install.php") + ::File.rename("#{mediawiki_directory}/LocalSettings.php", "#{mediawiki_directory}/LocalSettings-install.php") end end - execute "#{mediawiki[:directory]}/maintenance/install.php" do + execute "#{mediawiki_directory}/maintenance/install.php" do action :nothing # Use metanamespace as Site Name to ensure correct set namespace - command "php maintenance/install.php --server '#{name}' --dbtype 'mysql' --dbname '#{database_params[:name]}' --dbuser '#{database_params[:username]}' --dbpass '#{database_params[:password]}' --dbserver '#{database_params[:host]}' --scriptpath /w --pass '#{mediawiki[:site_admin_pw]}' '#{mediawiki[:metanamespace]}' '#{mediawiki[:site_admin_user]}'" - cwd mediawiki[:directory] + command "php maintenance/install.php --server '#{name}' --dbtype 'mysql' --dbname '#{new_resource.database_name}' --dbuser '#{new_resource.database_user}' --dbpass '#{new_resource.database_password}' --dbserver 'localhost' --scriptpath /w --pass '#{new_resource.admin_password}' '#{new_resource.metanamespace}' '#{new_resource.admin_user}'" + cwd mediawiki_directory user node[:mediawiki][:user] group node[:mediawiki][:group] not_if do - File.exist?("#{mediawiki[:directory]}/LocalSettings-install.php") + ::File.exist?("#{mediawiki_directory}/LocalSettings-install.php") end notifies :create, "ruby_block[rename-installer-localsettings]", :immediately end - execute "#{mediawiki[:directory]}/maintenance/update.php" do + execute "#{mediawiki_directory}/maintenance/update.php" do action :nothing command "php maintenance/update.php --quick" - cwd mediawiki[:directory] + cwd mediawiki_directory user node[:mediawiki][:user] group node[:mediawiki][:group] end @@ -112,61 +79,66 @@ define :mediawiki_site, :action => [:create, :enable] do mode 0775 end - directory mediawiki[:directory] do + directory mediawiki_directory do owner node[:mediawiki][:user] group node[:mediawiki][:group] mode 0775 end - git mediawiki[:directory] do + mediawiki_reference = "refs/heads/REL#{new_resource.version}".tr(".", "_") + + git site_directory do action :sync - repository mediawiki_repository + repository "git://github.com/wikimedia/mediawiki-core" reference mediawiki_reference # depth 1 user node[:mediawiki][:user] group node[:mediawiki][:group] - notifies :run, "execute[#{mediawiki[:directory]}/maintenance/install.php]", :immediately - notifies :run, "execute[#{mediawiki[:directory]}/maintenance/update.php]" + notifies :run, "execute[#{mediawiki_directory}/maintenance/install.php]", :immediately + notifies :run, "execute[#{mediawiki_directory}/maintenance/update.php]" end # Safety catch if git doesn't update but install.php hasn't run ruby_block "catch-installer-localsettings-run" do + action :create block do # end not_if do - File.exist?("#{mediawiki[:directory]}/LocalSettings-install.php") + ::File.exist?("#{mediawiki_directory}/LocalSettings-install.php") end - notifies :run, "execute[#{mediawiki[:directory]}/maintenance/install.php]", :immediately - action :create + notifies :run, "execute[#{mediawiki_directory}/maintenance/install.php]", :immediately end - directory "#{mediawiki[:directory]}/images" do + directory "#{mediawiki_directory}/images" do owner "www-data" - group "wiki" + group node[:mediawiki][:group] mode 0775 end - directory "#{mediawiki[:directory]}/cache" do + directory "#{mediawiki_directory}/cache" do owner "www-data" - group "wiki" + group node[:mediawiki][:group] mode 0775 end - directory "#{mediawiki[:directory]}/LocalSettings.d" do + directory "#{mediawiki_directory}/LocalSettings.d" do user node[:mediawiki][:user] group node[:mediawiki][:group] mode 0775 end - template "#{mediawiki[:directory]}/LocalSettings.php" do + template "#{mediawiki_directory}/LocalSettings.php" do cookbook "mediawiki" source "LocalSettings.php.erb" owner node[:mediawiki][:user] group node[:mediawiki][:group] mode 0664 - variables :name => name, :database_params => database_params, :mediawiki => mediawiki - notifies :run, "execute[#{mediawiki[:directory]}/maintenance/update.php]" + 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 template "/etc/cron.d/mediawiki-#{cron_name}" do @@ -175,7 +147,8 @@ define :mediawiki_site, :action => [:create, :enable] do owner "root" group "root" mode 0644 - variables :name => name, :directory => site_directory, :user => node[:mediawiki][:user] + variables :name => new_resource.name, :directory => site_directory, + :user => node[:mediawiki][:user] end template "/etc/cron.daily/mediawiki-#{cron_name}-backup" do @@ -184,83 +157,96 @@ define :mediawiki_site, :action => [:create, :enable] do owner "root" group "root" mode 0700 - variables :name => name, :directory => site_directory, :database_params => database_params + variables :name => new_resource.name, :directory => site_directory, + :database_params => new_resource.database_params end - # MediaWiki Default Extension - mediawiki_extension "Cite" do - site name + site new_resource.name template "mw-ext-Cite.inc.php.erb" + update_site false end mediawiki_extension "ConfirmEdit" do - site name + site new_resource.name template "mw-ext-ConfirmEdit.inc.php.erb" - variables :public_key => mediawiki[:recaptcha_public], - :private_key => mediawiki[:recaptcha_private] + variables :public_key => new_resource.recaptcha_public_key, + :private_key => new_resource.recaptcha_private_key + update_site false end mediawiki_extension "Gadgets" do - site name + site new_resource.name + update_site false end mediawiki_extension "ImageMap" do - site name + site new_resource.name + update_site false end mediawiki_extension "InputBox" do - site name + site new_resource.name + update_site false end mediawiki_extension "Interwiki" do - site name + site new_resource.name + update_site false end - # "LocalisationUpdate" part of Language Extension Bundle, bundled per site - mediawiki_extension "Nuke" do - site name + site new_resource.name + update_site false end mediawiki_extension "ParserFunctions" do - site name + site new_resource.name template "mw-ext-ParserFunctions.inc.php.erb" + update_site false end mediawiki_extension "PdfHandler" do - site name + site new_resource.name template "mw-ext-PdfHandler.inc.php.erb" + update_site false end mediawiki_extension "Poem" do - site name + site new_resource.name + update_site false end mediawiki_extension "Renameuser" do - site name + site new_resource.name + update_site false end mediawiki_extension "SimpleAntiSpam" do - site name + site new_resource.name + update_site false end mediawiki_extension "SpamBlacklist" do - site name + site new_resource.name template "mw-ext-SpamBlacklist.inc.php.erb" + update_site false end mediawiki_extension "SyntaxHighlight_GeSHi" do - site name + site new_resource.name + update_site false end mediawiki_extension "TitleBlacklist" do - site name + site new_resource.name template "mw-ext-TitleBlacklist.inc.php.erb" + update_site false end mediawiki_extension "WikiEditor" do - site name + site new_resource.name + update_site false end # MediaWiki Language Extension Bundle @@ -268,26 +254,30 @@ define :mediawiki_site, :action => [:create, :enable] do mw_lang_ext_bundle_tag = "2014.09" mediawiki_extension "Babel" do - site name + site new_resource.name template "mw-ext-Babel.inc.php.erb" tag mw_lang_ext_bundle_tag + update_site false end mediawiki_extension "cldr" do - site name + site new_resource.name tag mw_lang_ext_bundle_tag + update_site false end mediawiki_extension "CleanChanges" do - site name + site new_resource.name template "mw-ext-CleanChanges.inc.php.erb" tag mw_lang_ext_bundle_tag + update_site false end mediawiki_extension "LocalisationUpdate" do - site name + site new_resource.name template "mw-ext-LocalisationUpdate.inc.php.erb" tag mw_lang_ext_bundle_tag + update_site false end # LocalisationUpdate Update Cron @@ -301,62 +291,70 @@ define :mediawiki_site, :action => [:create, :enable] do # end # mediawiki_extension "Translate" do - # site name + # site new_resource.name # template "mw-ext-Translate.inc.php.erb" # tag mw_lang_ext_bundle_tag + # update_site false # end mediawiki_extension "UniversalLanguageSelector" do - site name + site new_resource.name tag mw_lang_ext_bundle_tag + update_site false end - # Global Extra Mediawiki Extensions - mediawiki_extension "AntiSpoof" do - site name + site new_resource.name + update_site false end mediawiki_extension "AbuseFilter" do - site name + site new_resource.name template "mw-ext-AbuseFilter.inc.php.erb" + update_site false end mediawiki_extension "CheckUser" do - site name + site new_resource.name template "mw-ext-CheckUser.inc.php.erb" + update_site false end mediawiki_extension "DismissableSiteNotice" do - site name + site new_resource.name + update_site false end mediawiki_extension "Elastica" do - site name + site new_resource.name + update_site false end mediawiki_extension "CirrusSearch" do - site name + site new_resource.name template "mw-ext-CirrusSearch.inc.php.erb" + update_site false end - # OSM specifc extensions - mediawiki_extension "osmtaginfo" do - site name + site new_resource.name repository "git://github.com/Firefishy/osmtaginfo.git" tag "live" + update_site false end + mediawiki_extension "SimpleMap" do - site name + site new_resource.name repository "git://github.com/Firefishy/SimpleMap.git" tag "live" + update_site false end mediawiki_extension "SlippyMap" do - site name + site new_resource.name repository "git://github.com/Firefishy/SlippyMap.git" tag "live" + update_site false end cookbook_file "#{site_directory}/cc-wiki.png" do @@ -383,20 +381,52 @@ define :mediawiki_site, :action => [:create, :enable] do backup false end - apache_site name do + apache_site new_resource.name do cookbook "mediawiki" template "apache.erb" directory site_directory - variables :aliases => aliases, :mediawiki => mediawiki - notifies :reload, "service[apache2]" + variables :aliases => Array(new_resource.aliases), + :private => new_resource.private, + :ssl_enabled => new_resource.ssl_enabled, + :ssl_certificate => new_resource.ssl_certificate, + :ssl_certificate_chain => new_resource.ssl_certificate_chain + reload_apache false end - # FIXME: needs to run once - execute "#{mediawiki[:directory]}/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php" do + # FIXME: needs to run one + execute "#{mediawiki_directory}/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php" do action :nothing command "php extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php" - cwd mediawiki[:directory] + cwd mediawiki_directory user node[:mediawiki][:user] group node[:mediawiki][:group] end end + +action :delete do + apache_site new_resource.name do + action :delete + reload_apache false + end + + directory site_directory do + action :delete + recursive true + end + + mysql_database new_resource.database_name do + action :drop + end + + mysql_user "#{new_resource.database_user}@localhost" do + action :drop + end +end + +def site_directory + new_resource.directory || "/srv/#{new_resource.name}" +end + +def cron_name + new_resource.name.tr(".", "_") +end diff --git a/cookbooks/mediawiki/resources/extension.rb b/cookbooks/mediawiki/resources/extension.rb index 6093bdbe9..437355ff1 100644 --- a/cookbooks/mediawiki/resources/extension.rb +++ b/cookbooks/mediawiki/resources/extension.rb @@ -28,7 +28,7 @@ attribute :variables, :kind_of => Hash, :default => {} attribute :version, :kind_of => String attribute :repository, :kind_of => String attribute :tag, :kind_of => String -attribute :update_site, :kind_of => [TrueClass, FalseClass], :default => false +attribute :update_site, :kind_of => [TrueClass, FalseClass], :default => true def after_created if update_site @@ -36,7 +36,7 @@ def after_created else site_directory = node[:mediawiki][:sites][site][:directory] - notifies :create, "template[#{site_directory}/LocalSettings.php]" - notifies :run, "execute[#{site_directory}/maintenance/update.php]" + notifies :create, "template[#{site_directory}/w/LocalSettings.php]" + notifies :run, "execute[#{site_directory}/w/maintenance/update.php]" end end diff --git a/cookbooks/mediawiki/resources/site.rb b/cookbooks/mediawiki/resources/site.rb new file mode 100644 index 000000000..67fa0000a --- /dev/null +++ b/cookbooks/mediawiki/resources/site.rb @@ -0,0 +1,79 @@ +# +# Cookbook Name:: mediawiki +# Resource:: mediawiki_site +# +# Copyright 2015, OpenStreetMap Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +actions :create, :delete +default_action :create + +attribute :name, :kind_of => String, :name_attribute => true +attribute :aliases, :kind_of => [String, Array] +attribute :directory, :kind_of => String +attribute :version, :kind_of => String, :default => "1.22" +attribute :database_name, :kind_of => String, :required => true +attribute :database_user, :kind_of => String, :required => true +attribute :database_password, :kind_of => String, :required => true +attribute :sitename, :kind_of => String, :default => "OpenStreetMap Wiki" +attribute :metanamespace, :kind_of => String, :default => "OpenStreetMap" +attribute :logo, :kind_of => String, :default => "$wgStylePath/common/images/wiki.png" +attribute :email_contact, :kind_of => String, :default => "" +attribute :email_sender, :kind_of => String, :default => "" +attribute :email_sender_name, :kind_of => String, :default => "MediaWiki Mail" +attribute :commons, :kind_of => [TrueClass, FalseClass], :default => true +attribute :skin, :kind_of => String, :default => "vector" +attribute :site_notice, :kind_of => String, :default => "" +attribute :site_readonly, :kind_of => [TrueClass, FalseClass], :default => false +attribute :admin_user, :kind_of => String, :default => "Admin" +attribute :admin_password, :kind_of => String, :required => true +attribute :ssl_enabled, :kind_of => [TrueClass, FalseClass], :default => false +attribute :ssl_certificate, :kind_of => String +attribute :ssl_certificate_chain, :kind_of => String +attribute :private_accounts, :kind_of => [TrueClass, FalseClass], :default => false +attribute :private, :kind_of => [TrueClass, FalseClass], :default => false +attribute :recaptcha_public_key, :kind_of => String +attribute :recaptcha_private_key, :kind_of => String +attribute :reload_apache, :kind_of => [TrueClass, FalseClass], :default => true + +def after_created + notifies :reload, "service[apache2]" if reload_apache +end + +def database_params + { + :host => "localhost", + :name => database_name, + :username => database_user, + :password => database_password + } +end + +def mediawiki_params + { + :sitename => sitename, + :metanamespace => metanamespace, + :logo => logo, + :email_contact => email_contact, + :email_sender => email_sender, + :email_sender_name => email_sender_name, + :commons => commons, + :skin => skin, + :site_notice => site_notice, + :site_readonly => site_readonly, + :private_accounts => private_accounts, + :private => private + } +end diff --git a/cookbooks/mediawiki/templates/default/LocalSettings.php.erb b/cookbooks/mediawiki/templates/default/LocalSettings.php.erb index 9f6ecb217..1389dbabd 100644 --- a/cookbooks/mediawiki/templates/default/LocalSettings.php.erb +++ b/cookbooks/mediawiki/templates/default/LocalSettings.php.erb @@ -291,7 +291,6 @@ $wgNamespacesToBeSearchedDefault[NS_LANG_JA] = TRUE; $wgReadOnly = "<%= @mediawiki[:site_readonly] %>"; <% end -%> -<% Dir.glob("#{@mediawiki[:directory]}/LocalSettings.d/*.php") do |file| -%> +<% Dir.glob("#{@directory}/LocalSettings.d/*.php") do |file| -%> <%= "require_once('#{file}');" %> <% end -%> - diff --git a/cookbooks/mediawiki/templates/default/apache.erb b/cookbooks/mediawiki/templates/default/apache.erb index 0c9dd3f3c..16f97362d 100644 --- a/cookbooks/mediawiki/templates/default/apache.erb +++ b/cookbooks/mediawiki/templates/default/apache.erb @@ -30,7 +30,7 @@ RedirectMatch 301 ^/api\.php$ /w/api.php RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php - Alias /wiki <%= @mediawiki[:directory] %>/index.php + Alias /wiki <%= @directory %>/w/index.php #Support /pagename -> /wiki/pagename RewriteEngine on @@ -51,18 +51,18 @@ Require all granted - /images/> + /w/images/> # No php execution in the upload area php_admin_flag engine off Options -ExecCGI -Includes -Indexes AllowOverride None AddType text/plain .html .htm .shtml -<% if @mediawiki[:private] -%> +<% if @private -%> Require all denied <% end -%> - /images/thumb/> + /w/images/thumb/> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f @@ -82,15 +82,15 @@ RewriteRule ^archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B] - /maintenance/> + /w/maintenance/> Require all denied - /LocalSettings.php> + /w/LocalSettings.php> Require all denied - /cache/> + /w/cache/> Options -ExecCGI -Includes -Indexes AllowOverride None AddType text/plain .html .htm .shtml @@ -109,7 +109,7 @@ Require all denied -<% if @mediawiki[:enable_ssl] -%> +<% if @ssl_enabled -%> ServerName <%= @name %> <% @aliases.each do |alias_name| -%> @@ -142,7 +142,7 @@ RedirectMatch 301 ^/api\.php$ /w/api.php RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php - Alias /wiki <%= @mediawiki[:directory] %>/index.php + Alias /wiki <%= @directory %>/w/index.php #Support /pagename -> /wiki/pagename RewriteEngine on @@ -163,17 +163,17 @@ Require all granted - /images/> + /w/images/> # No php execution in the upload area php_admin_flag engine off Options -ExecCGI -Includes -Indexes AllowOverride None -<% if @mediawiki[:private] -%> +<% if @private -%> Require all denied <% end -%> - /images/thumb/> + /w/images/thumb/> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f @@ -185,22 +185,22 @@ RewriteRule ^archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B] - /maintenance/> + /w/maintenance/> Require all denied - /LocalSettings.php> + /w/LocalSettings.php> Require all denied - /images/> + /w/images/> Options -ExecCGI -Includes -Indexes AllowOverride None AddType text/plain .html .htm .shtml php_admin_flag engine off - /cache/> + /w/cache/> Options -ExecCGI -Includes -Indexes AllowOverride None AddType text/plain .html .htm .shtml diff --git a/cookbooks/wiki/recipes/default.rb b/cookbooks/wiki/recipes/default.rb index 23b88aea1..bb5f88bf3 100644 --- a/cookbooks/wiki/recipes/default.rb +++ b/cookbooks/wiki/recipes/default.rb @@ -28,13 +28,15 @@ apache_site "default" do end mediawiki_site "wiki.openstreetmap.org" do - aliases "wiki.osm.org", "wiki.openstreetmap.com", "wiki.openstreetmap.net", "wiki.openstreetmap.ca", "wiki.openstreetmap.eu", "wiki.openstreetmap.pro", "wiki.openstreetmaps.org" + aliases ["wiki.osm.org", "wiki.openstreetmap.com", "wiki.openstreetmap.net", + "wiki.openstreetmap.ca", "wiki.openstreetmap.eu", + "wiki.openstreetmap.pro", "wiki.openstreetmaps.org"] directory "/srv/wiki.openstreetmap.org" - enable_ssl TRUE + ssl_enabled TRUE database_name "wiki" - database_username "wiki-user" + database_user "wiki-user" database_password passwords["database"] admin_password passwords["admin"]