diff --git a/systems/x86_64-linux/sgx/firefly.nix b/systems/x86_64-linux/sgx/firefly.nix index cef398a..94ad43b 100644 --- a/systems/x86_64-linux/sgx/firefly.nix +++ b/systems/x86_64-linux/sgx/firefly.nix @@ -172,7 +172,7 @@ in virtualHost = importDomain; settings = { FIREFLY_III_URL = "https://${domain}"; - VANITY_URL = "https://${importDomain}"; + VANITY_URL = "https://${domain}"; TZ = "Europe/Berlin"; CAN_POST_FILES = "true"; CAN_POST_AUTOIMPORT = "true"; @@ -183,10 +183,16 @@ in }; nginx.virtualHosts = { - ${domain} = vhostBase; - # Importer's autoupload endpoint blocks until the entire batch - # finishes — POSTing 100+ transactions takes minutes. Default 60s - # fastcgi timeout makes nginx 504 even though PHP-FPM keeps going. + # Both Firefly III and the importer can take minutes per request + # during bulk imports — importer's autoupload endpoint blocks until + # the whole batch finishes; main Firefly's API serves long + # individual transaction-create calls. Default 60s fastcgi timeout + # produces 504s while PHP-FPM keeps processing. + ${domain} = vhostBase // { + extraConfig = '' + fastcgi_read_timeout 600s; + ''; + }; ${importDomain} = vhostBase // { extraConfig = '' fastcgi_read_timeout 600s; @@ -195,11 +201,16 @@ in }; # PHP's stock max_execution_time = 30s aborts large bulk imports - # mid-stream. Match the nginx fastcgi_read_timeout above. + # mid-stream. Match the nginx fastcgi_read_timeout above on both + # the importer pool and the main Firefly pool. phpfpm.pools.firefly-iii-data-importer.settings = { "php_admin_value[max_execution_time]" = "600"; "php_admin_value[memory_limit]" = "512M"; }; + phpfpm.pools.firefly-iii.settings = { + "php_admin_value[max_execution_time]" = "600"; + "php_admin_value[memory_limit]" = "512M"; + }; }; }