miniserve
miniserve copied to clipboard
WebDAV support
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.
Yeah sounds cool. I'll check out the rust WebDAV implementation. Maybe there's something we can already use.
:wave: Hey, any updates on this one?
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
If anyone uses rclone, it has a builtin webdav server. It should be sufficient for a one off job.
rclone serve webdav .
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
There is also dufs which is a bit similiar to miniserve, has webdav support and is written in rust