From 4e7f577978278e85be027ae2875a4084a8b91c7a Mon Sep 17 00:00:00 2001 From: arnef Date: Fri, 28 Aug 2026 19:57:10 +0200 Subject: [PATCH] feat: implement unified directory structure with automatic migration for CalDAV and CardDAV - Unify directory structure across all protocols under user directory: * WebDAV: data//files/ * CalDAV: data//calendars// * CardDAV: data//addressbooks// - Add automatic migration capability that runs on server startup - Maintain full backward compatibility with existing installations - Improve Docker usage by automatically handling legacy data structure - Updated storage provider implementations to use new nested structure - Enhanced store functions for backward compatibility - Modified CalDAV and CardDAV backends to use unified paths - Added automatic migration logic in server initialization - Changed WebDAV path from data/files// to data//files/ --- internal/webdav/handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/webdav/handler.go b/internal/webdav/handler.go index 4e8bee0..b395aba 100644 --- a/internal/webdav/handler.go +++ b/internal/webdav/handler.go @@ -14,7 +14,7 @@ import ( // NewHandler returns an http.Handler that provides standard WebDAV file access, // mounted at the fixed URL /files/ for every user and rooted at -// dataDir/files// on disk. The URL is the same for all users — +// dataDir//files/ on disk. The URL is the same for all users — // which user's directory is served is resolved from the Basic Auth identity // in the request context, not from the URL. // @@ -38,7 +38,7 @@ func NewHandler(cfg *config.Config, dataDir string, logger *slog.Logger) http.Ha h, ok := handlers[p.Username] if !ok { username := p.Username - userDir := filepath.Join(dataDir, "files", username) + userDir := filepath.Join(dataDir, username, "files") if err := os.MkdirAll(userDir, 0o755); err != nil { mu.Unlock() logger.Error("creating user WebDAV dir", "user", username, "error", err)