Add forum configuration file
authorTom Hughes <tom@compton.nu>
Mon, 5 Sep 2016 19:30:30 +0000 (20:30 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 5 Sep 2016 19:33:44 +0000 (20:33 +0100)
cookbooks/forum/recipes/default.rb
cookbooks/forum/templates/default/config.php.erb [new file with mode: 0644]

index 880598f..4bf5765 100644 (file)
@@ -64,6 +64,14 @@ directory "/srv/forum.openstreetmap.org/html/img/avatars/" do
   mode 0o755
 end
 
+template "/srv/forum.openstreetmap.org/html/config.php" do
+  source "config.php.erb"
+  owner "forum"
+  group "forum"
+  mode 0o440
+  variables :passwords => passwords
+end
+
 mysql_user "forum@localhost" do
   password passwords["database"]
 end
diff --git a/cookbooks/forum/templates/default/config.php.erb b/cookbooks/forum/templates/default/config.php.erb
new file mode 100644 (file)
index 0000000..91ca738
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+$db_type = 'mysqli';
+$db_host = 'localhost';
+$db_name = 'forum';
+$db_username = 'forum';
+$db_password = '<%= @passwords["database"] %>';
+$db_prefix = 'osm_';
+$p_connect = false;
+
+$cookie_name = 'forum_cookie';
+$cookie_domain = '';
+$cookie_path = '/';
+$cookie_secure = 1;
+$cookie_seed = '<%= @passwords["cookie_seed"] %>';
+
+define('PUN', 1);