github.com/ncw/rclone@v1.48.1-0.20190724201158-a35aa1360e3e/docs/content/commands/rclone_serve_webdav.md (about) 1 --- 2 date: 2019-06-20T16:09:42+01:00 3 title: "rclone serve webdav" 4 slug: rclone_serve_webdav 5 url: /commands/rclone_serve_webdav/ 6 --- 7 ## rclone serve webdav 8 9 Serve remote:path over webdav. 10 11 ### Synopsis 12 13 14 rclone serve webdav implements a basic webdav server to serve the 15 remote over HTTP via the webdav protocol. This can be viewed with a 16 webdav client, through a web browser, or you can make a remote of 17 type webdav to read and write it. 18 19 ### Webdav options 20 21 #### --etag-hash 22 23 This controls the ETag header. Without this flag the ETag will be 24 based on the ModTime and Size of the object. 25 26 If this flag is set to "auto" then rclone will choose the first 27 supported hash on the backend or you can use a named hash such as 28 "MD5" or "SHA-1". 29 30 Use "rclone hashsum" to see the full list. 31 32 33 ### Server options 34 35 Use --addr to specify which IP address and port the server should 36 listen on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all 37 IPs. By default it only listens on localhost. You can use port 38 :0 to let the OS choose an available port. 39 40 If you set --addr to listen on a public or LAN accessible IP address 41 then using Authentication is advised - see the next section for info. 42 43 --server-read-timeout and --server-write-timeout can be used to 44 control the timeouts on the server. Note that this is the total time 45 for a transfer. 46 47 --max-header-bytes controls the maximum number of bytes the server will 48 accept in the HTTP header. 49 50 #### Authentication 51 52 By default this will serve files without needing a login. 53 54 You can either use an htpasswd file which can take lots of users, or 55 set a single username and password with the --user and --pass flags. 56 57 Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is 58 in standard apache format and supports MD5, SHA1 and BCrypt for basic 59 authentication. Bcrypt is recommended. 60 61 To create an htpasswd file: 62 63 touch htpasswd 64 htpasswd -B htpasswd user 65 htpasswd -B htpasswd anotherUser 66 67 The password file can be updated while rclone is running. 68 69 Use --realm to set the authentication realm. 70 71 #### SSL/TLS 72 73 By default this will serve over http. If you want you can serve over 74 https. You will need to supply the --cert and --key flags. If you 75 wish to do client side certificate validation then you will need to 76 supply --client-ca also. 77 78 --cert should be a either a PEM encoded certificate or a concatenation 79 of that with the CA certificate. --key should be the PEM encoded 80 private key and --client-ca should be the PEM encoded client 81 certificate authority certificate. 82 83 ### Directory Cache 84 85 Using the `--dir-cache-time` flag, you can set how long a 86 directory should be considered up to date and not refreshed from the 87 backend. Changes made locally in the mount may appear immediately or 88 invalidate the cache. However, changes done on the remote will only 89 be picked up once the cache expires. 90 91 Alternatively, you can send a `SIGHUP` signal to rclone for 92 it to flush all directory caches, regardless of how old they are. 93 Assuming only one rclone instance is running, you can reset the cache 94 like this: 95 96 kill -SIGHUP $(pidof rclone) 97 98 If you configure rclone with a [remote control](/rc) then you can use 99 rclone rc to flush the whole directory cache: 100 101 rclone rc vfs/forget 102 103 Or individual files or directories: 104 105 rclone rc vfs/forget file=path/to/file dir=path/to/dir 106 107 ### File Buffering 108 109 The `--buffer-size` flag determines the amount of memory, 110 that will be used to buffer data in advance. 111 112 Each open file descriptor will try to keep the specified amount of 113 data in memory at all times. The buffered data is bound to one file 114 descriptor and won't be shared between multiple open file descriptors 115 of the same file. 116 117 This flag is a upper limit for the used memory per file descriptor. 118 The buffer will only use memory for data that is downloaded but not 119 not yet read. If the buffer is empty, only a small amount of memory 120 will be used. 121 The maximum memory used by rclone for buffering can be up to 122 `--buffer-size * open files`. 123 124 ### File Caching 125 126 These flags control the VFS file caching options. The VFS layer is 127 used by rclone mount to make a cloud storage system work more like a 128 normal file system. 129 130 You'll need to enable VFS caching if you want, for example, to read 131 and write simultaneously to a file. See below for more details. 132 133 Note that the VFS cache works in addition to the cache backend and you 134 may find that you need one or the other or both. 135 136 --cache-dir string Directory rclone will use for caching. 137 --vfs-cache-max-age duration Max age of objects in the cache. (default 1h0m0s) 138 --vfs-cache-mode string Cache mode off|minimal|writes|full (default "off") 139 --vfs-cache-poll-interval duration Interval to poll the cache for stale objects. (default 1m0s) 140 --vfs-cache-max-size int Max total size of objects in the cache. (default off) 141 142 If run with `-vv` rclone will print the location of the file cache. The 143 files are stored in the user cache file area which is OS dependent but 144 can be controlled with `--cache-dir` or setting the appropriate 145 environment variable. 146 147 The cache has 4 different modes selected by `--vfs-cache-mode`. 148 The higher the cache mode the more compatible rclone becomes at the 149 cost of using disk space. 150 151 Note that files are written back to the remote only when they are 152 closed so if rclone is quit or dies with open files then these won't 153 get written back to the remote. However they will still be in the on 154 disk cache. 155 156 If using --vfs-cache-max-size note that the cache may exceed this size 157 for two reasons. Firstly because it is only checked every 158 --vfs-cache-poll-interval. Secondly because open files cannot be 159 evicted from the cache. 160 161 #### --vfs-cache-mode off 162 163 In this mode the cache will read directly from the remote and write 164 directly to the remote without caching anything on disk. 165 166 This will mean some operations are not possible 167 168 * Files can't be opened for both read AND write 169 * Files opened for write can't be seeked 170 * Existing files opened for write must have O_TRUNC set 171 * Files open for read with O_TRUNC will be opened write only 172 * Files open for write only will behave as if O_TRUNC was supplied 173 * Open modes O_APPEND, O_TRUNC are ignored 174 * If an upload fails it can't be retried 175 176 #### --vfs-cache-mode minimal 177 178 This is very similar to "off" except that files opened for read AND 179 write will be buffered to disks. This means that files opened for 180 write will be a lot more compatible, but uses the minimal disk space. 181 182 These operations are not possible 183 184 * Files opened for write only can't be seeked 185 * Existing files opened for write must have O_TRUNC set 186 * Files opened for write only will ignore O_APPEND, O_TRUNC 187 * If an upload fails it can't be retried 188 189 #### --vfs-cache-mode writes 190 191 In this mode files opened for read only are still read directly from 192 the remote, write only and read/write files are buffered to disk 193 first. 194 195 This mode should support all normal file system operations. 196 197 If an upload fails it will be retried up to --low-level-retries times. 198 199 #### --vfs-cache-mode full 200 201 In this mode all reads and writes are buffered to and from disk. When 202 a file is opened for read it will be downloaded in its entirety first. 203 204 This may be appropriate for your needs, or you may prefer to look at 205 the cache backend which does a much more sophisticated job of caching, 206 including caching directory hierarchies and chunks of files. 207 208 In this mode, unlike the others, when a file is written to the disk, 209 it will be kept on the disk after it is written to the remote. It 210 will be purged on a schedule according to `--vfs-cache-max-age`. 211 212 This mode should support all normal file system operations. 213 214 If an upload or download fails it will be retried up to 215 --low-level-retries times. 216 217 218 ``` 219 rclone serve webdav remote:path [flags] 220 ``` 221 222 ### Options 223 224 ``` 225 --addr string IPaddress:Port or :Port to bind server to. (default "localhost:8080") 226 --cert string SSL PEM key (concatenation of certificate and CA certificate) 227 --client-ca string Client certificate authority to verify clients with 228 --dir-cache-time duration Time to cache directory entries for. (default 5m0s) 229 --dir-perms FileMode Directory permissions (default 0777) 230 --disable-dir-list Disable HTML directory list on GET request for a directory 231 --etag-hash string Which hash to use for the ETag, or auto or blank for off 232 --file-perms FileMode File permissions (default 0666) 233 --gid uint32 Override the gid field set by the filesystem. (default 1000) 234 -h, --help help for webdav 235 --htpasswd string htpasswd file - if not provided no authentication is done 236 --key string SSL PEM Private key 237 --max-header-bytes int Maximum size of request header (default 4096) 238 --no-checksum Don't compare checksums on up/download. 239 --no-modtime Don't read/write the modification time (can speed things up). 240 --no-seek Don't allow seeking in files. 241 --pass string Password for authentication. 242 --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable. (default 1m0s) 243 --read-only Mount read-only. 244 --realm string realm for authentication (default "rclone") 245 --server-read-timeout duration Timeout for server reading data (default 1h0m0s) 246 --server-write-timeout duration Timeout for server writing data (default 1h0m0s) 247 --uid uint32 Override the uid field set by the filesystem. (default 1000) 248 --umask int Override the permission bits set by the filesystem. (default 2) 249 --user string User name for authentication. 250 --vfs-cache-max-age duration Max age of objects in the cache. (default 1h0m0s) 251 --vfs-cache-max-size SizeSuffix Max total size of objects in the cache. (default off) 252 --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) 253 --vfs-cache-poll-interval duration Interval to poll the cache for stale objects. (default 1m0s) 254 --vfs-read-chunk-size SizeSuffix Read the source objects in chunks. (default 128M) 255 --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached. 'off' is unlimited. (default off) 256 ``` 257 258 See the [global flags page](/flags/) for global options not listed here. 259 260 ### SEE ALSO 261 262 * [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. 263