GitHub - mickael-kerjean/fdrive: Universal File Sync

GitHub

3 min read Original article ↗

What is fdrive?

A cross platform drive client that does not try to own your storage, but rather connects to it wherever it already lives. From S3 and SFTP to FTP, NFS, SMB, IPFS, Azure, Google Cloud, and beyond, it is powered by Filestash

windows screenshot Windows screenshot

mac screenshot Mac screenshot

mac screenshot Iphone screenshot

android screenshot Android screenshot

linux screenshot Linux screenshot

Architecture

We use the hexagonal architecture / ports and adapters pattern. The core owns all policy, everything that decides what moves where lives there, once. Each platform adapts its own UI and filesystem technology to it.

crate technology
fdrive-core model (the sync vocabulary: Operation, Plan, Fate, Conflict), engine (the journal and its state, plan replay, conflict rules, cache policy), the LocalTree port, the Filestash HTTP sdk
fdrive-linux FUSE, GTK
fdrive-windows CfAPI, Win32
fdrive-mac FileProvider
fdrive-ios FileProvider
fdrive-android Storage Access Framework

Features

  • Sane Architecture: one Rust core makes every decision and each platform only implements the lipstick, so sync behaves the same everywhere
  • Delta sync: only ship the bytes that changed, not the whole file
  • Lives in the tray: the tray icon shows the status, synced, syncing or in trouble at a glance
  • Files on demand: a file only downloads when you open it, with both content and listings cached so browsing stays snappy and the next open is instant
  • Streaming: large files open immediately, reads are served as the bytes arrive
  • Offline mode: cached files stay readable and editable, changes upload once the link returns
  • Conflict handling: your work is never lost, when both sides changed you get a (conflicted copy) so both versions survive
  • Coalesced uploads: the journal folds editor save dances and rapid edits into the fewest server operations, and retries back off instead of hammering the server
  • Thumbnails: they are generated on the server through fine tuned C code that works fast!
  • Safe deletes: removes and renames carry a lease, they only apply if the server still holds the version you last saw, so nothing you have not seen can ever be destroyed
  • Crash safe: unpushed edits survive crashes and restarts
  • Reset friendly: rage deleting the local cache partially or entirely is not undefined behavior
  • Live view: changes made elsewhere show up in the folder you are browsing, no manual refresh
  • Pinning: mark a folder always available offline, it syncs down ahead of time and survives cache cleanup (setfattr -n user.fdrive.pin -v always <dir> on linux)
  • Ignore list: node_modules, .DS_Store and friends stay home by default, adjustable via fdrive.toml
  • Login: done through your server's own login page, password, LDAP, SSO, 2FA all just work
  • No Electron: native everything from the tray, filesystem integration into one single binary
  • Profiles: connect to several servers / accounts in the same time
  • Deep integration with Filestash for file locks
  • Deep integration with Filestash for file versioning
  • Deep integration with Filestash for search
  • Explorer actions: surface share links and friends right from the file manager
  • MacOS FileProvider: we are using fuse-t temporarly until we have actual apple hardware
  • Testing: test on all possible devices / configuration
  • Support for delta download: same as the existing upload but for download. Awaiting for server support
  • MDM integration: preconfigure the client and roll it out across a fleet
  • full POSIX compliance
  • finetune performance
  • Ransomware protection