2020-10-25 08:05:11 +01:00
# using rclone to mount a remote copyparty server as a local filesystem
speed estimates with server and client on the same win10 machine:
* `1070 MiB/s` with rclone as both server and client
* `570 MiB/s` with rclone-client and `copyparty -ed -j16` as server
* `220 MiB/s` with rclone-client and `copyparty -ed` as server
2022-11-26 19:53:41 +00:00
* `100 MiB/s` with [../bin/partyfuse.py ](../bin/partyfuse.py ) as client
2020-10-25 08:05:11 +01:00
when server is on another machine (1gbit LAN),
2022-11-26 19:53:41 +00:00
* `75 MiB/s` with [../bin/partyfuse.py ](../bin/partyfuse.py ) as client
2020-10-25 08:05:11 +01:00
* `92 MiB/s` with rclone-client and `copyparty -ed` as server
* `103 MiB/s` (connection max) with `copyparty -ed -j16` and all the others
# creating the config file
2023-03-20 21:54:08 +00:00
the copyparty "connect" page at `/?hc` (so for example http://127.0.0.1:3923/?hc) will generate commands to autoconfigure rclone for your server
**if you prefer to configure rclone manually, continue reading:**
2022-10-24 15:48:34 +02:00
replace `hunter2` with your password, or remove the `hunter2` lines if you allow anonymous access
2020-10-25 08:05:11 +01:00
### on windows clients:
```
(
2022-10-24 15:48:34 +02:00
echo [cpp-rw]
echo type = webdav
2023-03-20 21:45:52 +00:00
echo vendor = owncloud
2022-10-24 15:48:34 +02:00
echo url = http://127.0.0.1:3923/
echo headers = Cookie,cppwd=hunter2
2023-04-01 10:21:21 +00:00
echo pacer_min_sleep = 0.01ms
2022-10-24 15:48:34 +02:00
echo(
echo [cpp-ro]
2020-10-25 08:05:11 +01:00
echo type = http
echo url = http://127.0.0.1:3923/
2022-10-24 15:48:34 +02:00
echo headers = Cookie,cppwd=hunter2
2023-04-01 10:21:21 +00:00
echo pacer_min_sleep = 0.01ms
2020-10-25 08:05:11 +01:00
) > %userprofile%\.config\rclone\rclone.conf
```
also install the windows dependencies: [winfsp ](https://github.com/billziss-gh/winfsp/releases/latest )
### on unix clients:
```
cat > ~/.config/rclone/rclone.conf <<'EOF'
2022-10-24 15:48:34 +02:00
[cpp-rw]
type = webdav
2023-03-20 21:45:52 +00:00
vendor = owncloud
2022-10-24 15:48:34 +02:00
url = http://127.0.0.1:3923/
headers = Cookie,cppwd=hunter2
2023-04-01 10:21:21 +00:00
pacer_min_sleep = 0.01ms
2022-10-24 15:48:34 +02:00
[cpp-ro]
2020-10-25 08:05:11 +01:00
type = http
url = http://127.0.0.1:3923/
2022-10-24 15:48:34 +02:00
headers = Cookie,cppwd=hunter2
2023-04-01 10:21:21 +00:00
pacer_min_sleep = 0.01ms
2020-10-25 08:05:11 +01:00
EOF
```
# mounting the copyparty server locally
2022-10-24 15:48:34 +02:00
connect to `cpp-rw:` for read-write, or `cpp-ro:` for read-only (twice as fast):
2020-10-25 08:05:11 +01:00
```
2022-10-24 15:48:34 +02:00
rclone.exe mount --vfs-cache-mode writes --vfs-cache-max-age 5s --attr-timeout 5s --dir-cache-time 5s cpp-rw: W:
2020-10-25 08:05:11 +01:00
```
2023-03-20 21:54:08 +00:00
# sync folders to/from copyparty
2023-05-07 15:35:56 +00:00
note that the up2k client [u2c.py ](https://github.com/9001/copyparty/tree/hovudstraum/bin#u2cpy ) (available on the "connect" page of your copyparty server) does uploads much faster and safer, but rclone is bidirectional and more ubiquitous
2023-03-20 21:54:08 +00:00
```
rclone sync /usr/share/icons/ cpp-rw:fds/
```
2020-10-25 08:05:11 +01:00
# use rclone as server too, replacing copyparty
feels out of place but is too good not to mention
```
rclone.exe serve http --read-only .
2022-10-24 15:48:34 +02:00
rclone.exe serve webdav .
2020-10-25 08:05:11 +01:00
```
2023-03-20 21:45:52 +00:00
# devnotes
copyparty supports and expects [the following ](https://github.com/rclone/rclone/blob/46484022b08f8756050aa45505ea0db23e62df8b/backend/webdav/webdav.go#L575-L578 ) from rclone,
```go
case "owncloud":
f.canStream = true
f.precision = time.Second
f.useOCMtime = true
f.hasOCMD5 = true
f.hasOCSHA1 = true
```
notably,
* `useOCMtime` enables the `x-oc-mtime` header to retain mtime of uploads from rclone
* `canStream` is supported but not required by us
* `hasOCMD5` / `hasOCSHA1` is conveniently dontcare on both ends
there's a scary comment mentioning PROPSET of lastmodified which is not something we wish to support
2023-03-20 21:54:08 +00:00
and if `vendor=owncloud` ever stops working, try `vendor=fastmail` instead