feat: implement unified directory structure with automatic migration for CalDAV and CardDAV #4

Merged
arnef merged 4 commits from bug/3 into main 2026-08-30 12:04:13 +00:00
Owner
  • Unify directory structure across protocols:

    • 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

- Unify directory structure across protocols: * WebDAV: data/files/<username>/ * CalDAV: data/<username>/calendars/<name>/ * CardDAV: data/<username>/addressbooks/<name>/ - 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
arnef force-pushed bug/3 from 001cc68172 to be47d6844c 2026-08-30 11:09:45 +00:00 Compare
arnef added 2 commits 2026-08-30 11:10:30 +00:00
Unify user data directory from fragmented layout to consistent nested format:

- Move WebDAV from: data/files/<username> → data/<username>/files/
- Move CalDAV from: data/<username>/cal-<name> → data/<username>/calendars/<name>
- Move CardDAV from: data/<username>/card-<name> → data/<username>/addressbooks/<name>

Changes:
- internal/store/store.go: Update collectionPath() to map collection names
- internal/store/migrate.go: Add idempotent Migrate() method
- internal/store/migrate_test.go: Comprehensive migration tests
- internal/webdav/handler.go: Use new unified path structure
- cmd/server/main.go: Auto-run migration on startup
- tools/nidusctl/main.go: Add migrate subcommand
- Update tests to verify new structure

URL endpoints unchanged - only on-disk structure modified. All tests pass.
arnef force-pushed bug/3 from be47d6844c to 8d2d8d3972 2026-08-30 11:10:30 +00:00 Compare
arnef added 1 commit 2026-08-30 11:56:28 +00:00
- Add web-deps, nidusctl, and migrate commands to build section
- Document ICS/webcal subscriptions and Birthdays calendar
- Note Migrate() is idempotent
- Add additional database tables
- Include Docker/CI and database migration details
arnef added 1 commit 2026-08-30 11:57:57 +00:00
arnef merged commit e96a0b8c92 into main 2026-08-30 12:04:13 +00:00
arnef deleted branch bug/3 2026-08-30 12:04:13 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: arnef/nidus#4