5 # Copyright:: 2014, 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.
19 include_recipe "apache"
21 include_recipe "mysql"
23 passwords = data_bag_item("forum", "passwords")
34 apache_module "php7.2"
35 apache_module "rewrite"
37 ssl_certificate "forum.openstreetmap.org" do
38 domains ["forum.openstreetmap.org", "forum.osm.org"]
39 notifies :reload, "service[apache2]"
42 apache_site "forum.openstreetmap.org" do
46 directory "/srv/forum.openstreetmap.org" do
52 git "/srv/forum.openstreetmap.org/html/" do
54 repository "http://github.com/openstreetmap/openstreetmap-forum.git"
55 revision "openstreetmap-1.5.10"
59 notifies :reload, "service[apache2]"
62 remote_file "/var/cache/chef/air3_v0.8.zip" do
63 action :create_if_missing
64 source "https://fluxbb.org/resources/styles/air3/releases/0.8/air3_v0.8.zip"
71 execute "/var/cache/chef/air3_v0.8.zip" do
73 command "unzip -o -qq /var/cache/chef/air3_v0.8.zip Air3.css Air3/*"
74 cwd "/srv/forum.openstreetmap.org/html/style"
77 subscribes :run, "remote_file[/var/cache/chef/air3_v0.8.zip]", :immediately
80 directory "/srv/forum.openstreetmap.org/html/cache/" do
86 directory "/srv/forum.openstreetmap.org/html/img/avatars/" do
92 template "/srv/forum.openstreetmap.org/html/config.php" do
93 source "config.php.erb"
97 variables :passwords => passwords
100 mysql_user "forum@localhost" do
101 password passwords["database"]
104 mysql_database "forum" do
105 permissions "forum@localhost" => :all
108 template "/etc/cron.daily/forum-backup" do
109 source "backup.cron.erb"
113 variables :passwords => passwords