All Projects → miquels → Webdavfs

miquels / Webdavfs

Licence: mit
Linux / OSX FUSE webdav filesystem. This filesystem behaves like a real network filesystem- no unnecessary copying of entire files.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Webdavfs

onepile
Playground for the future of private notes and document management
Stars: ✭ 41 (-40.58%)
Mutual labels:  osx, webdav
Rar2fs
FUSE file system for reading RAR archives
Stars: ✭ 155 (+124.64%)
Mutual labels:  fuse, osx
Distribyted
📂 ➡️ 📺 🎶 🎮 Torrent client with on-demand file downloading as a filesystem.
Stars: ✭ 791 (+1046.38%)
Mutual labels:  fuse, webdav
Sparsebundlefs
FUSE filesystem for reading macOS sparse-bundle disk images
Stars: ✭ 238 (+244.93%)
Mutual labels:  fuse, osx
Android File Transfer Linux
Android File Transfer for Linux
Stars: ✭ 994 (+1340.58%)
Mutual labels:  fuse, osx
Cmake Get
Get dependencies with cmake
Stars: ✭ 59 (-14.49%)
Mutual labels:  osx
Coinwatch
View cryptocurrency prices with your Macbook's touchbar.
Stars: ✭ 66 (-4.35%)
Mutual labels:  osx
Wkzombie
WKZombie is a Swift framework for iOS/OSX to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser. It can be used to run automated tests / snapshots and manipulate websites using Javascript.
Stars: ✭ 1,105 (+1501.45%)
Mutual labels:  osx
Gitee
Gitee, OS X status bar application for Github
Stars: ✭ 1,095 (+1486.96%)
Mutual labels:  osx
Dave
A totally simple and very easy to configure stand alone webdav server
Stars: ✭ 69 (+0%)
Mutual labels:  webdav
Hazelcast Cpp Client
Hazelcast IMDG C++ Client
Stars: ✭ 67 (-2.9%)
Mutual labels:  osx
Nord Xcode
An arctic, north-bluish clean and elegant Xcode color theme.
Stars: ✭ 63 (-8.7%)
Mutual labels:  osx
Saml2aws
CLI tool which enables you to login and retrieve AWS temporary credentials using a SAML IDP
Stars: ✭ 1,109 (+1507.25%)
Mutual labels:  osx
Openframeworks
openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
Stars: ✭ 8,652 (+12439.13%)
Mutual labels:  osx
Dnscrypt Menu
Manage DNSCrypt from the macOS menu bar (BitBar plugin)
Stars: ✭ 59 (-14.49%)
Mutual labels:  osx
Pifs
The high performance data-free filesystem
Stars: ✭ 68 (-1.45%)
Mutual labels:  fuse
Syncthing Macos
Frugal and native macOS Syncthing application bundle
Stars: ✭ 1,096 (+1488.41%)
Mutual labels:  osx
Cyberduck
Cyberduck is a libre FTP, SFTP, WebDAV, Amazon S3, Backblaze B2, Microsoft Azure & OneDrive and OpenStack Swift file transfer client for Mac and Windows.
Stars: ✭ 1,080 (+1465.22%)
Mutual labels:  webdav
Magnum Plugins
Plugins for the Magnum C++11/C++14 graphics engine
Stars: ✭ 66 (-4.35%)
Mutual labels:  osx
Owon Vds1022
Unofficial release for the OWON VDS1022/I Oscilloscope
Stars: ✭ 63 (-8.7%)
Mutual labels:  osx

webdavfs

A FUSE filesystem for WEBDAV shares.

Most filesystem drivers for Webdav shares act somewhat like a mirror; if a file is read it's first downloaded then cached in its entirety on a local drive, then read from there. Writing files is similar or even worse- a partial update to a file might involve downloading it first, modifying it, then uploading it again. In many cases that is not optimal.

This filesystem driver behaves like a network filesystem. It doesn't cache anything locally, it just sends out partial reads/writes over the network.

For that to work, you need partial write support- and unfortunately, there is no standard for that. See https://blog.sphere.chronosempire.org.uk/2012/11/21/webdav-and-the-http-patch-nightmare

