github.com/artpar/rclone@v1.67.3/docs/content/webdav.md (about) 1 --- 2 title: "WebDAV" 3 description: "Rclone docs for WebDAV" 4 versionIntroduced: "v1.39" 5 --- 6 7 # {{< icon "fa fa-globe" >}} WebDAV 8 9 Paths are specified as `remote:path` 10 11 Paths may be as deep as required, e.g. `remote:directory/subdirectory`. 12 13 ## Configuration 14 15 To configure the WebDAV remote you will need to have a URL for it, and 16 a username and password. If you know what kind of system you are 17 connecting to then rclone can enable extra features. 18 19 Here is an example of how to make a remote called `remote`. First run: 20 21 rclone config 22 23 This will guide you through an interactive setup process: 24 25 ``` 26 No remotes found, make a new one? 27 n) New remote 28 s) Set configuration password 29 q) Quit config 30 n/s/q> n 31 name> remote 32 Type of storage to configure. 33 Choose a number from below, or type in your own value 34 [snip] 35 XX / WebDAV 36 \ "webdav" 37 [snip] 38 Storage> webdav 39 URL of http host to connect to 40 Choose a number from below, or type in your own value 41 1 / Connect to example.com 42 \ "https://example.com" 43 url> https://example.com/remote.php/webdav/ 44 Name of the WebDAV site/service/software you are using 45 Choose a number from below, or type in your own value 46 1 / Fastmail Files 47 \ (fastmail) 48 2 / Nextcloud 49 \ (nextcloud) 50 3 / Owncloud 51 \ (owncloud) 52 4 / Sharepoint Online, authenticated by Microsoft account 53 \ (sharepoint) 54 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises 55 \ (sharepoint-ntlm) 56 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol 57 \ (rclone) 58 7 / Other site/service or software 59 \ (other) 60 vendor> 2 61 User name 62 user> user 63 Password. 64 y) Yes type in my own password 65 g) Generate random password 66 n) No leave this optional password blank 67 y/g/n> y 68 Enter the password: 69 password: 70 Confirm the password: 71 password: 72 Bearer token instead of user/pass (e.g. a Macaroon) 73 bearer_token> 74 Remote config 75 -------------------- 76 [remote] 77 type = webdav 78 url = https://example.com/remote.php/webdav/ 79 vendor = nextcloud 80 user = user 81 pass = *** ENCRYPTED *** 82 bearer_token = 83 -------------------- 84 y) Yes this is OK 85 e) Edit this remote 86 d) Delete this remote 87 y/e/d> y 88 ``` 89 90 Once configured you can then use `rclone` like this, 91 92 List directories in top level of your WebDAV 93 94 rclone lsd remote: 95 96 List all the files in your WebDAV 97 98 rclone ls remote: 99 100 To copy a local directory to an WebDAV directory called backup 101 102 rclone copy /home/source remote:backup 103 104 ### Modification times and hashes 105 106 Plain WebDAV does not support modified times. However when used with 107 Fastmail Files, Owncloud or Nextcloud rclone will support modified times. 108 109 Likewise plain WebDAV does not support hashes, however when used with 110 Fastmail Files, Owncloud or Nextcloud rclone will support SHA1 and MD5 hashes. 111 Depending on the exact version of Owncloud or Nextcloud hashes may 112 appear on all objects, or only on objects which had a hash uploaded 113 with them. 114 115 {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/webdav/webdav.go then run make backenddocs" >}} 116 ### Standard options 117 118 Here are the Standard options specific to webdav (WebDAV). 119 120 #### --webdav-url 121 122 URL of http host to connect to. 123 124 E.g. https://example.com. 125 126 Properties: 127 128 - Config: url 129 - Env Var: RCLONE_WEBDAV_URL 130 - Type: string 131 - Required: true 132 133 #### --webdav-vendor 134 135 Name of the WebDAV site/service/software you are using. 136 137 Properties: 138 139 - Config: vendor 140 - Env Var: RCLONE_WEBDAV_VENDOR 141 - Type: string 142 - Required: false 143 - Examples: 144 - "fastmail" 145 - Fastmail Files 146 - "nextcloud" 147 - Nextcloud 148 - "owncloud" 149 - Owncloud 150 - "sharepoint" 151 - Sharepoint Online, authenticated by Microsoft account 152 - "sharepoint-ntlm" 153 - Sharepoint with NTLM authentication, usually self-hosted or on-premises 154 - "rclone" 155 - rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol 156 - "other" 157 - Other site/service or software 158 159 #### --webdav-user 160 161 User name. 162 163 In case NTLM authentication is used, the username should be in the format 'Domain\User'. 164 165 Properties: 166 167 - Config: user 168 - Env Var: RCLONE_WEBDAV_USER 169 - Type: string 170 - Required: false 171 172 #### --webdav-pass 173 174 Password. 175 176 **NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/). 177 178 Properties: 179 180 - Config: pass 181 - Env Var: RCLONE_WEBDAV_PASS 182 - Type: string 183 - Required: false 184 185 #### --webdav-bearer-token 186 187 Bearer token instead of user/pass (e.g. a Macaroon). 188 189 Properties: 190 191 - Config: bearer_token 192 - Env Var: RCLONE_WEBDAV_BEARER_TOKEN 193 - Type: string 194 - Required: false 195 196 ### Advanced options 197 198 Here are the Advanced options specific to webdav (WebDAV). 199 200 #### --webdav-bearer-token-command 201 202 Command to run to get a bearer token. 203 204 Properties: 205 206 - Config: bearer_token_command 207 - Env Var: RCLONE_WEBDAV_BEARER_TOKEN_COMMAND 208 - Type: string 209 - Required: false 210 211 #### --webdav-encoding 212 213 The encoding for the backend. 214 215 See the [encoding section in the overview](/overview/#encoding) for more info. 216 217 Default encoding is Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Hash,Percent,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8 for sharepoint-ntlm or identity otherwise. 218 219 Properties: 220 221 - Config: encoding 222 - Env Var: RCLONE_WEBDAV_ENCODING 223 - Type: string 224 - Required: false 225 226 #### --webdav-headers 227 228 Set HTTP headers for all transactions. 229 230 Use this to set additional HTTP headers for all transactions 231 232 The input format is comma separated list of key,value pairs. Standard 233 [CSV encoding](https://godoc.org/encoding/csv) may be used. 234 235 For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. 236 237 You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'. 238 239 240 Properties: 241 242 - Config: headers 243 - Env Var: RCLONE_WEBDAV_HEADERS 244 - Type: CommaSepList 245 - Default: 246 247 #### --webdav-pacer-min-sleep 248 249 Minimum time to sleep between API calls. 250 251 Properties: 252 253 - Config: pacer_min_sleep 254 - Env Var: RCLONE_WEBDAV_PACER_MIN_SLEEP 255 - Type: Duration 256 - Default: 10ms 257 258 #### --webdav-nextcloud-chunk-size 259 260 Nextcloud upload chunk size. 261 262 We recommend configuring your NextCloud instance to increase the max chunk size to 1 GB for better upload performances. 263 See https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#adjust-chunk-size-on-nextcloud-side 264 265 Set to 0 to disable chunked uploading. 266 267 268 Properties: 269 270 - Config: nextcloud_chunk_size 271 - Env Var: RCLONE_WEBDAV_NEXTCLOUD_CHUNK_SIZE 272 - Type: SizeSuffix 273 - Default: 10Mi 274 275 #### --webdav-owncloud-exclude-shares 276 277 Exclude ownCloud shares 278 279 Properties: 280 281 - Config: owncloud_exclude_shares 282 - Env Var: RCLONE_WEBDAV_OWNCLOUD_EXCLUDE_SHARES 283 - Type: bool 284 - Default: false 285 286 #### --webdav-description 287 288 Description of the remote 289 290 Properties: 291 292 - Config: description 293 - Env Var: RCLONE_WEBDAV_DESCRIPTION 294 - Type: string 295 - Required: false 296 297 {{< rem autogenerated options stop >}} 298 299 ## Provider notes 300 301 See below for notes on specific providers. 302 303 ### Fastmail Files 304 305 Use `https://webdav.fastmail.com/` or a subdirectory as the URL, 306 and your Fastmail email `username@domain.tld` as the username. 307 Follow [this documentation](https://www.fastmail.help/hc/en-us/articles/360058752854-App-passwords) 308 to create an app password with access to `Files (WebDAV)` and use 309 this as the password. 310 311 Fastmail supports modified times using the `X-OC-Mtime` header. 312 313 ### Owncloud 314 315 Click on the settings cog in the bottom right of the page and this 316 will show the WebDAV URL that rclone needs in the config step. It 317 will look something like `https://example.com/remote.php/webdav/`. 318 319 Owncloud supports modified times using the `X-OC-Mtime` header. 320 321 ### Nextcloud 322 323 This is configured in an identical way to Owncloud. Note that 324 Nextcloud initially did not support streaming of files (`rcat`) whereas 325 Owncloud did, but [this](https://github.com/nextcloud/nextcloud-snap/issues/365) seems to be fixed as of 2020-11-27 (tested with rclone v1.53.1 and Nextcloud Server v19). 326 327 ### Sharepoint Online 328 329 Rclone can be used with Sharepoint provided by OneDrive for Business 330 or Office365 Education Accounts. 331 This feature is only needed for a few of these Accounts, 332 mostly Office365 Education ones. These accounts are sometimes not 333 verified by the domain owner [github#1975](https://github.com/artpar/artpar/issues/1975) 334 335 This means that these accounts can't be added using the official 336 API (other Accounts should work with the "onedrive" option). However, 337 it is possible to access them using webdav. 338 339 To use a sharepoint remote with rclone, add it like this: 340 First, you need to get your remote's URL: 341 342 - Go [here](https://onedrive.live.com/about/en-us/signin/) 343 to open your OneDrive or to sign in 344 - Now take a look at your address bar, the URL should look like this: 345 `https://[YOUR-DOMAIN]-my.sharepoint.com/personal/[YOUR-EMAIL]/_layouts/15/onedrive.aspx` 346 347 You'll only need this URL up to the email address. After that, you'll 348 most likely want to add "/Documents". That subdirectory contains 349 the actual data stored on your OneDrive. 350 351 Add the remote to rclone like this: 352 Configure the `url` as `https://[YOUR-DOMAIN]-my.sharepoint.com/personal/[YOUR-EMAIL]/Documents` 353 and use your normal account email and password for `user` and `pass`. 354 If you have 2FA enabled, you have to generate an app password. 355 Set the `vendor` to `sharepoint`. 356 357 Your config file should look like this: 358 359 ``` 360 [sharepoint] 361 type = webdav 362 url = https://[YOUR-DOMAIN]-my.sharepoint.com/personal/[YOUR-EMAIL]/Documents 363 vendor = sharepoint 364 user = YourEmailAddress 365 pass = encryptedpassword 366 ``` 367 368 ### Sharepoint with NTLM Authentication 369 370 Use this option in case your (hosted) Sharepoint is not tied to OneDrive accounts and uses NTLM authentication. 371 372 To get the `url` configuration, similarly to the above, first navigate to the desired directory in your browser to get the URL, 373 then strip everything after the name of the opened directory. 374 375 Example: 376 If the URL is: 377 https://example.sharepoint.com/sites/12345/Documents/Forms/AllItems.aspx 378 379 The configuration to use would be: 380 https://example.sharepoint.com/sites/12345/Documents 381 382 Set the `vendor` to `sharepoint-ntlm`. 383 384 NTLM uses domain and user name combination for authentication, 385 set `user` to `DOMAIN\username`. 386 387 Your config file should look like this: 388 389 ``` 390 [sharepoint] 391 type = webdav 392 url = https://[YOUR-DOMAIN]/some-path-to/Documents 393 vendor = sharepoint-ntlm 394 user = DOMAIN\user 395 pass = encryptedpassword 396 ``` 397 398 #### Required Flags for SharePoint 399 400 As SharePoint does some special things with uploaded documents, you won't be able to use the documents size or the documents hash to compare if a file has been changed since the upload / which file is newer. 401 402 For Rclone calls copying files (especially Office files such as .docx, .xlsx, etc.) from/to SharePoint (like copy, sync, etc.), you should append these flags to ensure Rclone uses the "Last Modified" datetime property to compare your documents: 403 404 ``` 405 --ignore-size --ignore-checksum --update 406 ``` 407 408 ## Rclone 409 410 Use this option if you are hosting remotes over WebDAV provided by rclone. 411 Read [rclone serve webdav](commands/rclone_serve_webdav/) for more details. 412 413 rclone serve supports modified times using the `X-OC-Mtime` header. 414 415 416 ### dCache 417 418 dCache is a storage system that supports many protocols and 419 authentication/authorisation schemes. For WebDAV clients, it allows 420 users to authenticate with username and password (BASIC), X.509, 421 Kerberos, and various bearer tokens, including 422 [Macaroons](https://www.dcache.org/manuals/workshop-2017-05-29-Umea/000-Final/anupam_macaroons_v02.pdf) 423 and [OpenID-Connect](https://en.wikipedia.org/wiki/OpenID_Connect) 424 access tokens. 425 426 Configure as normal using the `other` type. Don't enter a username or 427 password, instead enter your Macaroon as the `bearer_token`. 428 429 The config will end up looking something like this. 430 431 ``` 432 [dcache] 433 type = webdav 434 url = https://dcache... 435 vendor = other 436 user = 437 pass = 438 bearer_token = your-macaroon 439 ``` 440 441 There is a [script](https://github.com/sara-nl/GridScripts/blob/master/get-macaroon) that 442 obtains a Macaroon from a dCache WebDAV endpoint, and creates an rclone config file. 443 444 Macaroons may also be obtained from the dCacheView 445 web-browser/JavaScript client that comes with dCache. 446 447 ### OpenID-Connect 448 449 dCache also supports authenticating with OpenID-Connect access tokens. 450 OpenID-Connect is a protocol (based on OAuth 2.0) that allows services 451 to identify users who have authenticated with some central service. 452 453 Support for OpenID-Connect in rclone is currently achieved using 454 another software package called 455 [oidc-agent](https://github.com/indigo-dc/oidc-agent). This is a 456 command-line tool that facilitates obtaining an access token. Once 457 installed and configured, an access token is obtained by running the 458 `oidc-token` command. The following example shows a (shortened) 459 access token obtained from the *XDC* OIDC Provider. 460 461 ``` 462 paul@celebrimbor:~$ oidc-token XDC 463 eyJraWQ[...]QFXDt0 464 paul@celebrimbor:~$ 465 ``` 466 467 **Note** Before the `oidc-token` command will work, the refresh token 468 must be loaded into the oidc agent. This is done with the `oidc-add` 469 command (e.g., `oidc-add XDC`). This is typically done once per login 470 session. Full details on this and how to register oidc-agent with 471 your OIDC Provider are provided in the [oidc-agent 472 documentation](https://indigo-dc.gitbooks.io/oidc-agent/). 473 474 The rclone `bearer_token_command` configuration option is used to 475 fetch the access token from oidc-agent. 476 477 Configure as a normal WebDAV endpoint, using the 'other' vendor, 478 leaving the username and password empty. When prompted, choose to 479 edit the advanced config and enter the command to get a bearer token 480 (e.g., `oidc-agent XDC`). 481 482 The following example config shows a WebDAV endpoint that uses 483 oidc-agent to supply an access token from the *XDC* OIDC Provider. 484 485 ``` 486 [dcache] 487 type = webdav 488 url = https://dcache.example.org/ 489 vendor = other 490 bearer_token_command = oidc-token XDC 491 ```