Open lidel opened 5 years ago
Note: it should be pretty easy to implement: https://pkg.go.dev/golang.org/x/net/webdav
I made an ipfs-webdav daemon
That is very interesting @vlad20012!
I too am making a webdav ipfs layer in nodejs and i too went the route of exposing a new http endpoint for webdav. The idea is to have that within the go-ipfs gateway codebase to have a webdav support from any gateway out there.
Also, my approach currently is read-only. Mutability kinda adds in a slew of other difficulties. Your project does seem much more advanced, you have write support! Nice!
My approach was to create a virtual fs
wrapper object that talks ipfs in the implementation. Then it's fairly easy to just give a webdav library that fs object as "directory to expose". This approach does work but i'm just not super far in it yet. It's far enough to be able to browse folders and open files.
A downside i quickly discovered in webdav is that the clients i tried thus far have an download-then-execute approach. So for example opening a large iso first downloads it to your local pc and then opens it. It is workable but does limit the webdav usefulness quite a bit. Did you find a way to fix that to be streaming based?
A downside i quickly discovered in webdav is that the clients i tried thus far have an download-then-execute approach. So for example opening a large iso first downloads it to your local pc and then opens it. It is workable but does limit the webdav usefulness quite a bit. Did you find a way to fix that to be streaming based?
Oddly enough, davfs2
actually works that way. But at lease GVFS mounts (from Nautilus
aka Files
in GNOME) supports streaming. To be honest, I'm very surprised davfs2
is so dumb. If the state of WebDAV support in other systems is the same deplorable, I'll consider implementing NFS, SMB and APFS protocols instead.
For anyone following, a lengthy WebDAV exploration in the context of use with IPFS was published at https://blog.ipfs.tech/2022-10-13-ipfs-over-webdav/ (thanks @markg85!)
TL;DR
This could be a way of mounting MFS or a specific CID as a drive in a way that works on all systems without having to deal with FUSE (https://github.com/ipfs/go-ipfs/issues/7494)
What is WebDAV?
WebDAV extends the set of standard HTTP verbs and headers allowed for request methods. The added verbs include:
Potential IPFS Use Cases
Why it is worth investigating?
References
Draft of the plan to support WebDAV in IPFS stack
Stage 0: read-only /ipfs/{cid}
HTTP Gateway exposed by go-ipfs supports WebDAV for immutable, read-only
/ipfs/{cid}
roots that are unixfs directories.This is low risk high impact feature that allows everyone to mount CID from any public (or local) gateway and use it as read-only drive in Windows/macOS (native support) and Linux (native support if something like gvfs is present).
Stage 1: read-write MFS
This requires more work, but provides extremely useful feature to our users. HTTP Gateway on localhost could expose
/mfs/local
(path tbd) which would be writable.Cannot stress how big UX win this is – users will no longer be limited to choice between
ipfs files --help
CLI and ipfs-webui, but will be able to mount MFS (their Files from ipfs-webui) as a real drive.Loose ideas: