# fusedav
Author: retoor <retoor@molodetz.nl>
WebDAV filesystem client for Linux using FUSE3. Mounts remote WebDAV servers as local directories.
## Architecture
```
+------------------+ +----------------+ +------------------+
| Local Apps | | FUSE Layer | | WebDAV Server |
| (ls, cp, vim) | --> | (libfuse3) | --> | (Nextcloud, |
| | | | | Apache, etc) |
+------------------+ +----------------+ +------------------+
|
+-----+-----+
| |
+--------+ +---------+
| Cache | | libcurl |
+--------+ +---------+
```
## Features
- RFC 4918 WebDAV protocol support
- FUSE3 filesystem interface
- Metadata and directory caching with configurable TTL
- HTTP Basic authentication
- HTTPS with certificate verification
- Range requests for partial file reads
- Thread-safe operations
## Dependencies
- libfuse3 (FUSE filesystem library)
- libcurl (HTTP client with HTTPS support)
- libxml2 (XML parsing for WebDAV responses)
- pthread (POSIX threads)
### Installation
Debian/Ubuntu:
```
sudo apt install libfuse3-dev libcurl4-openssl-dev libxml2-dev build-essential pkg-config
```
Fedora/RHEL:
```
sudo dnf install fuse3-devel libcurl-devel libxml2-devel gcc make pkg-config
```
Arch Linux:
```
sudo pacman -S fuse3 curl libxml2 base-devel pkg-config
```
## Build
```
make
```
## Usage
```
./fusedav --url https://example.com/dav/ --mount-point /mnt/webdav
```
### Options
| Option | Description |
|--------|-------------|
| `-u, --url URL` | WebDAV server URL (required) |
| `-m, --mount-point PATH` | Local mount point directory (required) |
| `-U, --username USER` | HTTP Basic auth username |
| `-p, --password PASS` | HTTP Basic auth password |
| `-c, --cache-ttl MS` | Cache TTL in milliseconds (default: 30000) |
| `-t, --timeout SEC` | Request timeout in seconds (default: 10) |
| `-f, --foreground` | Run in foreground |
| `-d, --debug` | Enable debug output |
| `-h, --help` | Show help |
### Examples
Mount with authentication:
```
./fusedav --url https://cloud.example.com/remote.php/dav/files/user/ \
--username user \
--password secret \
--mount-point /mnt/cloud
```
Mount with custom cache settings:
```
./fusedav --url https://webdav.example.com/ \
--mount-point /mnt/dav \
--cache-ttl 60000 \
--timeout 30
```
Debug mode:
```
./fusedav --url https://example.com/dav/ \
--mount-point /mnt/dav \
--debug
```
## Unmounting
```
fusermount -u /mnt/webdav
```
Or if mounted as root:
```
sudo umount /mnt/webdav
```
## Limitations
- No WebDAV Class 2 locking (concurrent writes may conflict)
- No symlink or extended attribute support
- Authentication credentials visible in process list
- Sequential write assumption (random writes fetch entire file first)
## Security Notes
- Credentials passed via command line are visible in `ps` output
- Consider using environment variables for sensitive data
- SSL certificate verification is enabled by default
- Input paths are validated to prevent directory traversal
## Error Codes
| HTTP Status | POSIX Error |
|-------------|-------------|
| 404 Not Found | ENOENT |
| 403 Forbidden | EACCES |
| 401 Unauthorized | EACCES |
| 405 Method Not Allowed | ENOTSUP |
| 409 Conflict | EEXIST |
| 507 Insufficient Storage | ENOSPC |
| 5xx Server Error | EIO |
## License
MIT