Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

webdav: added an rclone vendor to work with rclone serve webdav

Adithya Kumarad83ff769b03
diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go
index 801e8d970..e8f83f66a 100644
--- a/backend/webdav/webdav.go
+++ b/backend/webdav/webdav.go
@@ -91,6 +91,9 @@ func init() {
}, {
Value: "sharepoint-ntlm",
Help: "Sharepoint with NTLM authentication, usually self-hosted or on-premises",
+ }, {
+ Value: "rclone",
+ Help: "rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol",
}, {
Value: "other",
Help: "Other site/service or software",
@@ -644,6 +647,10 @@ func (f *Fs) setQuirks(ctx context.Context, vendor string) error {
// so we must perform an extra check to detect this
// condition and return a proper error code.
f.checkBeforePurge = true
+ case "rclone":
+ f.canStream = true
+ f.precision = time.Second
+ f.useOCMtime = true
case "other":
default:
fs.Debugf(f, "Unknown vendor %q", vendor)
diff --git a/cmd/serve/webdav/webdav_test.go b/cmd/serve/webdav/webdav_test.go
index 331c0a55e..6734d6f6e 100644
--- a/cmd/serve/webdav/webdav_test.go
+++ b/cmd/serve/webdav/webdav_test.go
@@ -65,7 +65,7 @@ func TestWebDav(t *testing.T) {
// Config for the backend we'll use to connect to the server
config := configmap.Simple{
"type": "webdav",
- "vendor": "owncloud",
+ "vendor": "rclone",
"url": w.Server.URLs()[0],
"user": testUser,
"pass": obscure.MustObscure(testPass),
diff --git a/docs/content/webdav.md b/docs/content/webdav.md
index 30042e0e2..bbbb20527 100644
--- a/docs/content/webdav.md
+++ b/docs/content/webdav.md
@@ -53,7 +53,9 @@ Choose a number from below, or type in your own value
\ (sharepoint)
5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
\ (sharepoint-ntlm)
- 6 / Other site/service or software
+ 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
+ \ (rclone)
+ 7 / Other site/service or software
\ (other)
vendor> 2
User name
@@ -149,6 +151,8 @@ Properties:
- Sharepoint Online, authenticated by Microsoft account
- "sharepoint-ntlm"
- Sharepoint with NTLM authentication, usually self-hosted or on-premises
+ - "rclone",
+ - rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol,
- "other"
- Other site/service or software
@@ -379,6 +383,14 @@ For Rclone calls copying files (especially Office files such as .docx, .xlsx, et
--ignore-size --ignore-checksum --update
```
+## Rclone
+
+Use this option if you are hosting remotes over WebDAV provided by rclone.
+Read [rclone serve webdav](commands/rclone_serve_webdav/) for more details.
+
+rclone serve supports modified times using the `X-OC-Mtime` header.
+
+
### dCache
dCache is a storage system that supports many protocols and
diff --git a/fstest/testserver/init.d/TestWebdavRclone b/fstest/testserver/init.d/TestWebdavRclone
index fb6b617d9..b0716dc7b 100755
--- a/fstest/testserver/init.d/TestWebdavRclone
+++ b/fstest/testserver/init.d/TestWebdavRclone
@@ -12,6 +12,7 @@ start() {
run rclone serve webdav --user $USER --pass $PASS --addr ${IP}:${PORT} ${DATADIR}
echo type=webdav
+ echo vendor=rclone
echo url=http://${IP}:${PORT}/
echo user=$USER
echo pass=$(rclone obscure $PASS)