From 6a4d93a5eaddb8eb766185621de1265af44f2559 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Thu, 22 Sep 2016 01:29:12 +0100 Subject: [PATCH] donate: fix db secret handling --- cookbooks/donate/recipes/default.rb | 4 ++-- cookbooks/donate/templates/default/db-connect.inc.php.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbooks/donate/recipes/default.rb b/cookbooks/donate/recipes/default.rb index bf1d46419..3fbeb19d5 100644 --- a/cookbooks/donate/recipes/default.rb +++ b/cookbooks/donate/recipes/default.rb @@ -90,7 +90,7 @@ template "/etc/cron.d/osmf-donate" do owner "root" group "root" mode 0o600 - variables :database_password => database_password + variables :passwords => passwords end template "/etc/cron.daily/osmf-donate-backup" do @@ -98,5 +98,5 @@ template "/etc/cron.daily/osmf-donate-backup" do owner "root" group "root" mode 0o750 - variables :database_password => database_password + variables :passwords => passwords end diff --git a/cookbooks/donate/templates/default/db-connect.inc.php.erb b/cookbooks/donate/templates/default/db-connect.inc.php.erb index b2d2a6f5e..ce05bc99f 100644 --- a/cookbooks/donate/templates/default/db-connect.inc.php.erb +++ b/cookbooks/donate/templates/default/db-connect.inc.php.erb @@ -1,4 +1,4 @@ '); +$_DB_H = mysql_connect('localhost','donate','<%= @passwords['database'] %>'); mysql_select_db('donate', $_DB_H); mysql_query('SET NAMES \'utf8\'', $_DB_H); -- 2.39.5