github.com/ncw/rclone@v1.48.1-0.20190724201158-a35aa1360e3e/docs/content/webdav.md (about)

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