Commit Graph

20 Commits

Author SHA1 Message Date
Warren
ebe976eee4 Implement Write/Read Cache (Phase 3)
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
2026-06-22 04:42:55 +08:00
Warren
c2ff6fc90e Phase 5: WebDAV async integration analysis - API mismatch found
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- dav-server DavFileSystem API changed (20+ compile errors)
- read_dir takes ReadDirMeta, not depth
- have_props/get_props/get_prop/patch_props new methods
- DavFile needs write_buf method
- DavMetaData/DavDirEntry async return types changed

Recommended approach: spawn_blocking wrapper (~2h)
Alternative: full rewrite (~8h)

Phase 5 blocked pending API analysis
2026-06-21 21:28:39 +08:00
Warren
23e0996b81 Phase 5: WebDAV async integration design framework
Some checks failed
Test / build (push) Has been cancelled
Test / test (push) Has been cancelled
- Detailed design notes for AsyncVfsDavFs
- AsyncVfsDavFile implementation pattern
- DavFileSystem trait async implementation
- Estimated: ~3 hours for full implementation

Phase 5 framework documented for future implementation
2026-06-21 21:20:47 +08:00
Warren
94a7584e64 P1: AsyncSmbVfs implementation (Phase 4)
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- AsyncSmbVfs: spawn_blocking wrapper over SmbVfs
- AsyncSmbFile: tokio::sync::Mutex for async state
- Add Clone derive to SmbVfs (Arc<Mutex<Tree>>)
- Remove manual Clone impl (derive handles it)

Phase 4 complete: AsyncSmbVfs working
Phase 5 pending: WebDAV integration

Tests: 293 passed, 0 failed
2026-06-21 21:16:50 +08:00
Warren
5c9b51fc49 P1: AsyncS3Vfs implementation (Phase 3)
Some checks failed
Test / build (push) Has been cancelled
Test / test (push) Has been cancelled
- AsyncS3Vfs: spawn_blocking wrapper over S3Vfs
- AsyncS3File: tokio::sync::Mutex for async state
- Add Clone derive to S3Vfs
- All backend methods wrapped with spawn_blocking

Phase 3 complete: AsyncS3Vfs working
Phase 4 pending: AsyncSmbVfs
Phase 5 pending: WebDAV integration

Tests: 293 passed, 0 failed
2026-06-21 21:08:48 +08:00
Warren
790efe13f4 P1: AsyncLocalFs implementation (Phase 2)
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- AsyncLocalFile: tokio::fs::File wrapper
- AsyncLocalFs: AsyncVfsBackend impl using tokio::fs
- Key methods: read_dir, open_file, stat, create_dir, remove_file, rename
- 4 async tests passing

Phase 2 complete: AsyncLocalFs working
Phase 3 pending: AsyncS3Vfs
Phase 4 pending: AsyncSmbVfs
Phase 5 pending: WebDAV integration

Tests: 293 passed, 0 failed
2026-06-21 20:59:41 +08:00
Warren
6242a5eaab P1: AsyncVfsBackend trait design (Phase 1 - framework)
Some checks failed
Test / build (push) Has been cancelled
Test / test (push) Has been cancelled
- Add AsyncVfsBackend + AsyncVfsFile trait definitions
- Use cfg(feature = "async-vfs") for optional compilation
- Design notes for Phase 2-5 implementation
- Estimated: ~13 hours (multi-day project)

Phase 2: AsyncLocalFs (tokio::fs)
Phase 3: AsyncS3Vfs (async client)
Phase 4: AsyncSmbVfs (async wrapper)
Phase 5: WebDAV integration

Tests: 289 passed, 0 failed
2026-06-21 20:52:31 +08:00
Warren
9acd174388 WebDAV improvements: flush fix, RwLock recovery, expired lock cleanup, atomic set_times
Some checks failed
Test / build (push) Has been cancelled
Test / test (push) Has been cancelled
P0 fixes:
- flush(): add flushed flag, proper error logging, Drop warning for data loss
- props_data RwLock: replace unwrap() with try_read/try_write recovery
- PersistedLs: add is_expired() + cleanup_expired_locks() helper

