github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/docs/content/webdav.md (about)

     1  ---
     2  title: "WebDAV"
     3  description: "Rclone docs for WebDAV"
     4  ---
     5  
     6  {{< icon "fa fa-globe" >}} WebDAV
     7  -----------------------------------------
     8  
     9  Paths are specified as `remote:path`
    10  
    11  Paths may be as deep as required, eg `remote:directory/subdirectory`.
    12  
    13  To configure the WebDAV remote you will need to have a URL for it, and
    14  a username and password.  If you know what kind of system you are
    15  connecting to then rclone can enable extra features.
    16  
    17  Here is an example of how to make a remote called `remote`.  First run:
    18  
    19       rclone config
    20  
    21  This will guide you through an interactive setup process:
    22  
    23  ```
    24  No remotes found - make a new one
    25  n) New remote
    26  s) Set configuration password
    27  q) Quit config
    28  n/s/q> n
    29  name> remote
    30  Type of storage to configure.
    31  Choose a number from below, or type in your own value
    32  [snip]
    33  XX / Webdav
    34     \ "webdav"
    35  [snip]
    36  Storage> webdav
    37  URL of http host to connect to
    38  Choose a number from below, or type in your own value
    39   1 / Connect to example.com
    40     \ "https://example.com"
    41  url> https://example.com/remote.php/webdav/
    42  Name of the Webdav site/service/software you are using
    43  Choose a number from below, or type in your own value
    44   1 / Nextcloud
    45     \ "nextcloud"
    46   2 / Owncloud
    47     \ "owncloud"
    48   3 / Sharepoint
    49     \ "sharepoint"
    50   4 / Other site/service or software
    51     \ "other"
    52  vendor> 1
    53  User name
    54  user> user
    55  Password.
    56  y) Yes type in my own password
    57  g) Generate random password
    58  n) No leave this optional password blank
    59  y/g/n> y
    60  Enter the password:
    61  password:
    62  Confirm the password:
    63  password:
    64  Bearer token instead of user/pass (eg a Macaroon)
    65  bearer_token>
    66  Remote config
    67  --------------------
    68  [remote]
    69  type = webdav
    70  url = https://example.com/remote.php/webdav/
    71  vendor = nextcloud
    72  user = user
    73  pass = *** ENCRYPTED ***
    74  bearer_token =
    75  --------------------
    76  y) Yes this is OK
    77  e) Edit this remote
    78  d) Delete this remote
    79  y/e/d> y
    80  ```
    81  
    82  Once configured you can then use `rclone` like this,
    83  
    84  List directories in top level of your WebDAV
    85  
    86      rclone lsd remote:
    87  
    88  List all the files in your WebDAV
    89  
    90      rclone ls remote:
    91  
    92  To copy a local directory to an WebDAV directory called backup
    93  
    94      rclone copy /home/source remote:backup
    95  
    96  ### Modified time and hashes ###
    97  
    98  Plain WebDAV does not support modified times.  However when used with
    99  Owncloud or Nextcloud rclone will support modified times.
   100  
   101  Likewise plain WebDAV does not support hashes, however when used with
   102  Owncloud or Nextcloud rclone will support SHA1 and MD5 hashes.
   103  Depending on the exact version of Owncloud or Nextcloud hashes may
   104  appear on all objects, or only on objects which had a hash uploaded
   105  with them.
   106  
   107  {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/webdav/webdav.go then run make backenddocs" >}}
   108  ### Standard Options
   109  
   110  Here are the standard options specific to webdav (Webdav).
   111  
   112  #### --webdav-url
   113  
   114  URL of http host to connect to
   115  
   116  - Config:      url
   117  - Env Var:     RCLONE_WEBDAV_URL
   118  - Type:        string
   119  - Default:     ""
   120  - Examples:
   121      - "https://example.com"
   122          - Connect to example.com
   123  
   124  #### --webdav-vendor
   125  
   126  Name of the Webdav site/service/software you are using
   127  
   128  - Config:      vendor
   129  - Env Var:     RCLONE_WEBDAV_VENDOR
   130  - Type:        string
   131  - Default:     ""
   132  - Examples:
   133      - "nextcloud"
   134          - Nextcloud
   135      - "owncloud"
   136          - Owncloud
   137      - "sharepoint"
   138          - Sharepoint
   139      - "other"
   140          - Other site/service or software
   141  
   142  #### --webdav-user
   143  
   144  User name
   145  
   146  - Config:      user
   147  - Env Var:     RCLONE_WEBDAV_USER
   148  - Type:        string
   149  - Default:     ""
   150  
   151  #### --webdav-pass
   152  
   153  Password.
   154  
   155  **NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/).
   156  
   157  - Config:      pass
   158  - Env Var:     RCLONE_WEBDAV_PASS
   159  - Type:        string
   160  - Default:     ""
   161  
   162  #### --webdav-bearer-token
   163  
   164  Bearer token instead of user/pass (eg a Macaroon)
   165  
   166  - Config:      bearer_token
   167  - Env Var:     RCLONE_WEBDAV_BEARER_TOKEN
   168  - Type:        string
   169  - Default:     ""
   170  
   171  ### Advanced Options
   172  
   173  Here are the advanced options specific to webdav (Webdav).
   174  
   175  #### --webdav-bearer-token-command
   176  
   177  Command to run to get a bearer token
   178  
   179  - Config:      bearer_token_command
   180  - Env Var:     RCLONE_WEBDAV_BEARER_TOKEN_COMMAND
   181  - Type:        string
   182  - Default:     ""
   183  
   184  {{< rem autogenerated options stop >}}
   185  
   186  ## Provider notes ##
   187  
   188  See below for notes on specific providers.
   189  
   190  ### Owncloud ###
   191  
   192  Click on the settings cog in the bottom right of the page and this
   193  will show the WebDAV URL that rclone needs in the config step.  It
   194  will look something like `https://example.com/remote.php/webdav/`.
   195  
   196  Owncloud supports modified times using the `X-OC-Mtime` header.
   197  
   198  ### Nextcloud ###
   199  
   200  This is configured in an identical way to Owncloud.  Note that
   201  Nextcloud does not support streaming of files (`rcat`) whereas
   202  Owncloud does. This [may be
   203  fixed](https://github.com/nextcloud/nextcloud-snap/issues/365) in the
   204  future.
   205  
   206  ### Sharepoint ###
   207  
   208  Rclone can be used with Sharepoint provided by OneDrive for Business
   209  or Office365 Education Accounts.
   210  This feature is only needed for a few of these Accounts,
   211  mostly Office365 Education ones. These accounts are sometimes not
   212  verified by the domain owner [github#1975](https://github.com/rclone/rclone/issues/1975)
   213  
   214  This means that these accounts can't be added using the official
   215  API (other Accounts should work with the "onedrive" option). However,
   216  it is possible to access them using webdav.
   217  
   218  To use a sharepoint remote with rclone, add it like this:
   219  First, you need to get your remote's URL:
   220  
   221  - Go [here](https://onedrive.live.com/about/en-us/signin/)
   222    to open your OneDrive or to sign in
   223  - Now take a look at your address bar, the URL should look like this:
   224    `https://[YOUR-DOMAIN]-my.sharepoint.com/personal/[YOUR-EMAIL]/_layouts/15/onedrive.aspx`
   225  
   226  You'll only need this URL up to the email address. After that, you'll
   227  most likely want to add "/Documents". That subdirectory contains
   228  the actual data stored on your OneDrive.
   229  
   230  Add the remote to rclone like this:
   231  Configure the `url` as `https://[YOUR-DOMAIN]-my.sharepoint.com/personal/[YOUR-EMAIL]/Documents`
   232  and use your normal account email and password for `user` and `pass`.
   233  If you have 2FA enabled, you have to generate an app password.
   234  Set the `vendor` to `sharepoint`.
   235  
   236  Your config file should look like this:
   237  
   238  ```
   239  [sharepoint]
   240  type = webdav
   241  url = https://[YOUR-DOMAIN]-my.sharepoint.com/personal/[YOUR-EMAIL]/Documents
   242  vendor = other
   243  user = YourEmailAddress
   244  pass = encryptedpassword
   245  ```
   246  
   247  #### Required Flags for SharePoint ####
   248  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.
   249  
   250  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:
   251  
   252  ```
   253  --ignore-size --ignore-checksum --update
   254  ```
   255  
   256  ### dCache ###
   257  
   258  dCache is a storage system that supports many protocols and
   259  authentication/authorisation schemes.  For WebDAV clients, it allows
   260  users to authenticate with username and password (BASIC), X.509,
   261  Kerberos, and various bearer tokens, including
   262  [Macaroons](https://www.dcache.org/manuals/workshop-2017-05-29-Umea/000-Final/anupam_macaroons_v02.pdf)
   263  and [OpenID-Connect](https://en.wikipedia.org/wiki/OpenID_Connect)
   264  access tokens.
   265  
   266  Configure as normal using the `other` type.  Don't enter a username or
   267  password, instead enter your Macaroon as the `bearer_token`.
   268  
   269  The config will end up looking something like this.
   270  
   271  ```
   272  [dcache]
   273  type = webdav
   274  url = https://dcache...
   275  vendor = other
   276  user =
   277  pass =
   278  bearer_token = your-macaroon
   279  ```
   280  
   281  There is a [script](https://github.com/sara-nl/GridScripts/blob/master/get-macaroon) that
   282  obtains a Macaroon from a dCache WebDAV endpoint, and creates an rclone config file.
   283  
   284  Macaroons may also be obtained from the dCacheView
   285  web-browser/JavaScript client that comes with dCache.
   286  
   287  ### OpenID-Connect ###
   288  
   289  dCache also supports authenticating with OpenID-Connect access tokens.
   290  OpenID-Connect is a protocol (based on OAuth 2.0) that allows services
   291  to identify users who have authenticated with some central service.
   292  
   293  Support for OpenID-Connect in rclone is currently achieved using
   294  another software package called
   295  [oidc-agent](https://github.com/indigo-dc/oidc-agent).  This is a
   296  command-line tool that facilitates obtaining an access token.  Once
   297  installed and configured, an access token is obtained by running the
   298  `oidc-token` command.  The following example shows a (shortened)
   299  access token obtained from the *XDC* OIDC Provider.
   300  
   301  ```
   302  paul@celebrimbor:~$ oidc-token XDC
   303  eyJraWQ[...]QFXDt0
   304  paul@celebrimbor:~$
   305  ```
   306  
   307  **Note** Before the `oidc-token` command will work, the refresh token
   308  must be loaded into the oidc agent.  This is done with the `oidc-add`
   309  command (e.g., `oidc-add XDC`).  This is typically done once per login
   310  session.  Full details on this and how to register oidc-agent with
   311  your OIDC Provider are provided in the [oidc-agent
   312  documentation](https://indigo-dc.gitbooks.io/oidc-agent/).
   313  
   314  The rclone `bearer_token_command` configuration option is used to
   315  fetch the access token from oidc-agent.
   316  
   317  Configure as a normal WebDAV endpoint, using the 'other' vendor,
   318  leaving the username and password empty.  When prompted, choose to
   319  edit the advanced config and enter the command to get a bearer token
   320  (e.g., `oidc-agent XDC`).
   321  
   322  The following example config shows a WebDAV endpoint that uses
   323  oidc-agent to supply an access token from the *XDC* OIDC Provider.
   324  
   325  ```
   326  [dcache]
   327  type = webdav
   328  url = https://dcache.example.org/
   329  vendor = other
   330  bearer_token_command = oidc-token XDC
   331  ```