2 # Cookbook:: wiki.openstreetmap.org
5 # Copyright:: 2013, OpenStreetMap Foundation
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # https://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
20 include_recipe "mediawiki"
22 passwords = data_bag_item("wiki", "passwords")
24 package "lua5.1" # newer versions do not work with Scribuntu!
26 apache_site "default" do
30 mediawiki_site "wiki.openstreetmap.org" do
31 aliases ["wiki.osm.org", "wiki.openstreetmap.com", "wiki.openstreetmap.net",
32 "wiki.openstreetmap.ca", "wiki.openstreetmap.eu",
33 "wiki.openstreetmap.pro", "wiki.openstreetmaps.org"]
34 directory "/srv/wiki.openstreetmap.org"
38 fpm_min_spare_servers 10
39 fpm_max_spare_servers 20
40 fpm_prometheus_port 9253
43 database_user "wiki-user"
44 database_password passwords["database"]
46 admin_password passwords["admin"]
48 logo "/osm_logo_wiki.png"
50 email_contact "webmaster@openstreetmap.org"
51 email_sender "wiki@noreply.openstreetmap.org"
52 email_sender_name "OpenStreetMap Wiki"
56 hcaptcha_public_key "b67a410b-955e-4049-b432-f9c00e0202c0"
57 hcaptcha_private_key passwords["hcaptcha"]
59 # site_notice "MAINTENANCE: WIKI READ-ONLY UNTIL Monday 16 May 2016 - 11:00am UTC/GMT."
60 # site_readonly "MAINTENANCE: WIKI READ-ONLY UNTIL Monday 16 May 2016 - 11:00am UTC/GMT."
63 mediawiki_extension "CodeEditor" do
64 site "wiki.openstreetmap.org"
67 mediawiki_extension "CodeMirror" do
68 site "wiki.openstreetmap.org"
71 mediawiki_extension "Scribunto" do
72 site "wiki.openstreetmap.org"
73 template "mw-ext-Scribunto.inc.php.erb"
74 template_cookbook "wiki"
77 mediawiki_extension "Wikibase" do
78 site "wiki.openstreetmap.org"
79 template "mw-ext-Wikibase.inc.php.erb"
80 template_cookbook "wiki"
83 mediawiki_extension "OsmWikibase" do
84 site "wiki.openstreetmap.org"
85 repository "https://github.com/nyurik/OsmWikibase.git"
89 mediawiki_extension "Echo" do
90 site "wiki.openstreetmap.org"
91 template "mw-ext-Echo.inc.php.erb"
92 template_cookbook "wiki"
95 mediawiki_extension "Thanks" do
96 site "wiki.openstreetmap.org"
97 template "mw-ext-Thanks.inc.php.erb"
98 template_cookbook "wiki"
101 mediawiki_extension "TimedMediaHandler" do
102 site "wiki.openstreetmap.org"
105 mediawiki_extension "MultiMaps" do
106 site "wiki.openstreetmap.org"
107 template "mw-ext-MultiMaps.inc.php.erb"
108 template_cookbook "wiki"
109 variables :thunderforest_key => passwords["thunderforest"]
112 cookbook_file "/srv/wiki.openstreetmap.org/osm_logo_wiki.png" do
113 owner node[:mediawiki][:user]
114 group node[:mediawiki][:group]
118 template "/srv/wiki.openstreetmap.org/robots.txt" do
119 owner node[:mediawiki][:user]
120 group node[:mediawiki][:group]
122 source "robots.txt.erb"
125 cookbook_file "/srv/wiki.openstreetmap.org/favicon.ico" do
126 owner node[:mediawiki][:user]
127 group node[:mediawiki][:group]
131 directory "/srv/wiki.openstreetmap.org/dump" do
132 owner node[:mediawiki][:user]
133 group node[:mediawiki][:group]
137 cron_d "wiki-dump" do
141 command "cd /srv/wiki.openstreetmap.org && php w/maintenance/dumpBackup.php --full --quiet --output=gzip:dump/dump.xml.gz"