3.0 KiB
3.0 KiB
Implementation Plan for furumi-mount-windows Client
Architectural Decision
- VFS Driver:
WinFSP(Windows File System Proxy). - Justification: Excellent performance, perfect compatibility with the FUSE model, widely used in similar projects (e.g., rclone, sshfs-win).
- Installation: A unified installer (bundle) will be created (for example, using Inno Setup or WiX Toolkit), which will:
- Check if WinFSP is already installed.
- Automatically install the official
winfsp.msisilently (using/qnflags) if the driver is missing. - Install the
furumi-mount-windows.execlient itself.
Implementation Details
1. Application Scaffold
- Create a new binary crate
furumi-mount-windowswithin the workspace. - Add dependencies:
winfsp(orwfd),tokio,clap,tracing, and an internal dependency onfurumi-client-core.
2. Entry Point (CLI)
- In
main.rs, configure parsing for command-line arguments and environment variables (--server,--token,--mount), similar tofurumi-mount-macos. - Initialize the gRPC connection to the server via
furumi-client-core. - Configure directory mounting:
- As a network drive (e.g.,
Z:). - Or as a transparent folder within an existing NTFS filesystem (depending on driver support/flags).
- As a network drive (e.g.,
3. VFS Implementation
- Create an
fs.rsmodule. - Implement the trait or callback structure required by WinFSP (e.g., the
WinFspFileSystemstructure). - Action mapping:
GetFileInfo/GetSecurityByName→ gRPCGetAttrcall.ReadDirectory→ Streaming gRPCReadDircall.ReadFile→ReadFilegRPC call (with support for stream chunking).
- Crucial Part: Translating Unix file attributes (from gRPC) into Windows File Attributes to ensure the system permits high-performance continuous stream reading (especially for media).
4. Installer Creation
- Write a configuration script for a Windows installer builder (e.g.,
windows/setup.issfor Inno Setup). - Neatly bundle both
winfsp-x.y.z.msiandfurumi-mount-windows.exetogether. - Add Custom Actions / Logic to:
- Check the Windows Registry for an existing WinFSP installation.
- Trigger the
winfsp.msiinstallation conditionally.
5. CI/CD Integration
- Update the GitHub Actions workflow (
docker-publish.ymlor create a dedicated release workflow). - Add the target toolchain:
x86_64-pc-windows-msvc. - Add a step to compile:
cargo build --release --bin furumi-mount-windows. - Add a step to build the installer (e.g.,
iscc setup.issor viacargo-wix). - Output the final
setup.exeas a GitHub Release artifact alongside other binaries.
6. Testing Strategy
- Write unit tests in Rust covering attribute translation and path mapping (mapping slashes
/to backslashes\). - Manual System Testing:
- Start
furumi-serverlocally. - Run the installer on a clean Windows machine (VM without pre-installed WinFSP).
- Verify that the drive mounts correctly and seamlessly.
- Launch media playback (e.g., via VLC/mpv) to ensure streaming stability over the VFS connection.
- Start