From 6f2eca1744b4ca74f456f77a1aa6e5b4ce937793 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Tue, 28 Mar 2017 17:38:16 +0200 Subject: [PATCH] wordpress: replace the dbPassword option with dbPasswordFile (#24146) We shouldn't force users to store passwords in the world-readable Nix store. --- .../web-servers/apache-httpd/wordpress.nix | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix index b94ec14308b..c6f4bcd0f66 100644 --- a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix +++ b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix @@ -9,7 +9,7 @@ let + ''; + }; tablePrefix = mkOption { default = "wp_"; description = '' @@ -251,7 +276,7 @@ in sleep 1 done ${pkgs.mysql}/bin/mysql -e 'CREATE DATABASE ${config.dbName};' - ${pkgs.mysql}/bin/mysql -e 'GRANT ALL ON ${config.dbName}.* TO ${config.dbUser}@localhost IDENTIFIED BY "${config.dbPassword}";' + ${pkgs.mysql}/bin/mysql -e "GRANT ALL ON ${config.dbName}.* TO ${config.dbUser}@localhost IDENTIFIED BY \"$(cat ${config.dbPasswordFile})\";" else echo "Good, no need to do anything database related." fi