diff --git a/inventories/default.nix b/inventories/default.nix index 8699239..0d18394 100644 --- a/inventories/default.nix +++ b/inventories/default.nix @@ -287,6 +287,16 @@ tenants = [ "poyfestival.com" ]; + phpfpmOptions = '' + upload_max_filesize=64M + post_max_size=128M + ''; + wpExtraConfig = '' + define('WP_MEMORY_LIMIT', '256M'); + define('WP_DEBUG', false); + define('WP_DEBUG_DISPLAY', false); + define('WP_DEBUG_LOG', false); + ''; }; }; }; diff --git a/modules/clan/wordpress/default.nix b/modules/clan/wordpress/default.nix index 9698e04..b63a172 100644 --- a/modules/clan/wordpress/default.nix +++ b/modules/clan/wordpress/default.nix @@ -18,6 +18,16 @@ description = "List of tenants website to host on the instance"; example = [ "example.com" ]; }; + phpfpmOptions = lib.mkOption { + type = with lib.types; lines; + default = ""; + description = "options appended to the PHP configuration file"; + }; + wpExtraConfig = lib.mkOption { + type = with lib.types; lines; + default = ""; + description = "Any additional text to be appended to the wp-config.php"; + }; }; }; @@ -44,7 +54,8 @@ package = wp-pkg domain; extraConfig = '' define('FS_METHOD', 'direct'); - ''; + '' + + settings.wpExtraConfig; themes = { }; }; @@ -104,6 +115,12 @@ 443 ]; + services.phpfpm.pools = builtins.listToAttrs ( + map ( + tenant: lib.nameValuePair "wordpress-${tenant}" { phpOptions = settings.phpfpmOptions; } + ) settings.tenants + ); + security.acme.acceptTerms = true; users.users.nginx.extraGroups = [ "acme" ];