--- /dev/null
+= DESCRIPTION:
+
+= REQUIREMENTS:
+
+= ATTRIBUTES:
+
+= USAGE:
+
--- /dev/null
+# Default to enabling the "wiki" role
+default[:accounts][:users][:wiki][:status] = :role
+
+# Use prefork as PHP is to dumb for anything else
+default[:apache][:mpm] = "prefork"
+
+# Set mediawiki defaults
+default[:mediawiki][:user] = "wiki"
+default[:mediawiki][:group] = "wiki"
+default[:mediawiki][:sites] = {}
+
--- /dev/null
+#
+# Cookbook Name:: mediawiki
+# Definition:: mediawiki_extension
+#
+# Copyright 2013, 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.
+#
+
+define :mediawiki_extension, :action => [ :enable ] do
+ name = params[:name]
+ site = params[:site]
+ site_directory = node[:mediawiki][:sites][site][:site_directory]
+ mediawiki_directory = node[:mediawiki][:sites][site][:directory]
+ extension_directory = "#{mediawiki_directory}/extensions/#{name}"
+ source = params[:source]
+ template = params[:template]
+
+ if source
+ remote_directory extension_directory do
+ cookbook "mediawiki"
+ source source
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0755
+ files_owner node[:mediawiki][:user]
+ files_group node[:mediawiki][:group]
+ files_mode 0755
+ end
+ else
+ repository = params[:repository] || "git://github.com/wikimedia/mediawiki-extensions-#{name}.git"
+ version = params[:version] || node[:mediawiki][:sites][site][:version]
+ tag = params[:tag]
+ if tag
+ reference = "refs/tags/#{tag}"
+ else
+ reference = "refs/heads/REL#{version}".tr(".", "_")
+ end
+
+ git extension_directory do
+ action :sync
+ repository repository
+ reference reference
+ depth 1
+ enable_submodules true
+ user node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ ignore_failure repository.start_with?("git://github.com/wikimedia/mediawiki-extensions")
+ notifies :run, resources(:execute => "#{mediawiki_directory}/maintenance/update.php")
+ end
+ end
+
+ if template
+ template "#{mediawiki_directory}/LocalSettings.d/Ext-#{name}.inc.php" do
+ cookbook "mediawiki"
+ source template
+ user node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0664
+ notifies :create, resources(:template => "#{mediawiki_directory}/LocalSettings.php")
+ end
+ end
+
+ file "#{mediawiki_directory}/LocalSettings.d/Ext-#{name}.inc.php" do
+ action :create_if_missing
+ user node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0664
+ content "<?php require_once('#{extension_directory}/#{name}.php');\n"
+ only_if do File.exist?("#{extension_directory}/#{name}.php") end
+ notifies :create, resources(:template => "#{mediawiki_directory}/LocalSettings.php")
+ end
+end
--- /dev/null
+#
+# Cookbook Name:: web
+# Definition:: mediawiki_site
+#
+# Copyright 2012, 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.
+#
+
+define :mediawiki_site, :action => [ :create, :enable ] do
+ name = params[:name]
+
+ #/etc/cron.d names cannot contain a dot
+ cron_name = name.tr(".", "_")
+
+ 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(".", "_")
+
+ passwords = data_bag_item("mediawiki", "passwords")
+
+ 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 => passwords["mediawiki-admin-user"],
+ :enable_ssl => params[:enable_ssl] || FALSE
+ }
+
+#----------------
+
+ 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)
+
+#----------------
+
+ mysql_user "#{database_params[:username]}@localhost" do
+ password database_params[:password]
+ end
+
+ mysql_database database_params[:name] do
+ permissions "#{database_params[:username]}@localhost" => :all
+ end
+
+ ruby_block "rename-installer-localsettings" do
+ action :nothing
+ block do
+ ::File.rename("#{mediawiki[:directory]}/LocalSettings.php","#{mediawiki[:directory]}/LocalSettings-install.php")
+ end
+ end
+
+ 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]
+ user node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ not_if do
+ File.exists?("#{mediawiki[:directory]}/LocalSettings-install.php")
+ end
+ notifies :create, 'ruby_block[rename-installer-localsettings]', :immediately
+ end
+
+ execute "#{mediawiki[:directory]}/maintenance/update.php" do
+ action :nothing
+ command "php maintenance/update.php --quick"
+ cwd mediawiki[:directory]
+ user node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ end
+
+ directory "#{site_directory}" do
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0775
+ end
+
+ directory "#{mediawiki[:directory]}" do
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0775
+ end
+
+ git "#{mediawiki[:directory]}" do
+ action :sync
+ repository mediawiki_repository
+ reference mediawiki_reference
+ depth 1
+ user node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ notifies :run, resources(:execute => "#{mediawiki[:directory]}/maintenance/install.php"), :immediately
+ notifies :run, resources(: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
+ block do
+ #
+ end
+ not_if do
+ File.exists?("#{mediawiki[:directory]}/LocalSettings-install.php")
+ end
+ notifies :run, resources(:execute => "#{mediawiki[:directory]}/maintenance/install.php"), :immediately
+ action :create
+ end
+
+ directory "#{mediawiki[:directory]}/images" do
+ owner "www-data"
+ group "wiki"
+ mode 0775
+ end
+
+ directory "#{mediawiki[:directory]}/cache" do
+ owner "www-data"
+ group "wiki"
+ mode 0775
+ end
+
+ directory "#{mediawiki[:directory]}/LocalSettings.d" do
+ user node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0775
+ end
+
+ 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, resources(:execute => "#{mediawiki[:directory]}/maintenance/update.php")
+ end
+
+ template "/etc/cron.d/mediawiki-#{cron_name}" do
+ cookbook "mediawiki"
+ source "mediawiki.cron.erb"
+ owner "root"
+ group "root"
+ mode 0644
+ variables({
+ :name => name,
+ :directory => site_directory,
+ :user => node[:mediawiki][:user]
+ })
+ end
+
+ template "/etc/cron.daily/mediawiki-#{cron_name}-backup" do
+ cookbook "mediawiki"
+ source "mediawiki-backup.cron.erb"
+ owner "root"
+ group "root"
+ mode 0700
+ variables({
+ :name => name,
+ :directory => site_directory,
+ :database_params => database_params
+ })
+ end
+
+ #MediaWiki Default Extension
+
+ mediawiki_extension "Cite" do
+ site name
+ template "mw-ext-Cite.inc.php.erb"
+ end
+
+ mediawiki_extension "ConfirmEdit" do
+ site name
+ template "mw-ext-ConfirmEdit.inc.php.erb"
+ end
+
+ mediawiki_extension "Gadgets" do
+ site name
+ end
+
+ mediawiki_extension "ImageMap" do
+ site name
+ end
+
+ mediawiki_extension "InputBox" do
+ site name
+ end
+
+ mediawiki_extension "Interwiki" do
+ site name
+ end
+
+ # "LocalisationUpdate" part of Language Extension Bundle, bundled per site
+
+ mediawiki_extension "Nuke" do
+ site name
+ end
+
+ mediawiki_extension "ParserFunctions" do
+ site name
+ template "mw-ext-ParserFunctions.inc.php.erb"
+ end
+
+ mediawiki_extension "PdfHandler" do
+ site name
+ template "mw-ext-PdfHandler.inc.php.erb"
+ end
+
+ mediawiki_extension "Poem" do
+ site name
+ end
+
+ mediawiki_extension "Renameuser" do
+ site name
+ end
+
+ mediawiki_extension "SimpleAntiSpam" do
+ site name
+ end
+
+ mediawiki_extension "SpamBlacklist" do
+ site name
+ template "mw-ext-SpamBlacklist.inc.php.erb"
+ end
+
+ mediawiki_extension "SyntaxHighlight_GeSHi" do
+ site name
+ end
+
+ mediawiki_extension "TitleBlacklist" do
+ site name
+ template "mw-ext-TitleBlacklist.inc.php.erb"
+ end
+
+ mediawiki_extension "WikiEditor" do
+ site name
+ end
+
+ # MediaWiki Language Extension Bundle
+ #fixme should automatically resolve tag
+ mw_lang_ext_bundle_tag = "2014.09"
+
+ mediawiki_extension "Babel" do
+ site name
+ template "mw-ext-Babel.inc.php.erb"
+ tag mw_lang_ext_bundle_tag
+ end
+
+ mediawiki_extension "cldr" do
+ site name
+ tag mw_lang_ext_bundle_tag
+ end
+
+ mediawiki_extension "CleanChanges" do
+ site name
+ template "mw-ext-CleanChanges.inc.php.erb"
+ tag mw_lang_ext_bundle_tag
+ end
+
+ mediawiki_extension "LocalisationUpdate" do
+ site name
+ template "mw-ext-LocalisationUpdate.inc.php.erb"
+ tag mw_lang_ext_bundle_tag
+ end
+
+ #LocalisationUpdate Update Cron
+ #template "/etc/cron.d/mediawiki-#{name}-LocalisationUpdate" do
+ # cookbook "mediawiki"
+ # source "mediawiki-LocalisationUpdate.cron.erb"
+ # owner "root"
+ # group "root"
+ # mode 0755
+ # variables({
+ # :name => name,
+ # :directory => site_directory,
+ # :user => node[:mediawiki][:user]
+ # })
+ #end
+
+ #mediawiki_extension "Translate" do
+ # site name
+ # template "mw-ext-Translate.inc.php.erb"
+ # tag mw_lang_ext_bundle_tag
+ #end
+
+ mediawiki_extension "UniversalLanguageSelector" do
+ site name
+ tag mw_lang_ext_bundle_tag
+ end
+
+ # Global Extra Mediawiki Extensions
+
+ mediawiki_extension "AntiSpoof" do
+ site name
+ end
+
+ mediawiki_extension "AbuseFilter" do
+ site name
+ template "mw-ext-AbuseFilter.inc.php.erb"
+ end
+
+ mediawiki_extension "CheckUser" do
+ site name
+ template "mw-ext-CheckUser.inc.php.erb"
+ end
+
+ mediawiki_extension "DismissableSiteNotice" do
+ site name
+ end
+
+ mediawiki_extension "Elastica" do
+ site name
+ end
+
+ mediawiki_extension "CirrusSearch" do
+ site name
+ template "mw-ext-CirrusSearch.inc.php.erb"
+ end
+
+ #OSM specifc extensions
+
+ mediawiki_extension "osmtaginfo" do
+ site name
+ repository "git://github.com/Firefishy/osmtaginfo.git"
+ tag "live"
+ end
+ mediawiki_extension "SimpleMap" do
+ site name
+ repository "git://github.com/Firefishy/SimpleMap.git"
+ tag "live"
+ end
+
+ mediawiki_extension "SlippyMap" do
+ site name
+ repository "git://github.com/Firefishy/SlippyMap.git"
+ tag "live"
+ end
+
+ cookbook_file "#{site_directory}/cc-wiki.png" do
+ cookbook "mediawiki"
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0644
+ backup false
+ end
+
+ cookbook_file "#{site_directory}/googled06a989d1ccc8364.html" do
+ cookbook "mediawiki"
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0644
+ backup false
+ end
+
+ cookbook_file "#{site_directory}/googlefac54c35e800caab.html" do
+ cookbook "mediawiki"
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0644
+ backup false
+ end
+
+ apache_site name do
+ cookbook "mediawiki"
+ template "apache.erb"
+ directory site_directory
+ variables({
+ :aliases => aliases,
+ :mediawiki => mediawiki
+ })
+ notifies :reload, "service[apache2]"
+ end
+
+ #Fixme - Needs to run once
+ execute "#{mediawiki[:directory]}/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php" do
+ action :nothing
+ command "php extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php"
+ cwd mediawiki[:directory]
+ user node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ end
+
+end
--- /dev/null
+google-site-verification: googlefac54c35e800caab.html
--- /dev/null
+maintainer "OpenStreetMap Administrators"
+maintainer_email "admins@openstreetmap.org"
+license "Apache 2.0"
+description "Installs and configures mediawiki"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+version "1.0.0"
+depends "git"
+depends "memcached"
+depends "mysql"
--- /dev/null
+#
+# Cookbook Name:: mediawiki
+# Recipe:: default
+#
+# Copyright 2013, 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.
+#
+
+include_recipe "memcached"
+include_recipe "apache::ssl"
+include_recipe "mysql"
+include_recipe "git"
+
+#Mediawiki Base Requirements
+package "php5"
+package "php5-cli"
+package "php5-curl"
+package "php5-mysql"
+package "php5-gd"
+package "php-apc"
+package "php5-intl"
+package "libapache2-mod-php5"
+
+package "php-wikidiff2"
+
+#Mediawiki Image + SVG support
+package "imagemagick"
+package "librsvg2-bin"
+
+#Mediawiki PDF support via Extension:PdfHandler
+package "ghostscript"
+package "poppler-utils"
+
+#Mediawiki backup
+package "xz-utils"
+
+apache_module "php5"
+apache_module "rewrite"
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+
+# Protect against web entry
+if ( !defined( 'MEDIAWIKI' ) ) {
+ exit;
+}
+
+## Uncomment this to disable output compression
+# $wgDisableOutputCompression = true;
+
+$wgSitename = '<%= @mediawiki[:sitename] %>';
+$wgMetaNamespace = '<%= @mediawiki[:metanamespace] %>';
+
+
+## The URL base path to the directory containing the wiki;
+## defaults for all runtime URL paths are based off of this.
+## For more information on customizing the URLs
+## (like /w/index.php/Page_title to /wiki/Page_title) please see:
+## http://www.mediawiki.org/wiki/Manual:Short_URL
+$wgScriptPath = "/w";
+$wgArticlePath = '/wiki/$1';
+$wgUsePathInfo = true;
+$wgScriptExtension = ".php";
+
+## The protocol and server name to use in fully-qualified URLs
+$wgServer = "//<%= @mediawiki[:site] %>";
+$wgInternalServer = 'http://<%= @mediawiki[:site] %>';
+
+<% if @mediawiki[:enable_ssl] -%>
+$wgSecureLogin = true;
+$wgDefaultUserOptions['prefershttps'] = 0;
+<% end -%>
+$wgCookieSecure = false;
+
+## The relative URL path to the skins directory
+$wgStylePath = "$wgScriptPath/skins";
+
+## The relative URL path to the logo. Make sure you change this from the default,
+## or else you'll overwrite your logo when you upgrade!
+$wgLogo = "<%= @mediawiki[:logo] %>";
+
+## UPO means: this is also a user preference option
+
+$wgEnableEmail = true;
+$wgEnableUserEmail = true; # UPO
+
+$wgEmergencyContact = "<%= @mediawiki[:email_contact] %>";
+$wgPasswordSender = "<%= @mediawiki[:email_sender] %>";
+$wgPasswordSenderName = "<%= @mediawiki[:email_sender_name] %>"; //Replaced by MediaWiki:Emailsender in v1.23.0
+
+$wgEnotifUserTalk = true; # UPO
+$wgEnotifWatchlist = true; # UPO
+$wgEmailAuthentication = true;
+
+$wgEnotifUseJobQ = true;
+
+## Database settings
+$wgDBtype = "mysql";
+$wgDBserver = "<%= @database_params[:host] %>";
+$wgDBname = "<%= @database_params[:name] %>";
+$wgDBuser = "<%= @database_params[:username] %>";
+$wgDBpassword = "<%= @database_params[:password] %>";
+
+# MySQL specific settings
+$wgDBprefix = "";
+
+# MySQL table options to use during installation or update
+$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
+
+# Experimental charset support for MySQL 5.0.
+$wgDBmysql5 = false;
+
+## Shared memory settings
+$wgMainCacheType = CACHE_MEMCACHED;
+$wgMemCachedServers = array('127.0.0.1:11211');
+$wgSessionsInObjectCache = TRUE;
+
+## To enable image uploads, make sure the 'images' directory
+## is writable, then set this to true:
+$wgEnableUploads = true;
+$wgUseImageMagick = true;
+$wgImageMagickConvertCommand = "/usr/bin/convert";
+
+$wgGenerateThumbnailOnParse = false;
+$wgMaxImageArea = 125000000;
+$wgMaxShellMemory = 5524000;
+$wgMaxShellFileSize = 819200;
+$wgMaxShellTime = 360;
+$wgMaxShellWallClockTime = 360;
+
+# Allow some more upload extensions
+$wgFileExtensions[] = 'doc';
+$wgFileExtensions[] = 'pdf';
+$wgFileExtensions[] = 'odt';
+$wgFileExtensions[] = 'odp';
+$wgFileExtensions[] = 'svg';
+
+$wgSVGConverters = array( 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input');
+$wgSVGConverter = 'rsvg';
+$wgSVGMaxSize = 2000;
+
+# InstantCommons allows wiki to use images from http://commons.wikimedia.org
+<% if @mediawiki[:commons] -%>
+$wgUseInstantCommons = true;
+<% else -%>
+$wgUseInstantCommons = false;
+<% end -%>
+
+## If you use ImageMagick (or any other shell command) on a
+## Linux server, this will need to be set to the name of an
+## available UTF-8 locale
+$wgShellLocale = "en_US.utf8";
+
+## If you want to use image uploads under safe mode,
+## create the directories images/archive, images/thumb and
+## images/temp, and make them all writable. Then uncomment
+## this, if it's not already uncommented:
+#$wgHashedUploadDirectory = false;
+
+## Set $wgCacheDirectory to a writable directory on the web server
+## to make your wiki go slightly faster. The directory should not
+## be publically accessible from the web.
+#$wgCacheDirectory = "$IP/cache";
+
+# Site language code, should be one of the list in ./languages/Names.php
+$wgLanguageCode = "en";
+
+$wgSecretKey = "<%= @node[:mediawiki][:sites][@name][:wgSecretKey] %>";
+
+# Site upgrade key. Must be set to a string (default provided) to turn on the
+# web installer while LocalSettings.php is in place
+#$wgUpgradeKey = "6ad907e74fc65836";
+
+## Default skin: you can change the default skin. Use the internal symbolic
+## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
+$wgDefaultSkin = "<%= @mediawiki[:skin] %>";
+
+## For attaching licensing metadata to pages, and displaying an
+## appropriate copyright notice / icon. GNU Free Documentation
+## License and Creative Commons licenses are supported so far.
+$wgRightsPage = "OpenStreetMap_License"; # Set to the title of a wiki page that describes your license/copyright
+$wgRightsUrl = "http://creativecommons.org/licenses/by-sa/2.0/";
+$wgRightsText = "Creative Commons Attribution-ShareAlike 2.0 license";
+$wgRightsIcon = "/cc-wiki.png";
+
+# Path to the GNU diff3 utility. Used for conflict resolution.
+$wgDiff3 = "/usr/bin/diff3";
+
+$wgExternalDiffEngine = 'wikidiff2';
+
+# Query string length limit for ResourceLoader. You should only set this if
+# your web server has a query string length limit (then set it to that limit),
+# or if you have suhosin.get.max_value_length set in php.ini (then set it to
+# that value)
+$wgResourceLoaderMaxQueryLength = -1;
+
+# End of automatically generated settings.
+# Add more configuration options below.
+
+#Only Allow Signed-in users to edit
+$wgGroupPermissions['*']['edit'] = false;
+
+#Allow bureaucrat group access to oversight options
+$wgGroupPermissions['bureaucrat']['hideuser'] = true;
+$wgGroupPermissions['bureaucrat']['deletelogentry'] = true;
+$wgGroupPermissions['bureaucrat']['deleterevision'] = true;
+$wgGroupPermissions['bureaucrat']['suppressrevision'] = true;
+$wgGroupPermissions['bureaucrat']['suppressionlog'] = true;
+
+#Allow Subpages on Main Namespace
+$wgNamespacesWithSubpages[NS_MAIN] = true;
+
+#DNS Blacklists to use
+$wgEnableDnsBlacklist = true;
+$wgDnsBlacklistUrls = array( 'proxies.dnsbl.sorbs.net.', 'opm.tornevall.org.', 'xbl.spamhaus.org.' );
+
+#Disable Hit Counter for Performance
+$wgDisableCounters = TRUE;
+#Disable IP in Header to avoid cache issue
+$wgShowIPinHeader = FALSE;
+
+#Job Runs by cron
+$wgJobRunRate = 0;
+
+# Allow external images from a few sites
+$wgAllowExternalImagesFrom = array( 'http://tile.openstreetmap.org/', 'http://svenanders.openstreetmap.de/', 'http://josm.openstreetmap.de/', 'http://trac.openstreetmap.org/', 'http://rweait.dev.openstreetmap.org/' );
+
+$wgNoFollowDomainExceptions = array( 'www.openstreetmap.org', 'josm.openstreetmap.de', 'taginfo.openstreetmap.org', 'blog.openstreetmap.org', 'wiki.osmfoundation.org' );
+
+#FIXME - move to specific
+$wgForceUIMsgAsContentMsg = array( 'mainpage-url', 'portal-url', 'mapfeatures-url', 'helppage' );
+
+#FIXME - move to specific
+$wgAllowUserJs = TRUE;
+$wgAllowUserCss = TRUE;
+
+#FIXME - move to specific
+#DE
+define('NS_LANG_DE', 200);
+$wgExtraNamespaces[NS_LANG_DE] = 'DE';
+$wgNamespacesWithSubpages[NS_LANG_DE] = TRUE;
+$wgContentNamespaces[] = NS_LANG_DE;
+define('NS_LANG_DE_TALK', 201);
+$wgExtraNamespaces[NS_LANG_DE_TALK] = 'DE_talk';
+$wgNamespacesWithSubpages[NS_LANG_DE_TALK] = TRUE;
+
+#FR
+define('NS_LANG_FR', 202);
+$wgExtraNamespaces[NS_LANG_FR] = 'FR';
+$wgNamespacesWithSubpages[NS_LANG_FR] = TRUE;
+$wgContentNamespaces[] = NS_LANG_FR;
+define('NS_LANG_FR_TALK', 203);
+$wgExtraNamespaces[NS_LANG_FR_TALK] = 'FR_talk';
+$wgNamespacesWithSubpages[NS_LANG_FR_TALK] = TRUE;
+
+#ES
+define('NS_LANG_ES', 204);
+$wgExtraNamespaces[NS_LANG_ES] = 'ES';
+$wgNamespacesWithSubpages[NS_LANG_ES] = TRUE;
+$wgContentNamespaces[] = NS_LANG_ES;
+define('NS_LANG_ES_TALK', 205);
+$wgExtraNamespaces[NS_LANG_ES_TALK] = 'ES_talk';
+$wgNamespacesWithSubpages[NS_LANG_ES_TALK] = TRUE;
+
+#IT
+define('NS_LANG_IT', 206);
+$wgExtraNamespaces[NS_LANG_IT] = 'IT';
+$wgNamespacesWithSubpages[NS_LANG_IT] = TRUE;
+$wgContentNamespaces[] = NS_LANG_IT;
+define('NS_LANG_IT_TALK', 207);
+$wgExtraNamespaces[NS_LANG_IT_TALK] = 'IT_talk';
+$wgNamespacesWithSubpages[NS_LANG_IT_TALK] = TRUE;
+
+#NL
+define('NS_LANG_NL', 208);
+$wgExtraNamespaces[NS_LANG_NL] = 'NL';
+$wgNamespacesWithSubpages[NS_LANG_NL] = TRUE;
+$wgContentNamespaces[] = NS_LANG_NL;
+define('NS_LANG_NL_TALK', 209);
+$wgExtraNamespaces[NS_LANG_NL_TALK] = 'NL_talk';
+$wgNamespacesWithSubpages[NS_LANG_NL_TALK] = TRUE;
+
+#RU
+define('NS_LANG_RU', 210);
+$wgExtraNamespaces[NS_LANG_RU] = 'RU';
+$wgNamespacesWithSubpages[NS_LANG_RU] = TRUE;
+$wgContentNamespaces[] = NS_LANG_RU;
+define('NS_LANG_RU_TALK', 211);
+$wgExtraNamespaces[NS_LANG_RU_TALK] = 'RU_talk';
+$wgNamespacesWithSubpages[NS_LANG_RU_TALK] = TRUE;
+
+#JA
+define('NS_LANG_JA', 212);
+$wgExtraNamespaces[NS_LANG_JA] = 'JA';
+$wgNamespacesWithSubpages[NS_LANG_JA] = TRUE;
+$wgContentNamespaces[] = NS_LANG_JA;
+define('NS_LANG_JA_TALK', 213);
+$wgExtraNamespaces[NS_LANG_JA_TALK] = 'JA_talk';
+$wgNamespacesWithSubpages[NS_LANG_JA_TALK] = TRUE;
+
+$wgNamespacesToBeSearchedDefault[NS_LANG_DE] = TRUE;
+$wgNamespacesToBeSearchedDefault[NS_LANG_FR] = TRUE;
+$wgNamespacesToBeSearchedDefault[NS_LANG_ES] = TRUE;
+$wgNamespacesToBeSearchedDefault[NS_LANG_IT] = TRUE;
+$wgNamespacesToBeSearchedDefault[NS_LANG_NL] = TRUE;
+$wgNamespacesToBeSearchedDefault[NS_LANG_RU] = TRUE;
+$wgNamespacesToBeSearchedDefault[NS_LANG_JA] = TRUE;
+
+<% if @mediawiki[:site_readonly] -%>
+$wgReadOnly = "<%= @mediawiki[:site_readonly] %>";
+<% end -%>
+
+<% Dir.glob("#{@mediawiki[:directory]}/LocalSettings.d/*.php") do |file| -%>
+<%= "require_once('#{file}');" %>
+<% end -%>
+
--- /dev/null
+# DO NOT EDIT - This file is being maintained by Chef
+
+<VirtualHost *:80>
+ ServerName <%= @name %>
+<% @aliases.each do |alias_name| -%>
+ ServerAlias <%= alias_name %>
+<% end -%>
+
+ ServerAdmin webmaster@openstreetmap.org
+
+ CustomLog /var/log/apache2/<%= @name %>-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-error.log
+
+ DocumentRoot <%= @directory %>
+
+ php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
+ #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
+ php_value memory_limit 128M
+ php_value max_execution_time 240
+ php_value upload_max_filesize 70M
+ php_value post_max_size 100M
+
+ RedirectMatch 301 ^/$ /wiki/Main_Page
+
+ #Historical Compatibility Links
+ RedirectMatch 301 ^/index\.php$ /w/index.php
+ RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
+ RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
+ RedirectMatch 301 ^/images/(.*)$ /w/images/$1
+ RedirectMatch 301 ^/api\.php$ /w/api.php
+ RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
+
+ Alias /wiki <%= @mediawiki[:directory] %>/index.php
+
+ #Support /pagename -> /wiki/pagename
+ RewriteEngine on
+ RewriteCond %{REQUEST_URI} !^/w/
+ RewriteCond %{REQUEST_URI} !^/wiki/
+ RewriteCond %{REQUEST_URI} !^/index\.php
+ RewriteCond %{REQUEST_URI} !^/skins/
+ RewriteCond %{REQUEST_URI} !^/images/
+ RewriteCond %{REQUEST_URI} !^/api\.php$
+ RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
+ RewriteCond %{REQUEST_URI} !^/server-status
+ RewriteCond %{LA-U:REQUEST_FILENAME} !-f
+ RewriteCond %{LA-U:REQUEST_FILENAME} !-d
+ RewriteRule ^/(.*) /wiki/$1 [R,L]
+
+ <Directory <%= @directory %>>
+ Options -Indexes
+ </Directory>
+
+ <Directory <%= @mediawiki[:directory] %>/images/>
+ # No php execution in the upload area
+ php_admin_flag engine off
+ Options -ExecCGI -Includes -Indexes
+ AllowOverride None
+ </Directory>
+
+ <Directory <%= @mediawiki[:directory] %>/images/thumb/>
+ RewriteEngine on
+
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/page([0-9]+)-([0-9]+)px-.*$ /w/thumb.php?f=$1&page=$2&width=$3 [L,QSA,B]
+
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/page([0-9]+)-([0-9]+)px-.*$ /w/thumb.php?f=$1&page=$2&width=$3&archived=1 [L,QSA,B]
+
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
+
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ 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]
+ </Directory>
+
+ <Directory <%= @mediawiki[:directory] %>/maintenance/>
+ Order allow,deny
+ Deny from all
+ </Directory>
+
+ <Files <%= @mediawiki[:directory] %>/LocalSettings.php>
+ Order allow,deny
+ Deny from all
+ </Files>
+
+ <Directory <%= @mediawiki[:directory] %>/images/>
+ Options -ExecCGI -Includes -Indexes
+ AllowOverride None
+ AddType text/plain .html .htm .shtml
+ php_admin_flag engine off
+ </Directory>
+
+ <Directory <%= @mediawiki[:directory] %>/cache/>
+ Options -ExecCGI -Includes -Indexes
+ AllowOverride None
+ AddType text/plain .html .htm .shtml
+ php_admin_flag engine off
+ </Directory>
+
+ <Directory ~ "\.svn">
+ Order allow,deny
+ Deny from all
+ </Directory>
+
+ <Directory ~ "\.git">
+ Order allow,deny
+ Deny from all
+ </Directory>
+
+ <Files ~ "~$">
+ Order allow,deny
+ Deny from all
+ </Files>
+</VirtualHost>
+<% if @mediawiki[:enable_ssl] -%>
+<VirtualHost *:443>
+ ServerName <%= @name %>
+<% @aliases.each do |alias_name| -%>
+ ServerAlias <%= alias_name %>
+<% end -%>
+
+ ServerAdmin webmaster@openstreetmap.org
+
+ SSLEngine on
+
+ CustomLog /var/log/apache2/<%= @name %>-secure-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-secure-error.log
+
+ DocumentRoot <%= @directory %>
+
+ php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
+ #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
+ php_value memory_limit 128M
+ php_value max_execution_time 240
+ php_value upload_max_filesize 70M
+ php_value post_max_size 100M
+
+ RedirectMatch 301 ^/$ /wiki/Main_Page
+
+ #Historical Compatibility Links
+ RedirectMatch 301 ^/index\.php$ /w/index.php
+ RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
+ RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
+ RedirectMatch 301 ^/images/(.*)$ /w/images/$1
+ RedirectMatch 301 ^/api\.php$ /w/api.php
+ RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
+
+ Alias /wiki <%= @mediawiki[:directory] %>/index.php
+
+ #Support /pagename -> /wiki/pagename
+ RewriteEngine on
+ RewriteCond %{REQUEST_URI} !^/w/
+ RewriteCond %{REQUEST_URI} !^/wiki/
+ RewriteCond %{REQUEST_URI} !^/index\.php
+ RewriteCond %{REQUEST_URI} !^/skins/
+ RewriteCond %{REQUEST_URI} !^/images/
+ RewriteCond %{REQUEST_URI} !^/api\.php$
+ RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
+ RewriteCond %{REQUEST_URI} !^/server-status
+ RewriteCond %{LA-U:REQUEST_FILENAME} !-f
+ RewriteCond %{LA-U:REQUEST_FILENAME} !-d
+ RewriteRule ^/(.*) /wiki/$1 [R,L]
+
+ <Directory <%= @directory %>>
+ Options -Indexes
+ </Directory>
+
+ <Directory <%= @mediawiki[:directory] %>/images/>
+ # No php execution in the upload area
+ php_admin_flag engine off
+ Options -ExecCGI -Includes -Indexes
+ AllowOverride None
+ </Directory>
+
+ <Directory <%= @mediawiki[:directory] %>/images/thumb/>
+ RewriteEngine on
+
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
+
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ 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]
+ </Directory>
+
+ <Directory <%= @mediawiki[:directory] %>/maintenance/>
+ Order allow,deny
+ Deny from all
+ </Directory>
+
+ <Files <%= @mediawiki[:directory] %>/LocalSettings.php>
+ Order allow,deny
+ Deny from all
+ </Files>
+
+ <Directory <%= @mediawiki[:directory] %>/images/>
+ Options -ExecCGI -Includes -Indexes
+ AllowOverride None
+ AddType text/plain .html .htm .shtml
+ php_admin_flag engine off
+ </Directory>
+
+ <Directory <%= @mediawiki[:directory] %>/cache/>
+ Options -ExecCGI -Includes -Indexes
+ AllowOverride None
+ AddType text/plain .html .htm .shtml
+ php_admin_flag engine off
+ </Directory>
+
+ <Directory ~ "\.svn">
+ Order allow,deny
+ Deny from all
+ </Directory>
+
+ <Directory ~ "\.git">
+ Order allow,deny
+ Deny from all
+ </Directory>
+
+ <Files ~ "~$">
+ Order allow,deny
+ Deny from all
+ </Files>
+</VirtualHost>
+<% end -%>
--- /dev/null
+#!/bin/bash
+T=`mktemp -d -t -p /var/tmp mediawiki-<%= @name %>.XXXXXXXXXX`
+D=`date +%Y-%m-%d`
+B=wiki-<%= @name %>-$D.tar.gz
+
+mkdir $T/wiki-<%= @name %>-$D
+mysqldump --user="<%= @database_params[:username] %>" --password="<%= @database_params[:password] %>" --opt --skip-lock-tables --single-transaction "<%= @database_params[:name] %>" | xz -9c > $T/wiki-<%= @name %>-$D/wiki.sql.xz
+ln -s <%= @directory %> $T/wiki-<%= @name %>-$D/www
+#make backup rsyncable
+GZIP="--rsyncable -9"
+export GZIP
+nice tar --create --gzip --dereference --directory=$T --file=$T/$B wiki-<%= @name %>-$D
+nice rsync $T/$B backup::backup --fuzzy
+
+rm -rf $T
--- /dev/null
+10 1 * * * <%= @user %> nice php -d memory_limit=1024M -d error_reporting=22517 <%= @directory %>/w/maintenance/generateSitemap.php --server="http://<%= @name %>" --urlpath="http://<%= @name %>/" --fspath="<%= @directory %>" --quiet
+0,10,20,40 * * * * www-data nice php -d memory_limit=1024M -d error_reporting=22517 <%= @directory %>/w/maintenance/runJobs.php --server="http://<%= @name %>" --maxtime=300 --memory-limit=1024M --quiet
+35,55 * * * * www-data nice php -d memory_limit=1024M -d error_reporting=22517 <%= @directory %>/w/maintenance/runJobs.php --server="http://<%= @name %>" --maxtime=60 --type=enotifNotify --memory-limit=1024M --quiet
+10 2 * * * www-data find /tmp/ -maxdepth 1 -type f -user www-data -mmin +90 -name 'gs_*' -delete
+10 2 * * * www-data find /tmp/ -maxdepth 1 -type f -user www-data -mmin +90 -name 'magick-*' -delete
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once($IP .'/extensions/AbuseFilter/AbuseFilter.php');
+$wgGroupPermissions['sysop']['abusefilter-modify'] = true;
+$wgGroupPermissions['*']['abusefilter-log-detail'] = true;
+$wgGroupPermissions['*']['abusefilter-view'] = true;
+$wgGroupPermissions['*']['abusefilter-log'] = true;
+$wgGroupPermissions['sysop']['abusefilter-private'] = true;
+$wgGroupPermissions['sysop']['abusefilter-modify-restricted'] = true;
+$wgGroupPermissions['sysop']['abusefilter-revert'] = true;
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once( $IP.'/extensions/Babel/Babel.php' );
+$wgBabelMainCategory = 'User %code%';
+$wgBabelCategoryNames = array(
+ '0' => false,
+ '1' => 'User %code%-1',
+ '2' => 'User %code%-2',
+ '3' => 'User %code%-3',
+ '4' => 'User %code%-4',
+ '5' => 'User %code%-5',
+ 'N' => 'User %code%-N',
+);
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once($IP .'/extensions/CheckUser/CheckUser.php');
+
+#Only allow bureaucrat group to checkuser
+$wgGroupPermissions['bureaucrat']['checkuser'] = true;
+$wgGroupPermissions['bureaucrat']['checkuser-log'] = true;
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once( $IP.'/extensions/CirrusSearch/CirrusSearch.php' );
+$wgDisableSearchUpdate = false;
+$wgSearchType = 'CirrusSearch';
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once( $IP.'/extensions/Cite/Cite.php' );
+require_once( $IP.'/extensions/Cite/SpecialCite.php' );
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+$wgDefaultUserOptions['usenewrc'] = 1;
+require_once( $IP.'/extensions/CleanChanges/CleanChanges.php' );
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once( $IP.'/extensions/ConfirmEdit/ReCaptcha.php' );
+$wgCaptchaClass = 'ReCaptcha';
+$recaptcha_public_key = '6Lc9OLsSAAAAAKazGuA9zItboXIHb6ObYOdiVm6o';
+$recaptcha_private_key = '6Lc9OLsSAAAAAKVZr9jFBc0GL-9Fm2H-paqu-4TB';
+$wgCaptchaTriggers['addurl'] = true;
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once( $IP.'/extensions/LocalisationUpdate/LocalisationUpdate.php' );
+$wgLocalisationUpdateDirectory = $IP.'/cache';
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once( $IP.'/extensions/ParserFunctions/ParserFunctions.php' );
+$wgPFEnableStringFunctions = true;
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once($IP .'/extensions/PdfHandler/PdfHandler.php');
+#Disable due to MW Exception
+#$wgPdfCreateThumbnailsInJobQueue = true;
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+ini_set( 'pcre.backtrack_limit', '16M' );
+require_once( $IP.'/extensions/SpamBlacklist/SpamBlacklist.php' );
+$wgSpamBlacklistFiles = array(
+ 'http://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1'
+);
--- /dev/null
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+require_once( $IP.'/extensions/TitleBlacklist/TitleBlacklist.php' );
+$wgTitleBlacklistSources = array(
+ array(
+ 'type' => TBLSRC_LOCALPAGE,
+ 'src' => 'MediaWiki:Titleblacklist',
+ ),
+ array(
+ 'type' => TBLSRC_URL,
+ 'src' => 'http://meta.wikimedia.org/w/index.php?title=Title_blacklist&action=raw',
+ ),
+);
--- /dev/null
+= DESCRIPTION:
+
+= REQUIREMENTS:
+
+= ATTRIBUTES:
+
+= USAGE:
+
--- /dev/null
+
+#Force apache to listen only on localhost
+#default[:apache][:listen_address] = "127.0.0.1"
--- /dev/null
+maintainer "OpenStreetMap Administrators"
+maintainer_email "admins@openstreetmap.org"
+license "Apache 2.0"
+description "Installs and configures servers for wiki.openstreetmap.org"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+version "1.0.0"
+depends "mediawiki"
+depends "squid"
--- /dev/null
+#
+# Cookbook Name:: wiki.openstreetmap.org
+# Recipe:: default
+#
+# Copyright 2013, 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.
+#
+
+#include_recipe "squid"
+
+include_recipe "mediawiki"
+
+passwords = data_bag_item("wiki", "passwords")
+
+apache_site "default" do
+ action [ :disable ]
+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"
+ directory "/srv/wiki.openstreetmap.org"
+
+ enable_ssl TRUE
+
+ database_name "wiki"
+ database_username "wiki-user"
+ database_password passwords["wiki-user"]
+
+ logo "/osm_logo_wiki.png"
+
+ email_contact "webmaster@openstreetmap.org"
+ email_sender "wiki@openstreetmap.org"
+ email_sender_name "OpenStreetMap Wiki"
+
+ metanamespace "OpenStreetMap"
+
+ #site_readonly "MAINTENANCE UPDATE: WIKI READ-ONLY. ETA: Tuesday 8:00am UTC/GMT."
+
+end
+
+cookbook_file "/srv/wiki.openstreetmap.org/osm_logo_wiki.png" do
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0644
+end
+
+template "/srv/wiki.openstreetmap.org/robots.txt" do
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0644
+ source "robots.txt.erb"
+end
+
+cookbook_file "/srv/wiki.openstreetmap.org/favicon.ico" do
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0644
+end
+
+directory "/srv/dump.wiki.openstreetmap.org" do
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode "0775"
+end
+
+apache_site "dump.wiki.openstreetmap.org" do
+ template "apache_wiki_dump.erb"
+ directory "/srv/dump.wiki.openstreetmap.org"
+ variables({
+ :aliases => "dump.wiki.osm.org"
+ })
+end
+
+template "/etc/cron.d/wiki-osm-org-dump" do
+ owner "root"
+ group "root"
+ mode 0644
+ source "cron_wiki_dump.erb"
+end
+
--- /dev/null
+# DO NOT EDIT - This file is being maintained by Chef
+
+<VirtualHost *:80>
+ ServerName <%= @name %>
+ ServerAlias <%= @aliases %>
+ ServerAdmin webmaster@openstreetmap.org
+
+ CustomLog /var/log/apache2/<%= @name %>-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-error.log
+
+ DocumentRoot <%= @directory %>
+
+ <Directory <%= @directory %>>
+ Options Indexes FollowSymLinks MultiViews
+ AllowOverride All
+ IndexIgnore .ht* . robots.txt HEADER.html HEADER.cgi logo.png style.css
+ IndexOptions FancyIndexing FoldersFirst NameWidth=* TrackModified
+ IndexOrderDefault Descending Date
+ </Directory>
+</VirtualHost>
--- /dev/null
+#!/bin/bash
+# DO NOT EDIT - This file is being maintained by Chef
+
--- /dev/null
+User-agent: ia_archiver
+Allow: /
+
+User-agent: 008
+Disallow: /
+
+User-agent: *
+Disallow: /index.php/
+Disallow: /wiki/Lacking_proper_attribution
+Disallow: /wiki/Spam
+Allow: /w/load.php
+Allow: /w/images/
+Allow: /w/skins/
+Disallow: /w/
+Disallow: /wiki/Special:Collection
+Disallow: /wiki/Special:Random
+Disallow: /wiki/Special%3ARandom
+Disallow: /wiki/Special:Search
+
+User-agent: Exabot
+Crawl-delay: 60
+
+Sitemap: http://wiki.openstreetmap.org/sitemap-index-wiki.xml
+
+Host: wiki.openstreetmap.org
--- /dev/null
+acl osmwiki_sites dstdomain wiki.openstreetmap.org wiki.osm.org
+
+http_access allow osmwiki_sites
+
+cache_peer localhost parent 80 0 no-query originserver name=osmwikiAccel login=PASS connect-timeout=60 no-digest weight=1000
+
+cache_peer_access osmwikiAccel allow osmtile_sites
+cache_peer_access osmwikiAccel deny all
+
+#----------------------------------
+