From: Grant Slater Date: Thu, 22 Sep 2016 00:07:58 +0000 (+0100) Subject: donate: add db inc X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/da9a7a4c59377d9c45e028d0fecf6296889011e6 donate: add db inc --- diff --git a/cookbooks/donate/recipes/default.rb b/cookbooks/donate/recipes/default.rb index e1f64904b..bf1d46419 100644 --- a/cookbooks/donate/recipes/default.rb +++ b/cookbooks/donate/recipes/default.rb @@ -26,6 +26,7 @@ include_recipe "git" if node[:lsb][:release].to_f >= 16.04 package "php" package "php-cli" + package "php-curl" package "php-mysql" package "php-gd" @@ -33,6 +34,7 @@ if node[:lsb][:release].to_f >= 16.04 else package "php5" package "php5-cli" + package "php5-curl" package "php5-mysql" package "php5-gd" @@ -72,6 +74,13 @@ directory "/srv/donate.openstreetmap.org/data" do mode 0o755 end +template "/srv/donate.openstreetmap.org/scripts/db-connect.inc.php" do + source "db-connect.inc.php.erb" + owner "root" + group "donate" + mode 0o640 +end + apache_site "donate.openstreetmap.org" do template "apache.erb" end @@ -81,7 +90,7 @@ template "/etc/cron.d/osmf-donate" do owner "root" group "root" mode 0o600 - variables :passwords => passwords + variables :database_password => database_password end template "/etc/cron.daily/osmf-donate-backup" do @@ -89,5 +98,5 @@ template "/etc/cron.daily/osmf-donate-backup" do owner "root" group "root" mode 0o750 - variables :passwords => passwords + variables :database_password => database_password end diff --git a/cookbooks/donate/templates/default/db-connect.inc.php.erb b/cookbooks/donate/templates/default/db-connect.inc.php.erb new file mode 100644 index 000000000..b2d2a6f5e --- /dev/null +++ b/cookbooks/donate/templates/default/db-connect.inc.php.erb @@ -0,0 +1,4 @@ +'); +mysql_select_db('donate', $_DB_H); +mysql_query('SET NAMES \'utf8\'', $_DB_H);