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 "osm.wiki", "www.osm.wiki", "wiki.osm.wiki"]
35 directory "/srv/wiki.openstreetmap.org"
39 fpm_min_spare_servers 10
40 fpm_max_spare_servers 20
41 fpm_prometheus_port 9253
44 database_user "wiki-user"
45 database_password passwords["database"]
47 admin_password passwords["admin"]
49 logo "/osm_logo_wiki.png"
51 email_contact "webmaster@openstreetmap.org"
52 email_sender "wiki@noreply.openstreetmap.org"
53 email_sender_name "OpenStreetMap Wiki"
57 hcaptcha_public_key "b67a410b-955e-4049-b432-f9c00e0202c0"
58 hcaptcha_private_key passwords["hcaptcha"]
60 # site_notice "MAINTENANCE: WIKI READ-ONLY UNTIL Monday 16 May 2016 - 11:00am UTC/GMT."
61 # site_readonly "MAINTENANCE: WIKI READ-ONLY UNTIL Monday 16 May 2016 - 11:00am UTC/GMT."
64 mediawiki_extension "CodeEditor" do
65 site "wiki.openstreetmap.org"
68 mediawiki_extension "CodeMirror" do
69 site "wiki.openstreetmap.org"
72 mediawiki_extension "Scribunto" do
73 site "wiki.openstreetmap.org"
74 template "mw-ext-Scribunto.inc.php.erb"
75 template_cookbook "wiki"
78 mediawiki_extension "Wikibase" do
79 site "wiki.openstreetmap.org"
80 template "mw-ext-Wikibase.inc.php.erb"
81 template_cookbook "wiki"
84 mediawiki_extension "OsmWikibase" do
85 site "wiki.openstreetmap.org"
86 repository "https://github.com/nyurik/OsmWikibase.git"
90 mediawiki_extension "Echo" do
91 site "wiki.openstreetmap.org"
92 template "mw-ext-Echo.inc.php.erb"
93 template_cookbook "wiki"
96 mediawiki_extension "Thanks" do
97 site "wiki.openstreetmap.org"
98 template "mw-ext-Thanks.inc.php.erb"
99 template_cookbook "wiki"
102 mediawiki_extension "TimedMediaHandler" do
103 site "wiki.openstreetmap.org"
106 mediawiki_extension "MultiMaps" do
107 site "wiki.openstreetmap.org"
108 template "mw-ext-MultiMaps.inc.php.erb"
109 template_cookbook "wiki"
110 variables :thunderforest_key => passwords["thunderforest"]
114 mediawiki_extension "JsonConfig" do
115 site "wiki.openstreetmap.org"
116 template "mw-ext-JsonConfig.inc.php.erb"
117 template_cookbook "wiki"
120 mediawiki_extension "Kartographer" do
121 site "wiki.openstreetmap.org"
122 template "mw-ext-Kartographer.inc.php.erb"
123 template_cookbook "wiki"
126 cookbook_file "/srv/wiki.openstreetmap.org/osm_logo_wiki.png" do
127 owner node[:mediawiki][:user]
128 group node[:mediawiki][:group]
132 template "/srv/wiki.openstreetmap.org/robots.txt" do
133 owner node[:mediawiki][:user]
134 group node[:mediawiki][:group]
136 source "robots.txt.erb"
139 cookbook_file "/srv/wiki.openstreetmap.org/favicon.ico" do
140 owner node[:mediawiki][:user]
141 group node[:mediawiki][:group]
145 directory "/srv/wiki.openstreetmap.org/dump" do
146 owner node[:mediawiki][:user]
147 group node[:mediawiki][:group]
151 systemd_service "wiki-dump" do
152 description "Wiki dump"
154 exec_start "/usr/bin/php w/maintenance/dumpBackup.php --full --quiet --output=gzip:dump/dump.xml.gz"
155 working_directory "/srv/wiki.openstreetmap.org"
157 sandbox :enable_network => true
158 memory_deny_write_execute false
159 restrict_address_families "AF_UNIX"
160 read_write_paths "/srv/wiki.openstreetmap.org/dump"
163 systemd_timer "wiki-dump" do
164 description "Wiki dump"
168 service "wiki-dump.timer" do
169 action [:enable, :start]
172 systemd_service "wiki-rdf-dump" do
173 description "Wiki RDF dump"
176 "/usr/bin/php w/extensions/Wikibase/repo/maintenance/dumpRdf.php --wiki wiki --format ttl --flavor full-dump --entity-type item --entity-type property --no-cache --output /tmp/wikibase-rdf.ttl",
177 "/bin/gzip -9 /tmp/wikibase-rdf.ttl",
178 "/bin/mv /tmp/wikibase-rdf.ttl.gz /srv/wiki.openstreetmap.org/dump/wikibase-rdf.ttl.gz"
180 working_directory "/srv/wiki.openstreetmap.org"
182 sandbox :enable_network => true
183 memory_deny_write_execute false
184 restrict_address_families "AF_UNIX"
185 read_write_paths "/srv/wiki.openstreetmap.org/dump"
188 systemd_timer "wiki-rdf-dump" do
189 description "Wiki RDF dump"
193 service "wiki-rdf-dump.timer" do
194 action [:enable, :start]