P1 improvements:
- Props persistence via VFS (load_props/save_props/patch_props)
- COPY/MOVE sync dead props (copy on COPY, move key on rename)
- Atomic set_atime/set_mtime via filetime crate (no race condition)

New files:
- webdav_locks.rs: PersistedLs with lock persistence + expiry cleanup

Tests: 288 passed, 0 failed
2026-06-21 16:07:12 +08:00
Warren
4afd96c9ac Implement VFS RAID-Z (software RAID)
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Add VfsRaidLevel enum:
  - Single (no RAID)
  - RaidZ1 (single parity, similar to RAID 5)
  - RaidZ2 (double parity, similar to RAID 6)
  - RaidZ3 (triple parity)
- Add VfsRaidBackend with:
  - Stripe-based data distribution across disks
  - Galois Field arithmetic for parity (P/Q/R)
  - gf_exp, gf_mul for Reed-Solomon coding
  - rebuild_disk() for disk recovery
- Add VfsRaidConfig:
  - level (RAID level)
  - stripe_size (default 64KB)
  - disk_paths (storage devices)
- All VfsBackend methods propagate to all disks
- Foundation for ZFS-style software RAID

All 229 tests pass.
2026-06-20 23:17:00 +08:00
Warren
37f5da7d6c Implement VFS Deduplication (block-level)
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Add DedupStore with content-addressable storage:
  - SHA-256 hash-based block storage
  - Reference counting for block lifecycle
  - dedup_file() and restore_file() operations
  - DedupManifest for file reconstruction
  - DedupStats for storage statistics
- Add VfsDedupConfig:
  - block_size (default 4KB)
  - min_file_size threshold
  - store_path for dedup directory
- Add hex crate for hash encoding
- Block-level dedup foundation for SMB/ZFS

All 229 tests pass.
2026-06-20 22:39:25 +08:00
Warren
1ca4913291 Implement SMB ACLs (NFSv4) at VFS layer
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Add ACL structures:
  - VfsAceType (Allow/Deny/Audit/Alarm)
  - VfsAceFlag (inheritance flags)
  - VfsAceMask (permission masks)
  - VfsAce (access control entry)
  - VfsAcl (ACL list with default_acl)
- Add VfsBackend methods:
  - get_acl() - retrieve ACL from .acl JSON
  - set_acl() - store ACL as .acl JSON
  - check_acl() - check permission for principal
  - add_ace() - add ACE to ACL
  - remove_ace() - remove ACE by index
- LocalFs implementation:
  - VfsAclMeta serialization struct
  - ACL stored as JSON metadata (similar to quota/snapshot)
  - Box<VfsAcl> for recursive default_acl
- Foundation for SMB/NFSv4 ACL support

All 229 tests pass.
2026-06-20 22:33:03 +08:00
Warren
837ffa923d Implement SMB Previous versions (shadow copy) at VFS layer
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Add VfsPreviousVersion struct (snapshot_name, gmt_token, created, size)
- Add VfsBackend methods:
  - list_previous_versions() - enumerate snapshot versions
  - open_previous_version() - open file from snapshot by GMT token
  - restore_previous_version() - restore file from snapshot
- LocalFs implementation:
  - systemtime_to_gmt_token() - convert SystemTime to @GMT-YYYY.MM.DD-HH.MM.SS
  - scan .snapshots directory for matching versions
  - use existing restore_snapshot() for restoration
- Foundation for SMB shadow copy (@GMT- token support)

All 229 tests pass.
2026-06-20 22:26:58 +08:00
Warren
70cc6d9921 Implement VFS compression support (ZSTD)
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Add VfsCompression and VfsCompressionConfig types
- Add compression module with Compressor:
  - compress/decompress methods
  - compress_file/decompress_file utilities
  - should_compress threshold check
  - extension detection (.zst, .lz4)
- Add zstd crate dependency
- LZ4 placeholder (future implementation)

Enables SMB transparent compression.

