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

onedrive: fix the configurator to allow /teams/ID in the config

Nick Craig-Wood50b4a2398e9e
diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go
index d6e179394..e793f0111 100644
--- a/backend/onedrive/onedrive.go
+++ b/backend/onedrive/onedrive.go
@@ -572,15 +572,18 @@ func Config(ctx context.Context, name string, m configmap.Mapper, config fs.Conf
case "url":
return fs.ConfigInput("url_end", "config_site_url", `Site URL
-Example: "https://contoso.sharepoint.com/sites/mysite" or "mysite"
+Examples:
+- "mysite"
+- "https://XXX.sharepoint.com/sites/mysite"
+- "https://XXX.sharepoint.com/teams/ID"
`)
case "url_end":
siteURL := config.Result
- re := regexp.MustCompile(`https://.*\.sharepoint\.com/sites/(.*)`)
+ re := regexp.MustCompile(`https://.*\.sharepoint\.com(/.*)`)
match := re.FindStringSubmatch(siteURL)
if len(match) == 2 {
return chooseDrive(ctx, name, m, srv, chooseDriveOpt{
- relativePath: "/sites/" + match[1],
+ relativePath: match[1],
})
}
return chooseDrive(ctx, name, m, srv, chooseDriveOpt{