2 # Cookbook Name:: forum
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")
33 apache_module "php7.2"
34 apache_module "rewrite"
36 ssl_certificate "forum.openstreetmap.org" do
37 domains ["forum.openstreetmap.org", "forum.osm.org"]
38 notifies :reload, "service[apache2]"
41 apache_site "forum.openstreetmap.org" do
45 directory "/srv/forum.openstreetmap.org" do
51 git "/srv/forum.openstreetmap.org/html/" do
53 repository "http://github.com/openstreetmap/openstreetmap-forum.git"
54 revision "openstreetmap-1.5.10"
58 notifies :reload, "service[apache2]"
61 file "/srv/forum.openstreetmap.org/html/style/Midnight.css" do
65 directory "/srv/forum.openstreetmap.org/html/style/Midnight" do
70 file "/srv/forum.openstreetmap.org/html/style/Victory.css" do
74 directory "/srv/forum.openstreetmap.org/html/style/Victory" do
79 remote_file "/var/cache/chef/air3_v0.6.zip" do
80 action :create_if_missing
81 source "https://fluxbb.org/resources/styles/air3/releases/0.6/air3_v0.6.zip"
88 execute "/var/cache/chef/air3_v0.6.zip" do
90 command "unzip -qq /var/cache/chef/air3_v0.6.zip Air3.css Air3/*"
91 cwd "/srv/forum.openstreetmap.org/html/style"
94 subscribes :run, "remote_file[/var/cache/chef/air3_v0.6.zip]", :immediately
97 directory "/srv/forum.openstreetmap.org/html/cache/" do
103 directory "/srv/forum.openstreetmap.org/html/img/avatars/" do
109 template "/srv/forum.openstreetmap.org/html/config.php" do
110 source "config.php.erb"
114 variables :passwords => passwords
117 mysql_user "forum@localhost" do
118 password passwords["database"]
121 mysql_database "forum" do
122 permissions "forum@localhost" => :all
125 template "/etc/cron.daily/forum-backup" do
126 source "backup.cron.erb"
130 variables :passwords => passwords