mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-27 08:38:58 +00:00
d74e6eb042
* refactor(targets): move notify net helpers from utils * refactor(tls): centralize runtime foundation * refactor(targets): move notify net helpers from utils * refactor(tls): centralize runtime foundation * feat(tls-runtime): add TLS debug state and admin handler * refactor(tls-runtime): unify TLS debug consumer status view * fix(tls): address PR3065 review feedback * refactor(tls): align debug status payload types * refactor(targets): harden TLS hot reload paths * fix(targets): resolve review-4348251652 findings * fix(targets): finalize tls runtime review follow-ups * fix(targets): harden tls reload and review follow-ups * fix(targets): align tls reload handling across targets * fix(targets): finalize tls reload state and metrics updates * chore(deps): trim unused TLS deps * style(targets): normalize TLS reload formatting * refactor(targets): introduce tls runtime adapter path * chore: update workspace manifests for tls refactor * fix(tls): stabilize material reload and audit workflow * fix(targets): refresh tls fingerprint flow across sinks * fix(tls): align runtime coordinator and http reader updates * fix(sftp): simplify protocol error mapping * fix(tls): harmonize material loading behavior * fix(server): finalize tls material wiring in startup flow * fix(protos): tighten tls generation cache and deps
WebDAV Protocol Gateway for RustFS
WebDAV (Web Distributed Authoring and Versioning) protocol implementation for RustFS, providing HTTP-based file access compatible with native OS file managers and WebDAV clients.
Features
- HTTP/HTTPS WebDAV server with Basic authentication
- Full CRUD operations mapping to S3 storage backend
- Directory (bucket/prefix) creation and deletion
- File upload, download, and deletion
- Property queries (PROPFIND) for metadata
- TLS support with multi-certificate SNI
- Integration with RustFS IAM for access control
Supported WebDAV Methods
| Method | Description | S3 Operation |
|---|---|---|
PROPFIND |
List directory / Get metadata | ListObjects / HeadObject |
MKCOL |
Create directory | CreateBucket / PutObject (prefix) |
PUT |
Upload file | PutObject |
GET |
Download file | GetObject |
DELETE |
Delete file/directory | DeleteObject / DeleteBucket |
HEAD |
Get file metadata | HeadObject |
Not Yet Implemented
| Method | Description | Status |
|---|---|---|
MOVE |
Move/rename file | Returns 501 Not Implemented |
COPY |
Copy file | Returns 501 Not Implemented |
Enable Feature
WebDAV is opt-in and must be explicitly enabled.
Build with WebDAV support:
cargo build --features webdav
Or enable all protocol features:
cargo build --features full
Configuration
Configure WebDAV via environment variables:
| Variable | Description | Default |
|---|---|---|
RUSTFS_WEBDAV_ENABLE |
Enable WebDAV server | false |
RUSTFS_WEBDAV_ADDRESS |
Server bind address | 0.0.0.0:8080 |
RUSTFS_WEBDAV_TLS_ENABLED |
Enable TLS | true |
RUSTFS_WEBDAV_CERTS_DIR |
TLS certificate directory | - |
RUSTFS_WEBDAV_CA_FILE |
CA file for client verification | - |
RUSTFS_WEBDAV_MAX_BODY_SIZE |
Max upload size (bytes) | 5GB |
RUSTFS_WEBDAV_REQUEST_TIMEOUT |
Request timeout (seconds) | 300 |
Quick Start
Start Server
RUSTFS_WEBDAV_ENABLE=true \
RUSTFS_WEBDAV_ADDRESS=0.0.0.0:8080 \
RUSTFS_WEBDAV_TLS_ENABLED=false \
RUSTFS_ACCESS_KEY=rustfsadmin \
RUSTFS_SECRET_KEY=rustfsadmin \
./target/release/rustfs /path/to/data
Test with curl
# List root (buckets)
curl -u rustfsadmin:rustfsadmin -X PROPFIND http://127.0.0.1:8080/ -H "Depth: 1"
# Create bucket
curl -u rustfsadmin:rustfsadmin -X MKCOL http://127.0.0.1:8080/mybucket/
# Upload file
curl -u rustfsadmin:rustfsadmin -T file.txt http://127.0.0.1:8080/mybucket/file.txt
# Download file
curl -u rustfsadmin:rustfsadmin http://127.0.0.1:8080/mybucket/file.txt
# Create subdirectory
curl -u rustfsadmin:rustfsadmin -X MKCOL http://127.0.0.1:8080/mybucket/subdir/
# Delete file
curl -u rustfsadmin:rustfsadmin -X DELETE http://127.0.0.1:8080/mybucket/file.txt
# Delete bucket
curl -u rustfsadmin:rustfsadmin -X DELETE http://127.0.0.1:8080/mybucket/
Client Configuration
Linux (GNOME Files / Nautilus)
- Open Files application
- Press
Ctrl+Lto show address bar - Enter:
dav://rustfsadmin:rustfsadmin@127.0.0.1:8080/
macOS Finder
- Open Finder
- Press
Cmd+K(Connect to Server) - Enter:
http://rustfsadmin:rustfsadmin@127.0.0.1:8080/
Windows Explorer
- Open This PC
- Click "Map network drive"
- Enter:
http://127.0.0.1:8080/ - Enter credentials when prompted
VSCode (WebDAV Extension)
Install jonpfote.webdav extension and create .code-workspace:
{
"folders": [
{
"uri": "webdav://rustfs-local",
"name": "RustFS WebDAV"
}
],
"settings": {
"jonpfote.webdav-folders": {
"rustfs-local": {
"host": "127.0.0.1:8080",
"ssl": false,
"authtype": "basic",
"username": "rustfsadmin",
"password": "rustfsadmin"
}
}
}
}
Architecture
WebDAV Client (curl, Finder, Explorer, VSCode)
│
▼ HTTP/HTTPS
┌───────────────────┐
│ WebDavServer │ ← Hyper HTTP server + Basic Auth
└─────────┬─────────┘
│
┌─────────▼─────────┐
│ WebDavDriver │ ← DavFileSystem implementation
└─────────┬─────────┘
│
┌─────────▼─────────┐
│ StorageBackend │ ← S3 API operations
└─────────┬─────────┘
│
┌─────────▼─────────┐
│ ECStore │ ← Erasure coded storage
└───────────────────┘
Key Components
- config.rs - WebDAV server configuration
- server.rs - Hyper HTTP server with TLS and Basic authentication
- driver.rs - DavFileSystem trait implementation mapping to S3
Path Mapping
WebDAV paths are mapped to S3 buckets and objects:
WebDAV Path S3 Mapping
/ → List all buckets
/mybucket/ → Bucket: mybucket
/mybucket/file.txt → Bucket: mybucket, Key: file.txt
/mybucket/dir/file.txt → Bucket: mybucket, Key: dir/file.txt
License
Apache License 2.0