However, there is support in Apache (the webserver, using mod_dav) and SabreDav (a php webserver server library, used by e.g. NextCloud) for partial writes. So we detect if it's Apache or SabreDav we're talking to and then use their specific methods to partially update files.

If no support for partial writes is detected, mount.webdavfs will print a warning and mount the filesystem read-only. In that case you can also use the rwdirops mount option, this will make metadata writable (i.e. you can use rm / mv / mkdir / rmdir) but you still won't be able to write to files.

But if you only need to read files it's still way faster than davfs2 :)

What is working

Basic filesystem operations.

  • files: create/delete/read/write/truncate/seek
  • directories: mkdir rmdir readdir
  • query filesystem size (df / vfsstat)

What is not yet working

  • locking

What will not ever work

  • change permissions (all files are 644, all dirs are 755)
  • change user/group
  • devices / fifos / chardev / blockdev etc
  • truncate(2) / ftruncate(2) for lengths between 1 .. currentfilesize - 1

This is basically because these are mostly just missing properties from webdav.

How to install and use.

First you need to install golang, git, fuse, and set up your environment.

Note that you need at least Go 1.4 (probably 1.6). If you're on Debian, everything before Debian 8 (jessie) is too old. On jessie you need to add the jessie-backports source, then install go from backports.

# echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
# apt-get update
# apt-get install -t jessie-backports golang

Then if your Go version is up to date, continue:

$ su -m
Password:
# apt-get install golang
# apt-get install git
# apt-get install fuse
# exit
$ cd
$ mkdir pkg bin src
$ export GOPATH=$HOME

Now with go and git installed, get a copy of this github repository:

$ cd src
$ mkdir -p github.com/miquels
$ cd github.com/miquels
$ git clone https://github.com/miquels/webdavfs
$ cd webdavfs

You're now ready to build the binary:

$ go get
$ go build

And install it:

$ su -m
Password:
# cp webdavfs /sbin/mount.webdavfs

Using it is simple as:

# mount -t webdavfs -ousername=you,password=pass https://webdav.where.ever/subdir /mnt

Command line options

Option Description
-f don't actually mount
-D daemonize
-T opts trace options: fuse,webdav,httpreq,httphdr
-F file trace file. file will be reopened when renamed, tracing will stop when file is removed
-o opts mount options

Mount options

Option Description
allow_root If mounted as normal user, allow access by root
allow_other Allow access by others than the mount owner. This
also sets "default_permisions"
default_permissions As per fuse documentation
no_default_permissions Don't set "default_permissions" with "allow_other"
ro Read only
rwdirops Read-write for directory operations, but no file-writing (no PUT)
rw Read-write (default)
uid User ID for filesystem
gid Group ID for filesystem.
mode Mode for files/directories on the filesystem (600, 666, etc).
Files will never have the executable bit on, directories always.
cookie Authorization Cookie (Useful for O365 Sharepoint/OneDrive for Business)
password Password of webdav user
username Username of webdav user
async_read As per fuse documentation
nonempty As per fuse documentation
maxconns Maximum number of parallel connections to the webdav
server (default 8)
maxidleconns Maximum number of idle connections (default 8)

If the webdavfs program is called via mount -t webdavfs or as mount.webdav, it will fork, re-exec and run in the background. In that case it will remove the username and password options from the command line, and communicate them via the environment instead.

The environment options for username and password are WEBDAV_USERNAME and WEBDAV_PASSWORD, respectively.

In the future it will also be possible to read the credentials from a configuration file.

TODO

  • maxconns doesn't work yet. this is complicated with the Go HTTP client.
  • add configuration file
  • timeout handling and interrupt handling
  • we use busy-loop locking, yuck. use semaphores built on channels.
  • rewrite fuse.go code to use the bazil/fuse abstraction instead of bazil/fuse/fs.
    perhaps switch to

Unix filesystem extensions for webdav.

Not ever going to happen, but if you wanted a more unix-like experience and better performance, here are a few ideas:

  • Content-Type: for unix pipes / chardevs / etc
  • contentsize property (read-write)
  • inodenumber property
  • unix properties like uid/gid/mode
  • DELETE Depth 0 for collections (no delete if non-empty)
  • return updated PROPSTAT information after operations like PUT / DELETE / MKCOL / MOVE
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].