miniserve icon indicating copy to clipboard operation
miniserve copied to clipboard

WebDAV support

Open KSXGitHub opened this issue 4 years ago • 6 comments

Motivation

Sometimes I want to browse files hosted by miniserve the same way I do with local files (i.e. using a File Explorer).

Suggestion

Implement WebDAV. Initially, read-only would be sufficed.

Additional Suggestion

miniserve has a feature that allow end-user to upload their files. I think it should conform WebDAV standard.

KSXGitHub avatar Apr 19 '20 14:04 KSXGitHub

Yeah sounds cool. I'll check out the rust WebDAV implementation. Maybe there's something we can already use.

svenstaro avatar Apr 19 '20 21:04 svenstaro

:wave: Hey, any updates on this one?

HerHde avatar Jun 29 '20 20:06 HerHde

I just stumbled over https://github.com/miquels/webdav-handler-rs and it has a actix 4 support. I tried out the example (https://github.com/miquels/webdav-handler-rs/blob/master/src/actix.rs) and upload/download/listing... seems to work. Quite suprised how well it works. I think we could use this as a middleware/service in miniserve.

I think this could make miniserve quite a lot nicer:

  • Good cli usage for uploading/downloading/etc
  • Mounting support
  • Mkdir/delete/rename/move.... for "free" (https://github.com/svenstaro/miniserve/issues/502 & https://github.com/svenstaro/miniserve/issues/397)
  • No need to think about a new protocol
  • No path/api pollution as we currently have with /upload. The same route could be a folder with GET methond and an api endpoint with POST, but it's somehow two completely different things.

Problems:

  • If we don't want to have code duplication for for example upload we need to do some smart things, as WebDAV uses the PUT method for http uploads, but without js we can't do them from the webui. We would need to have a post request handler that somehow "rewrites" those requests and inject them back into webdav-handler

Jikstra avatar Dec 24 '21 14:12 Jikstra

If anyone uses rclone, it has a builtin webdav server. It should be sufficient for a one off job. rclone serve webdav .

Dialga avatar Mar 12 '22 16:03 Dialga

JFYI: small webdav share program in plain C but also with Qt GUI https://ltworf.github.io/weborf/

see also https://github.com/yurt-page/docs/blob/main/webservers.md

stokito avatar Mar 24 '23 12:03 stokito

There is also dufs which is a bit similiar to miniserve, has webdav support and is written in rust

obsoleszenz avatar Mar 24 '23 13:03 obsoleszenz