How to get webdav working? can read, not write.
config:
{
services.webdav = {
enable = true;
settings = {
address = "127.0.0.1"; # Bind only to localhost for Traefik
port = 58081; # WebDAV service port
scope = "/zfs/obsidian"; # Directory served via WebDAV
modify = true; # Allow write operations
auth = true; # Enable authentication
logLevel = "debug";
users = [
{
username = "xxx";
password = "xxx";
}
];
};
};
# Create the WebDAV directory and set permissions
systemd.tmpfiles.rules = [
"d /zfs/obsidian 0775 1000 1000 -"
];
# Configure Traefik reverse proxy
services.traefik.dynamicConfigOptions = {
http.routers.webdav = {
entryPoints = [ "http" ]; # Use "websecure" for HTTPS
rule = "Host(`webdav.local`)";
service = "webdav";
};
http.services.webdav.loadBalancer.servers = [
{ url = "http://127.0.0.1:58081"; } # Match the WebDAV port
];
};
}
test:
curl -v -u xxx:xxx -X MKCOL http://webdav.local/zfs/obsidian/new
result:
< HTTP/1.1 403 Forbidden