# See the License for the specific language governing permissions and
# limitations under the License.
#
-include_recipe "apache"
+include_recipe "apache:ssl"
+include_recipe "git"
+include_recipe "mysql"
+
+passwords = data_bag_item("forum", "passwords")
package "php5"
package "php5-cli"
apache_module "php5"
+apache_site "default" do
+ action [ :disable ]
+end
+
+apache_site "forum.openstreetmap.org" do
+ template "apache.erb"
+end
+
+directory "/srv/forum.openstreetmap.org" do
+ owner "forum"
+ group "forum"
+ mode 0755
+end
+
+git "/srv/forum.openstreetmap.org/html/" do
+ action :sync
+ repository "http://github.com/fluxbb/fluxbb.git"
+ revision "refs/tags/fluxbb-1.5.6"
+ depth 1
+ user "forum"
+ group "forum"
+end
+
+directory "/srv/forum.openstreetmap.org/html/cache/" do
+ owner "www-data"
+ group "www-data"
+ mode 0755
+end
+
+directory "/srv/forum.openstreetmap.org/html/img/avatars/" do
+ owner "www-data"
+ group "www-data"
+ mode 0755
+end
+
+mysql_user "forum@localhost" do
+ password passwords["database"]
+end
+
+mysql_database "forum" do
+ permissions "forum@localhost" => :all
+end
+
+template "/etc/cron.daily/forum-backup" do
+ source "backup.cron.erb"
+ owner "root"
+ group "root"
+ mode 0750
+ variables :passwords => passwords
+end
--- /dev/null
+# DO NOT EDIT - This file is being maintained by Chef
+
+<VirtualHost *:80>
+ ServerName forum.openstreetmap.org
+ ServerAlias forum.osm.org
+ ServerAdmin webmaster@openstreetmap.org
+
+ CustomLog /var/log/apache2/forum.openstreetmap.org-access.log combined
+ ErrorLog /var/log/apache2/forum.openstreetmap.org-error.log
+
+ DocumentRoot /srv/forum.openstreetmap.org/html/
+</VirtualHost>
+
+<VirtualHost *:443>
+ ServerName forum.openstreetmap.org
+ ServerAdmin webmaster@openstreetmap.org
+
+ SSLEngine on
+ SSLProtocol all -SSLv2
+ SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
+ SSLCertificateFile /etc/ssl/certs/openstreetmap.pem
+ SSLCertificateKeyFile /etc/ssl/private/openstreetmap.key
+
+ CustomLog /var/log/apache2/forum.openstreetmap.org-access.log combined
+ ErrorLog /var/log/apache2/forum.openstreetmap.org-error.log
+
+ DocumentRoot /srv/forum.openstreetmap.org
+</VirtualHost>
--- /dev/null
+#!/bin/sh
+exit 0
+
+# DO NOT EDIT - This file is being maintained by Chef
+
+T=$(mktemp -d -t -p /var/tmp forum.XXXXXXXXXX)
+D=$(date +%Y-%m-%d)
+B=forum-$D.tar.gz
+
+mkdir $T/forum-$D
+mysqldump --user=forum --password=<%= @passwords["database"] %> --opt forum > $T/forum-$D/forum.sql
+ln -s /srv/forum.openstreetmap.org $T/forum-$D/www
+
+export GZIP="--rsyncable -9"
+export RSYNC_RSH="ssh -ax -c arcfour"
+
+nice tar --create --gzip --dereference --directory=$T --file=$T/$B forum-$D
+nice rsync $T/$B backup::backup
+
+rm -rf $T
default_attributes(
:accounts => {
:users => {
- :lambertus => { :status => :administrator }
+ :lambertus => {
+ :status => :administrator
+ },
+ :forum => {
+ :status => :role,
+ :members => [ :lambertus, :grant ]
+ }
}
},
:apache => {