summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2017-03-14 16:11:51 +0100
committerJoachim Schiele <js@lastlog.de>2017-03-14 16:11:51 +0100
commit308c09d41f309e5055e45c66c07454581945d458 (patch)
treefae5732f069338de5d7f4f6a3b722d05a038f478 /nixos
parente916236130c98c5de723ee742f54b1c22ad6230e (diff)
downloadnixpkgs-308c09d41f309e5055e45c66c07454581945d458.tar
nixpkgs-308c09d41f309e5055e45c66c07454581945d458.tar.gz
nixpkgs-308c09d41f309e5055e45c66c07454581945d458.tar.bz2
nixpkgs-308c09d41f309e5055e45c66c07454581945d458.tar.lz
nixpkgs-308c09d41f309e5055e45c66c07454581945d458.tar.xz
nixpkgs-308c09d41f309e5055e45c66c07454581945d458.tar.zst
nixpkgs-308c09d41f309e5055e45c66c07454581945d458.zip
wordpress: security upgrade: 4.7.2 -> 4.7.3 & other improvements (#23837)
* Moved the wordpress sources derivation to the attribute pkgs.wordpress. This
  makes it easier to override.

* Also introduce the `package` option for the wordpress virtual host config which
  defaults to pkgs.wordpress.

* Also fixed the test in nixos/tests/wordpress.nix.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/wordpress.nix20
-rw-r--r--nixos/tests/wordpress.nix12
2 files changed, 13 insertions, 19 deletions
diff --git a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix
index a5b6548d3c5..b94ec14308b 100644
--- a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix
@@ -4,11 +4,6 @@
 with lib;
 
 let
-
-  # Upgrading? We have a test! nix-build ./nixos/tests/wordpress.nix
-  version = "4.7.2";
-  fullversion = "${version}";
-
   # Our bare-bones wp-config.php file using the above settings
   wordpressConfig = pkgs.writeText "wp-config.php" ''
     <?php
@@ -71,12 +66,7 @@ let
   # The wordpress package itself
   wordpressRoot = pkgs.stdenv.mkDerivation rec {
     name = "wordpress";
-    src = pkgs.fetchFromGitHub {
-      owner = "WordPress";
-      repo = "WordPress";
-      rev = "${fullversion}";
-      sha256 = "0vph12708drf8ww0xd05hpdvbyy7n5gj9ca598lhdhy2i1j6wy32";
-    };
+    src = config.package;
     installPhase = ''
       mkdir -p $out
       # copy all the wordpress files we downloaded
@@ -122,6 +112,14 @@ in
   enablePHP = true;
 
   options = {
+    package = mkOption {
+      type = types.path;
+      default = pkgs.wordpress;
+      description = ''
+        Path to the wordpress sources.
+        Upgrading? We have a test! nix-build ./nixos/tests/wordpress.nix
+      '';
+    };
     dbHost = mkOption {
       default = "localhost";
       description = "The location of the database server.";
diff --git a/nixos/tests/wordpress.nix b/nixos/tests/wordpress.nix
index afee1f7f6dd..c51306a8c7a 100644
--- a/nixos/tests/wordpress.nix
+++ b/nixos/tests/wordpress.nix
@@ -10,14 +10,10 @@ import ./make-test.nix ({ pkgs, ... }:
     { web =
         { config, pkgs, ... }:
         {
-          services.mysql.enable = true;
-          services.mysql.package = pkgs.mysql;
-          services.mysql.initialScript = pkgs.writeText "start.sql" ''
-            CREATE DATABASE wordpress;
-	    CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress';
-            GRANT ALL on wordpress.* TO 'wordpress'@'localhost';
-          '';
-
+          services.mysql = {
+            enable = true;
+            package = pkgs.mysql;
+          };
           services.httpd = {
             enable = true;
             logPerVirtualHost = true;