diff options
| author | Alejandro Soto <alejandro@34project.org> | 2025-04-17 16:51:25 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2025-04-19 11:10:00 -0600 |
| commit | 8153fa9abfc01d79da8cdc6f68365e4d4c4d7cf9 (patch) | |
| tree | 5db21e65eaa3fa44e4b7063eb0350b6a5319e485 /sys | |
| parent | 92554d8615a5fe3b45073a62eb5341f4598463d5 (diff) | |
sys/web/sites/host: enable DAV reverse proxy
Diffstat (limited to '')
| -rw-r--r-- | sys/web/sites/host.nix | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/sys/web/sites/host.nix b/sys/web/sites/host.nix index 62abe1a..c1f028a 100644 --- a/sys/web/sites/host.nix +++ b/sys/web/sites/host.nix @@ -64,16 +64,33 @@ in } '' + config; }; + + userLocations = { + "/${name}" = '' + return 404; + ''; + } // optionalAttrs user.mail.dav { + "/${name}/dav" = '' + proxy_pass http://unix:/run/host-www/${name}/dav.sock; + ''; + }; in - mapAttrs (_: userLocation) { - "/${name}" = '' - return 404; - ''; - }) + mapAttrs (_: userLocation) userLocations) (filterAttrs (_: user: user.mail.certs != [ ]) users); }; }; }; }; + + systemd.tmpfiles.settings."10-run-host-www" = + concatMapAttrs + (name: _: { + "/run/host-www/${name}".d = { + mode = "0750"; + user = name; + group = "nginx"; + }; + }) + users; }; } |
