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

Fixes #7160
This commit is contained in:
Adithya Kumar 2023-11-05 12:37:25 +00:00 committed by GitHub
parent ca14b00b34
commit ad83ff769b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 2 deletions

View File

@ -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)

View File

@ -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),

View File

@ -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

View File

@ -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)