All 229 tests pass.
2026-06-20 22:21:50 +08:00
Warren
9c44bd5929 Implement VFS quota support
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Add VfsQuota and VfsQuotaUsage structs
- Add quota methods to VfsBackend trait:
  - set_quota: set space/file limits
  - get_quota: retrieve quota settings
  - get_quota_usage: current usage stats
  - check_quota: pre-write check
- Implement LocalFs quota support:
  - Uses .quota metadata file
  - JSON storage for quota limits
  - Recursive size/file counting
  - Hidden files excluded (.quota, .snapshots)

Enables SMB per-share/user quota enforcement.

All 229 tests pass.
2026-06-20 22:17:50 +08:00
Warren
f016525687 Implement VFS snapshot support (ZFS-style)
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Add VfsSnapshotInfo struct
- Add snapshot methods to VfsBackend trait:
  - create_snapshot: copy-on-write with metadata
  - list_snapshots: enumerate snapshots
  - delete_snapshot: remove snapshot and metadata
  - restore_snapshot: restore from snapshot
  - snapshot_info: get snapshot metadata
- Implement LocalFs snapshot support:
  - Uses .snapshots directory for storage
  - JSON metadata files (*.meta)
  - Recursive directory copy
  - Size calculation

This enables SMB 'Previous versions' feature foundation.

All 229 tests pass.
2026-06-20 22:13:17 +08:00
Warren
7eb528d35f SMB Server Phase 2: VFS backend build fix + integration test
Some checks failed
Test / build (push) Has been cancelled
Test / test (push) Has been cancelled
- Add VfsFile: Send supertrait for Mutex compatibility
- Fix SmbServerCommand: struct → Subcommand enum with Start variant
- Fix tracing_subscriber::init() → try_init() to avoid panic when
  logger already initialized
- Fix CLI subcommand name: smb-server → smb-start (flatten naming)
- Add #[command(name = "smb-start")] for CLI disambiguation
- Fix unused variable warnings (smb_fs.rs, smb_server_backend.rs)
- Remove unused VfsFile imports (webdav.rs, scp_handler.rs)
- Integration test: Docker smbclient verified (list, upload, read)
2026-06-20 19:42:29 +08:00
Warren
eb80c07c85 Implement WebDAV VFS integration: dav-server 0.11 compatible
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Add webdav.rs module: VfsDavFs, VfsDavFile, VfsDavMetaData
- Implement DavFileSystem + Clone for GuardedFileSystem blanket impl
- Add clone_boxed to VfsBackend trait (required for Sync)
- Update CLI webdav.rs to use VFS instead of SQLite
- Add bytes dependency
- All 155 tests pass
2026-06-19 08:19:16 +08:00
Warren
d94cb2df4c Fix code quality: trailing whitespace, unused imports, clippy warnings
- Fix trailing whitespace in kex.rs and s3.rs
- Add missing KexProposal import in kex_complete.rs
- Auto-fix clippy warnings across all crates
- All 153 tests pass
2026-06-19 05:21:38 +08:00
Warren
960ee87ce9 Add S3 VFS backend: VfsBackend impl for S3-compatible storage
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- S3Vfs with all 15 VfsBackend methods via rusty-s3 + ureq
- S3VfsFile for buffered writes + ranged reads
- AWS Signature V4 pre-signed URLs (rusty-s3)
- ListObjectsV2 for directory listing (prefix + delimiter)
- Path-style URL mapping (/path to bucket/key)
2026-06-18 23:44:52 +08:00
Warren
f90e4f496c VFS/DataProvider/Config refactoring + SSH public key authentication
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
Phase 1-6 of refactoring plan:
- VFS abstraction (VfsBackend trait + LocalFs + OpenFlags builder)
- DataProvider trait (SqliteProvider + PgProvider, SFTPGo-compatible)
- Config refactoring (AppConfig unified sections, env overrides)
- SSH handlers (sftp/scp/rsync) migrated to VFS + DataProvider
- SSH public key authentication (Ed25519 signature verification)
- SSH stderr → CHANNEL_EXTENDED_DATA support
- Web auth uses DataProvider instead of direct SQL
- User home directory from provider (per-user isolation)
- PostgreSQL auth provider for SFTPGo compatibility
2026-06-18 23:35:18 +08:00