clanService/wordpress: phpfpm options and wp-config.php are configurable from inventory interface

This commit is contained in:
2026-06-12 12:09:56 +07:00
parent d622040d30
commit 8b12656149
2 changed files with 28 additions and 1 deletions
+10
View File
@@ -287,6 +287,16 @@
tenants = [ tenants = [
"poyfestival.com" "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);
'';
}; };
}; };
}; };
+18 -1
View File
@@ -18,6 +18,16 @@
description = "List of tenants website to host on the instance"; description = "List of tenants website to host on the instance";
example = [ "example.com" ]; 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; package = wp-pkg domain;
extraConfig = '' extraConfig = ''
define('FS_METHOD', 'direct'); define('FS_METHOD', 'direct');
''; ''
+ settings.wpExtraConfig;
themes = { }; themes = { };
}; };
@@ -104,6 +115,12 @@
443 443
]; ];
services.phpfpm.pools = builtins.listToAttrs (
map (
tenant: lib.nameValuePair "wordpress-${tenant}" { phpOptions = settings.phpfpmOptions; }
) settings.tenants
);
security.acme.acceptTerms = true; security.acme.acceptTerms = true;
users.users.nginx.extraGroups = [ "acme" ]; users.users.nginx.extraGroups = [ "acme" ];