pointfichiers/services/webdav/default.nix
2024-11-04 21:54:26 +01:00

35 lines
962 B
Nix

{config, ...}: {
sops.secrets."webdav/USER_PASSWORD".owner = "${config.services.webdav.user}";
sops.templates."webdav.env" = {
content = ''
USER_PASSWORD=${config.sops.placeholder."webdav/USER_PASSWORD"}
'';
owner = "${config.services.webdav.user}";
};
services.caddy.virtualHosts."webdav.gasdev.fr".extraConfig = ''
reverse_proxy http://127.0.0.1:6065
'';
services.webdav = {
enable = true;
environmentFile = config.sops.templates."webdav.env".path;
settings = {
address = "0.0.0.0";
port = 6065;
tls = false;
behindProxy = true;
directory = "/var/lib/webdav";
debug = true;
users = [
{
username = "gaspard";
password = "{env}USER_PASSWORD";
permissions = "CRUD";
}
];
};
};
systemd.services.webdav.serviceConfig.StateDirectory = "webdav";
systemd.services.webdav.serviceConfig.StateDirectoryMode = "0740";
}