From fb21bfd6d67ab01920d46a3740ca566149e5fdaa Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 24 Oct 2022 15:48:34 +0200 Subject: [PATCH] update localmount / rclone docs --- README.md | 18 +++++++++++++++++- docs/rclone.md | 34 ++++++++++++++++++++++------------ 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b7c12204..4f2d8f7b 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ try the **[read-only demo server](https://a.ocv.me/pub/demo/)** 👀 running fro * [complete examples](#complete-examples) * [browser support](#browser-support) - TLDR: yes * [client examples](#client-examples) - interact with copyparty using non-browser clients + * [mount as drive](#mount-as-drive) - a remote copyparty server as a local filesystem * [up2k](#up2k) - quick outline of the up2k protocol, see [uploading](#uploading) for the web-client * [why chunk-hashes](#why-chunk-hashes) - a single sha512 would be better, right? * [performance](#performance) - defaults are usually fine - expect `8 GiB/s` download, `1 GiB/s` upload @@ -743,7 +744,7 @@ known client bugs: ## smb server -unsafe, not recommended for wan, enable with `--smb` for read-only or `--smbw` for read-write +unsafe, slow, not recommended for wan, enable with `--smb` for read-only or `--smbw` for read-write dependencies: `python3 -m pip install --user -U impacket==0.10.0` * newer versions of impacket will hopefully work just fine but there is monkeypatching so maybe not @@ -758,6 +759,7 @@ and some minor issues, * hot-reload of server config (`/?reload=cfg`) only works for volumes, not account passwords * listens on the first `-i` interface only (default = 0.0.0.0 = all) * login doesn't work on winxp, but anonymous access is ok -- remove all accounts from copyparty config for that to work + * win10 onwards does not allow connecting anonymously / without accounts * python3 only * slow @@ -1111,6 +1113,20 @@ you can provide passwords using cookie `cppwd=hunter2`, as a url-param `?pw=hunt NOTE: curl will not send the original filename if you use `-T` combined with url-params! Also, make sure to always leave a trailing slash in URLs unless you want to override the filename +## mount as drive + +a remote copyparty server as a local filesystem; some alternatives roughly sorted by speed (unreproducible benchmark), best first: + +* [rclone-http](./docs/rclone.md) (25s), read-only +* [rclone-webdav](./docs/rclone.md) (51s), read/WRITE + * copyparty-1.5.0's webdav server is faster than rclone-1.60.0 (69s) +* [copyparty-fuse.py](./bin/#copyparty-fusepy) (71s), read-only +* [win10-webdav](#webdav-server) (138s), read/WRITE +* [win10-smb2](#smb-server) (387s), read/WRITE + +most clients will fail to mount the root of a copyparty server unless there is a root volume (so you get the admin-panel instead of a browser when accessing it) -- in that case, mount a specific volume instead + + # up2k quick outline of the up2k protocol, see [uploading](#uploading) for the web-client diff --git a/docs/rclone.md b/docs/rclone.md index 8d379fc8..91460dfc 100644 --- a/docs/rclone.md +++ b/docs/rclone.md @@ -14,15 +14,22 @@ when server is on another machine (1gbit LAN), # creating the config file -if you want to use password auth, add `headers = Cookie,cppwd=fgsfds` below +replace `hunter2` with your password, or remove the `hunter2` lines if you allow anonymous access ### on windows clients: ``` ( -echo [cpp] +echo [cpp-rw] +echo type = webdav +echo vendor = other +echo url = http://127.0.0.1:3923/ +echo headers = Cookie,cppwd=hunter2 +echo( +echo [cpp-ro] echo type = http echo url = http://127.0.0.1:3923/ +echo headers = Cookie,cppwd=hunter2 ) > %userprofile%\.config\rclone\rclone.conf ``` @@ -32,16 +39,26 @@ also install the windows dependencies: [winfsp](https://github.com/billziss-gh/w ### on unix clients: ``` cat > ~/.config/rclone/rclone.conf <<'EOF' -[cpp] +[cpp-rw] +type = webdav +vendor = other +url = http://127.0.0.1:3923/ +headers = Cookie,cppwd=hunter2 + +[cpp-ro] type = http url = http://127.0.0.1:3923/ +headers = Cookie,cppwd=hunter2 EOF ``` # mounting the copyparty server locally + +connect to `cpp-rw:` for read-write, or `cpp-ro:` for read-only (twice as fast): + ``` -rclone.exe mount --vfs-cache-max-age 5s --attr-timeout 5s --dir-cache-time 5s cpp: Z: +rclone.exe mount --vfs-cache-mode writes --vfs-cache-max-age 5s --attr-timeout 5s --dir-cache-time 5s cpp-rw: W: ``` @@ -51,12 +68,5 @@ feels out of place but is too good not to mention ``` rclone.exe serve http --read-only . +rclone.exe serve webdav . ``` - -* `webdav` gives write-access but `http` is twice as fast -* `ftp` is buggy, avoid - - -# bugs - -* rclone-client throws an exception if you try to read an empty file (should return zero bytes)