From ac64d94e00fdac3c0ca6c31a0e1d8036f4e58d6f Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 1 Jun 2026 02:31:54 +0900 Subject: [PATCH] hosts/roundcube: webdir moved to `public_html` within package --- .../bekkalokk/services/webmail/roundcube.nix | 39 +++++++------------ 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/hosts/bekkalokk/services/webmail/roundcube.nix b/hosts/bekkalokk/services/webmail/roundcube.nix index 4ef199c..50047ca 100644 --- a/hosts/bekkalokk/services/webmail/roundcube.nix +++ b/hosts/bekkalokk/services/webmail/roundcube.nix @@ -57,35 +57,22 @@ in tryFiles = "$uri $uri/ =404"; index = "index.php"; root = pkgs.linkFarm "roundcube-dir" { - roundcube = "${cfg.package}"; + roundcube = "${cfg.package}/public_html"; }; - + priority = 1100; extraConfig = '' - location ~ ^/roundcube/(${builtins.concatStringsSep "|" [ - # https://wiki.archlinux.org/title/Roundcube - "README" - "INSTALL" - "LICENSE" - "CHANGELOG" - "UPGRADING" - "bin" - "SQL" - ".+\\.md" - "\\." - "config" - "temp" - "logs" - ]})/? { - deny all; - } + add_header Cache-Control 'public, max-age=604800, must-revalidate'; + client_max_body_size ${toString cfg.maxAttachmentSize}; + ''; + }; - location ~ ^/roundcube/(.+\.php)(/?.*)$ { - fastcgi_split_path_info ^/roundcube(/.+\.php)(/.+)$; - include ${config.services.nginx.package}/conf/fastcgi_params; - include ${config.services.nginx.package}/conf/fastcgi.conf; - fastcgi_index index.php; - fastcgi_pass unix:${config.services.phpfpm.pools.roundcube.socket}; - } + locations."~ ^/roundcube/(.+\\.php)(/?.*)$" = { + extraConfig = '' + fastcgi_split_path_info ^/roundcube(/.+\.php)(/.+)$; + include ${config.services.nginx.package}/conf/fastcgi_params; + include ${config.services.nginx.package}/conf/fastcgi.conf; + fastcgi_index index.php; + fastcgi_pass unix:${config.services.phpfpm.pools.roundcube.socket}; ''; }; };