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 #     http://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::ssl"
 
  21 include_recipe "mysql"
 
  23 passwords = data_bag_item("forum", "passwords")
 
  30 apache_module "php7.0"
 
  32 apache_site "default" do
 
  36 apache_site "forum.openstreetmap.org" do
 
  40 directory "/srv/forum.openstreetmap.org" do
 
  46 git "/srv/forum.openstreetmap.org/html/" do
 
  48   repository "http://github.com/fluxbb/fluxbb.git"
 
  49   revision "refs/tags/fluxbb-1.5.6"
 
  55 directory "/srv/forum.openstreetmap.org/html/cache/" do
 
  61 directory "/srv/forum.openstreetmap.org/html/img/avatars/" do
 
  67 mysql_user "forum@localhost" do
 
  68   password passwords["database"]
 
  71 mysql_database "forum" do
 
  72   permissions "forum@localhost" => :all
 
  75 template "/etc/cron.daily/forum-backup" do
 
  76   source "backup.cron.erb"
 
  80   variables :passwords => passwords