]> git.openstreetmap.org Git - chef.git/blob - cookbooks/stateofthemap/recipes/wordpress.rb
nominatim: install secondary importance file
[chef.git] / cookbooks / stateofthemap / recipes / wordpress.rb
1 #
2 # Cookbook:: stateofthemap
3 # Recipe:: wordpress
4 #
5 # Copyright:: 2022, OpenStreetMap Foundation
6 #
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
10 #
11 #     https://www.apache.org/licenses/LICENSE-2.0
12 #
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.
18 #
19
20 include_recipe "stateofthemap"
21 include_recipe "wordpress"
22
23 passwords = data_bag_item("stateofthemap", "passwords")
24 wp2fa_encrypt_keys = data_bag_item("stateofthemap", "wp2fa_encrypt_keys")
25
26 directory "/srv/2007.stateofthemap.org" do
27   owner "wordpress"
28   group "wordpress"
29   mode "755"
30 end
31
32 wordpress_site "2007.stateofthemap.org" do
33   aliases ["2007.stateofthemap.com", "2007.sotm.org"]
34   directory "/srv/2007.stateofthemap.org/wp"
35   database_name "sotm2007"
36   database_user "sotm2007"
37   database_password passwords["sotm2007"]
38   database_prefix "wp_sotm_"
39   wp2fa_encrypt_key wp2fa_encrypt_keys["sotm2007"]
40   fpm_prometheus_port 12007
41 end
42
43 wordpress_theme "2007.stateofthemap.org-refreshwp-11" do
44   theme "refreshwp-11"
45   site "2007.stateofthemap.org"
46   repository "https://git.openstreetmap.org/public/stateofthemap.git"
47   revision "theme-2007"
48 end
49
50 # Remove broken geopress plugin
51 wordpress_plugin "2007.stateofthemap.org-geopress" do
52   action :delete
53   plugin "geopress"
54   site "2007.stateofthemap.org"
55 end
56
57 directory "/srv/2008.stateofthemap.org" do
58   owner "wordpress"
59   group "wordpress"
60   mode "755"
61 end
62
63 wordpress_site "2008.stateofthemap.org" do
64   aliases ["2008.stateofthemap.com", "2008.sotm.org"]
65   directory "/srv/2008.stateofthemap.org/wp"
66   database_name "sotm2008"
67   database_user "sotm2008"
68   database_password passwords["sotm2008"]
69   database_prefix "wp_sotm08_"
70   wp2fa_encrypt_key wp2fa_encrypt_keys["sotm2008"]
71   fpm_prometheus_port 12008
72 end
73
74 wordpress_theme "2008.stateofthemap.org-refreshwp-11" do
75   theme "refreshwp-11"
76   site "2008.stateofthemap.org"
77   repository "https://git.openstreetmap.org/public/stateofthemap.git"
78   revision "theme-2008"
79 end
80
81 # Remove broken geopress plugin
82 wordpress_plugin "2008.stateofthemap.org-geopress" do
83   action :delete
84   plugin "geopress"
85   site "2008.stateofthemap.org"
86 end
87
88 directory "/srv/2009.stateofthemap.org" do
89   owner "wordpress"
90   group "wordpress"
91   mode "755"
92 end
93
94 git "/srv/2009.stateofthemap.org" do
95   action :sync
96   repository "https://git.openstreetmap.org/public/stateofthemap.git"
97   revision "resources-2009"
98   depth 1
99   user "wordpress"
100   group "wordpress"
101 end
102
103 wordpress_site "2009.stateofthemap.org" do
104   aliases ["2009.stateofthemap.com", "2009.sotm.org"]
105   directory "/srv/2009.stateofthemap.org/wp"
106   database_name "sotm2009"
107   database_user "sotm2009"
108   database_password passwords["sotm2009"]
109   wp2fa_encrypt_key wp2fa_encrypt_keys["sotm2009"]
110   urls "/register" => "/srv/2009.stateofthemap.org/register",
111        "/register-pro-user" => "/srv/2009.stateofthemap.org/register-pro-user",
112        "/podcasts" => "/srv/2009.stateofthemap.org/podcasts"
113   fpm_prometheus_port 12009
114 end
115
116 wordpress_theme "2009.stateofthemap.org-aerodrome" do
117   theme "aerodrome"
118   site "2009.stateofthemap.org"
119   repository "https://git.openstreetmap.org/public/stateofthemap.git"
120   revision "theme-2009"
121 end
122
123 # wordpress_plugin "2009.stateofthemap.org-wp-sticky" do
124 #   plugin "wp-sticky"
125 #   site "2009.stateofthemap.org"
126 # end
127
128 directory "/srv/2010.stateofthemap.org" do
129   owner "wordpress"
130   group "wordpress"
131   mode "755"
132 end
133
134 git "/srv/2010.stateofthemap.org" do
135   action :sync
136   repository "https://git.openstreetmap.org/public/stateofthemap.git"
137   revision "resources-2010"
138   depth 1
139   user "wordpress"
140   group "wordpress"
141 end
142
143 wordpress_site "2010.stateofthemap.org" do
144   aliases ["2010.stateofthemap.com", "2010.sotm.org"]
145   directory "/srv/2010.stateofthemap.org/wp"
146   database_name "sotm2010"
147   database_user "sotm2010"
148   database_password passwords["sotm2010"]
149   wp2fa_encrypt_key wp2fa_encrypt_keys["sotm2010"]
150   urls "/register" => "/srv/2010.stateofthemap.org/register"
151   fpm_prometheus_port 12010
152 end
153
154 wordpress_theme "2010.stateofthemap.org-aerodrome" do
155   theme "aerodrome"
156   site "2010.stateofthemap.org"
157   repository "https://git.openstreetmap.org/public/stateofthemap.git"
158   revision "theme-2010"
159 end
160
161 wordpress_plugin "2010.stateofthemap.org-sitepress-multilingual-cms" do
162   plugin "sitepress-multilingual-cms"
163   site "2010.stateofthemap.org"
164   repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
165   revision "master"
166   not_if { kitchen? }
167 end
168
169 # wordpress_plugin "2010.stateofthemap.org-wp-sticky" do
170 #   plugin "wp-sticky"
171 #   site "2010.stateofthemap.org"
172 # end
173
174 directory "/srv/2011.stateofthemap.org" do
175   owner "wordpress"
176   group "wordpress"
177   mode "755"
178 end
179
180 git "/srv/2011.stateofthemap.org" do
181   action :sync
182   repository "https://git.openstreetmap.org/public/stateofthemap.git"
183   revision "resources-2011"
184   depth 1
185   user "wordpress"
186   group "wordpress"
187 end
188
189 wordpress_site "2011.stateofthemap.org" do
190   aliases ["2011.stateofthemap.com", "2011.sotm.org"]
191   directory "/srv/2011.stateofthemap.org/wp"
192   database_name "sotm2011"
193   database_user "sotm2011"
194   database_password passwords["sotm2011"]
195   wp2fa_encrypt_key wp2fa_encrypt_keys["sotm2011"]
196   urls "/register" => "/srv/2011.stateofthemap.org/register"
197   fpm_prometheus_port 12011
198 end
199
200 wordpress_theme "2011.stateofthemap.org-aerodrome" do
201   theme "aerodrome"
202   site "2011.stateofthemap.org"
203   repository "https://git.openstreetmap.org/public/stateofthemap.git"
204   revision "theme-2011"
205 end
206
207 wordpress_plugin "2011.stateofthemap.org-sitepress-multilingual-cms" do
208   plugin "sitepress-multilingual-cms"
209   site "2011.stateofthemap.org"
210   repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
211   revision "master"
212   not_if { kitchen? }
213 end
214
215 # wordpress_plugin "2011.stateofthemap.org-wp-sticky" do
216 #   plugin "wp-sticky"
217 #   site "2011.stateofthemap.org"
218 # end
219
220 directory "/srv/2012.stateofthemap.org" do
221   owner "wordpress"
222   group "wordpress"
223   mode "755"
224 end
225
226 git "/srv/2012.stateofthemap.org" do
227   action :sync
228   repository "https://git.openstreetmap.org/public/stateofthemap.git"
229   revision "resources-2012"
230   depth 1
231   user "wordpress"
232   group "wordpress"
233 end
234
235 wordpress_site "2012.stateofthemap.org" do
236   aliases ["2012.stateofthemap.com", "2012.sotm.org"]
237   directory "/srv/2012.stateofthemap.org/wp"
238   database_name "sotm2012"
239   database_user "sotm2012"
240   database_password passwords["sotm2012"]
241   wp2fa_encrypt_key wp2fa_encrypt_keys["sotm2012"]
242   urls "/register" => "/srv/2012.stateofthemap.org/register"
243   fpm_prometheus_port 12012
244 end
245
246 wordpress_theme "2012.stateofthemap.org-aerodrome" do
247   theme "aerodrome"
248   site "2012.stateofthemap.org"
249   repository "https://git.openstreetmap.org/public/stateofthemap.git"
250   revision "theme-2012"
251 end
252
253 wordpress_plugin "2012.stateofthemap.org-leaflet-maps-marker" do
254   plugin "leaflet-maps-marker"
255   site "2012.stateofthemap.org"
256 end
257
258 wordpress_plugin "2012.stateofthemap.org-sitepress-multilingual-cms" do
259   plugin "sitepress-multilingual-cms"
260   site "2012.stateofthemap.org"
261   repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
262   revision "master"
263   not_if { kitchen? }
264 end
265
266 # wordpress_plugin "2012.stateofthemap.org-wp-sticky" do
267 #   plugin "wp-sticky"
268 #   site "2012.stateofthemap.org"
269 # end
270
271 template "/etc/cron.daily/sotm-backup" do
272   source "backup.cron.erb"
273   owner "root"
274   group "root"
275   mode "750"
276   variables :passwords => passwords
277 end