]> git.openstreetmap.org Git - chef.git/blob - cookbooks/forum/recipes/default.rb
Drop all use of SSLCertificateChainFile in apache configs
[chef.git] / cookbooks / forum / recipes / default.rb
1 #
2 # Cookbook Name:: forum
3 # Recipe:: default
4 #
5 # Copyright 2014, 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 #     http://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 include_recipe "apache::ssl"
20 include_recipe "git"
21 include_recipe "mysql"
22
23 passwords = data_bag_item("forum", "passwords")
24
25 package "php"
26 package "php-cli"
27 package "php-mysql"
28 package "php-xml"
29 package "php-apcu"
30
31 apache_module "php7.0"
32 apache_module "rewrite"
33
34 ssl_certificate "forum.openstreetmap.org" do
35   domains ["forum.openstreetmap.org", "forum.osm.org"]
36   fallback_certificate "openstreetmap"
37   notifies :reload, "service[apache2]"
38 end
39
40 apache_site "forum.openstreetmap.org" do
41   template "apache.erb"
42 end
43
44 directory "/srv/forum.openstreetmap.org" do
45   owner "forum"
46   group "forum"
47   mode 0o755
48 end
49
50 git "/srv/forum.openstreetmap.org/html/" do
51   action :sync
52   repository "http://github.com/openstreetmap/openstreetmap-forum.git"
53   revision "openstreetmap-1.5.10"
54   depth 1
55   user "forum"
56   group "forum"
57   notifies :reload, "service[apache2]"
58 end
59
60 directory "/srv/forum.openstreetmap.org/html/cache/" do
61   owner "www-data"
62   group "www-data"
63   mode 0o755
64 end
65
66 directory "/srv/forum.openstreetmap.org/html/img/avatars/" do
67   owner "www-data"
68   group "www-data"
69   mode 0o755
70 end
71
72 template "/srv/forum.openstreetmap.org/html/config.php" do
73   source "config.php.erb"
74   owner "forum"
75   group "www-data"
76   mode 0o440
77   variables :passwords => passwords
78 end
79
80 mysql_user "forum@localhost" do
81   password passwords["database"]
82 end
83
84 mysql_database "forum" do
85   permissions "forum@localhost" => :all
86 end
87
88 template "/etc/cron.daily/forum-backup" do
89   source "backup.cron.erb"
90   owner "root"
91   group "root"
92   mode 0o750
93   variables :passwords => passwords
94 end