A small Go MVP that behaves like a fake WebDAV backend for rclone experiments.
It does not persist cloud data and is not a production WebDAV implementation. It is intended for local development, rclone connection checks, mount smoke tests, and request log inspection.
- Features
- Architecture
- Prerequisites
- Windows end-to-end quickstart
- Start the server
- Build
- Windows one-click install
- rclone configuration
- Request logs
- CLI flags
- Scope and limitations
- Development
- WebDAV-ish endpoints for rclone smoke testing:
OPTIONSPROPFINDPROPPATCHPUTGETHEADDELETEMKCOLCOPYMOVELOCKUNLOCK
- In-memory file storage for basic create/open/save/delete round trips.
- Basic WebDAV write locks:
LOCKreturns aLock-Token, locked files reject writes without that token, token-bearing saves update the existing content, andUNLOCKreleases the file. - JSON Lines request logging with method, path, status, user agent, Depth header, request ID, byte counts, and duration.
- Health endpoint at
/healthz. - Windows PowerShell install/run scripts.
- rclone config example.
+-------------------+ http://127.0.0.1:8080 +----------------------+
| curl / rclone CLI +--------------------------------->| Go mock WebDAV |
| / browser tests | | server |
+-------------------+ +----------+-----------+
|
| JSONL logs
v
./requests.jsonl
+-----------------------------+
| Windows Explorer / Office / |
| PowerShell file operations |
+--------------+--------------+
|
| optional drive mount
v
+-----------------------------+
| rclone mount + WinFsp |
| drive letter, e.g. X: |
+--------------+--------------+
|
| WebDAV requests
v
+-------------------+ http://127.0.0.1:8081 +----------------------+
| curl / rclone CLI +--------------------------------->| docker compose |
| / browser tests | | -> Go mock WebDAV |
+-------------------+ | container :8080 |
+----------+-----------+
|
| JSONL logs
v
./docker-data/logs/
requests.jsonl
+-----------------------------+
| Windows Explorer / Office / |
| rclone / API clients |
+--------------+--------------+
|
| HTTPS WebDAV
v
+-----------------------------+
| Edge / reverse proxy |
| TLS + rate limit + IP rules |
+--------------+--------------+
|
| authenticated requests
v
+-----------------------------+
| Auth layer |
| Basic/OIDC/SSO + authz |
+--------------+--------------+
|
v
+------------------------------------------------------+
| WebDAV gateway service |
| - PROPFIND / GET / PUT / MOVE / LOCK / UNLOCK |
| - ETag / conditional requests |
| - audit / metrics / tracing |
+-----------+----------------------+-------------------+
| |
| cache lookup | lock + policy state
v v
+------------------------+ +-------------------------+
| Metadata/listing cache | | Shared state store |
| Redis / memory | | locks / sessions / ACLs |
+-----------+------------+ +------------+------------+
| |
| cache miss / invalidate |
+---------------+-------------+
|
v
+-------------------------+
| Upload staging / temp |
| files / write buffer |
+------------+-------------+
|
| API calls / commit
v
+-------------------------+
| Remote Drive API |
| OneDrive / Google Drive |
| SharePoint / custom API |
+------------+-------------+
|
| durable content + metadata
v
+-------------------------+
| Remote storage platform |
+-------------------------+
Notes:
- Local Go execution listens on
127.0.0.1:8080by default. - Docker Compose publishes the service on host port
8081. - Windows drive mounting is optional; direct
curlorrclonecalls can hit the Docker service without WinFsp. - A production version should treat the remote Drive API or backing store as the source of truth; cache should accelerate reads and metadata, not replace persistence.
- If the service is remote, use HTTPS and authentication in front of WebDAV requests.
Choose the tools you need based on how you want to run the project:
| Scenario | Required software |
|---|---|
| Run locally with Go | Go |
| Run with Docker Compose | Docker Desktop |
| Mount as a Windows drive letter | rclone + WinFsp |
| Mount a Windows drive letter to the Docker service | Docker Desktop + rclone + WinFsp |
winget install -e --id Docker.DockerDesktop
winget install -e --id Rclone.Rclone
winget install -e --id WinFsp.WinFsp
winget install -e --id GoLang.GoNotes:
- Docker Compose is included with Docker Desktop.
rclone mounton Windows requires WinFsp.- If you only use Docker Compose, Go is optional.
- After installing with winget, open a new terminal before running the commands below.
This is the simplest way to get a Windows drive letter that sends file operations to the Docker Compose service.
Use the winget commands in Prerequisites.
After installation:
- start Docker Desktop
- wait until Docker Desktop shows Running
- open a new PowerShell window
From this repository:
docker compose up -d --buildVerify the service:
curl http://127.0.0.1:8081/healthz
curl -X PROPFIND -H "Depth: 1" http://127.0.0.1:8081/webdav/Expected result:
/healthzreturns{"status":"ok"}PROPFINDreturns WebDAV XML with HTTP207
Run the Windows installer script and point it at the Docker Compose port:
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -Addr 127.0.0.1:8081 -ConfigureRclone -Mount -DriveLetter XWhat this does:
- configures the
mockdriverclone remote tohttp://127.0.0.1:8081/webdav/ - writes helper scripts to
%LOCALAPPDATA%\rclone-webdav-mock-drive - opens a new PowerShell window running
rclone mount mockdrive: X: --vfs-cache-mode writes
When this succeeds, you should see drive X: in Windows Explorer.
In a new PowerShell window:
Set-Content X:\hello.txt "hello from windows"
Get-Content X:\hello.txt
New-Item -ItemType Directory X:\demo
Get-ChildItem X:\You can also test with rclone directly:
rclone lsd mockdrive:
rclone copy .\README.md mockdrive:/README.md
rclone cat mockdrive:/README.mdDocker container logs:
docker compose logs -fRequest log file written by the container:
Get-Content .\docker-data\logs\requests.jsonl -WaitStop the mounted drive:
- close the PowerShell window that is running
rclone mount - or press
Ctrl+Cin that mount window
Stop Docker Compose:
docker compose downStart Docker Desktop first, then retry:
docker version
docker compose up -d --buildThis repository already maps Docker to host port 8081, so use:
http://127.0.0.1:8081/healthzhttp://127.0.0.1:8081/webdav/
Check:
rclone version- WinFsp is installed
- Docker Compose service is healthy
- the remote points to
127.0.0.1:8081
Inspect the remote:
rclone config show mockdriveTry mounting manually:
rclone mount mockdrive: X: --vfs-cache-mode writesUse powershell.exe and forward the script path with /:
powershell.exe -ExecutionPolicy Bypass -File ./scripts/install.ps1 -Addr 127.0.0.1:8081 -ConfigureRclone -Mount -DriveLetter XThe mock WebDAV server listens on 127.0.0.1:8080 by default and exposes:
- Health check:
http://127.0.0.1:8080/healthz - WebDAV root:
http://127.0.0.1:8080/webdav/
For the Windows install-script flow, see Windows one-click install. For the Docker-backed Windows drive mount flow, see Windows end-to-end quickstart.
go test ./...
go run . -addr 127.0.0.1:8080 -log-file requests.jsonlVerify in another shell:
curl http://127.0.0.1:8080/healthz
curl -X PROPFIND -H 'Depth: 1' http://127.0.0.1:8080/webdav/Local request logs are written to:
./requests.jsonl
Docker Compose publishes the service on host port 8081 to avoid conflicts with other local services that may already use 8080.
Build and start:
docker compose up --buildRun in the background:
docker compose up -d --buildVerify:
curl http://127.0.0.1:8081/healthz
curl -X PROPFIND -H 'Depth: 1' http://127.0.0.1:8081/webdav/View logs:
docker compose logs -fRequest logs are also written to:
./docker-data/logs/requests.jsonl
If you use rclone against the Docker Compose service, use:
http://127.0.0.1:8081/webdav/
Stop the service:
docker compose downLinux/macOS local build:
go build -o bin/rclone-webdav-mock-drive .Windows amd64 cross compile:
GOOS=windows GOARCH=amd64 go build -o dist/rclone-webdav-mock-drive-windows-amd64.exe .Use this section if you want the install script to set up the locally installed Windows executable. For Docker + drive mount, use Windows end-to-end quickstart instead.
Install prerequisites first using Prerequisites, then run:
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -ConfigureRclone -AddToPathStart the locally installed server:
powershell -ExecutionPolicy Bypass -File "$env:LOCALAPPDATA\rclone-webdav-mock-drive\run.ps1"
curl http://127.0.0.1:8080/healthzOr install and immediately start it:
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -ConfigureRclone -AddToPath -StartGitHub/private repo install example:
$env:GITHUB_TOKEN = "ghp_xxx"
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -ConfigureRclone -AddToPathGit Bash variant:
powershell.exe -ExecutionPolicy Bypass -File ./scripts/install.ps1 -ConfigureRclone -AddToPathInstaller options:
-InstallDir Install location. Default: %LOCALAPPDATA%\rclone-webdav-mock-drive
-Addr Listen address. Default: 127.0.0.1:8080
-LogFile JSONL log path. Default: <InstallDir>\requests.jsonl
-GitHubToken Token for private repo/release downloads. Default: $env:GITHUB_TOKEN
-RemoteName rclone remote name. Default: mockdrive
-DriveLetter Drive letter for rclone mount. Default: X
-BuildFromSource Force go install github.com/kyleap/rclone-webdav-mock-drive@latest
-ConfigureRclone Create/update the rclone WebDAV remote when rclone is installed
-Mount Start rclone mount in a new PowerShell window (WinFsp required)
-AddToPath Add the installed bin folder to the current user's PATH
-Start Start the mock WebDAV server after installing
-Force Reinstall even if the executable already exists
Example file: examples/rclone.conf
[mockdrive]
type = webdav
url = http://127.0.0.1:8080/webdav/
vendor = otherThat example targets the local Go/Windows server on port 8080.
If you are using Docker Compose, change the URL to:
url = http://127.0.0.1:8081/webdav/Use it with rclone:
rclone --config ./examples/rclone.conf lsd mockdrive:
rclone --config ./examples/rclone.conf copy ./README.md mockdrive:/README.md
rclone --config ./examples/rclone.conf cat mockdrive:/README.mdFor mounting, use your OS-specific rclone mount prerequisites. Example:
mkdir -p ./mnt/mockdrive
rclone --config ./examples/rclone.conf mount mockdrive: ./mnt/mockdrive --vfs-cache-mode writesOn Windows, install WinFsp before using rclone mount. For a Docker-backed X: drive walkthrough, see Windows end-to-end quickstart.
Office-style open/save smoke path:
- Mount
mockdrive:with rclone/WinFsp. - Open an Office file from the mounted drive.
- The WebDAV server logs discovery/open traffic such as
PROPFIND,HEAD,GET, andLOCK. - While the file is locked, writes to the locked file require the returned lock token; saves with the lock token update the in-memory file content.
- Office temp lock files such as
~$name.docxare normal file operations and are also logged.
Windows Explorer / rclone mount action log mapping:
- Open a folder or refresh a folder: usually
PROPFINDwithDepth: 1; logged. - Create a folder: usually
MKCOL; logged. - Drag/drop or copy a file into the mounted drive: usually
PUT; logged. - Open a file: usually
HEADand/orGET; logged. - Rename or move a file/folder: usually
MOVE; logged. - Copy inside the mounted drive: usually
COPYor a read/write sequence depending on the client; logged. - Delete a file: usually
DELETE; logged. - Delete a folder: usually
DELETE; logged. - Open an Office file: discovery/open traffic such as
PROPFIND,HEAD,GET, andLOCK; logged. - Save an Office file:
PUTwith the active lock token updates the in-memory content; logged. - Office temporary lock files such as
~$report.docx: normalPUT/DELETEfile operations; logged.
Example observed log sequence for open folder, drag file in, open file, and delete:
PROPFIND /webdav/ 207
MKCOL /webdav/dragtest/ 201
PROPFIND /webdav/dragtest/ 207
PUT /webdav/dragtest/from-desktop.txt 201
PROPFIND /webdav/dragtest/ 207
GET /webdav/dragtest/from-desktop.txt 200
DELETE /webdav/dragtest/from-desktop.txt 204
DELETE /webdav/dragtest/ 204
On Windows, the default installed log file is:
$env:LOCALAPPDATA\rclone-webdav-mock-drive\requests.jsonlWatch logs live:
Get-Content "$env:LOCALAPPDATA\rclone-webdav-mock-drive\requests.jsonl" -WaitRun with a log file:
go run . -addr 127.0.0.1:8080 -log-file requests.jsonlExample log entry:
{"time":"2026-06-01T00:00:00Z","request_id":"abc123","method":"PROPFIND","path":"/webdav/","user_agent":"rclone/v1","depth":"1","status":207,"bytes_in":0,"bytes_out":256,"duration_ms":1}If -log-file is omitted, request logs are written to stdout.
-addr HTTP listen address. Default: 127.0.0.1:8080
-log-file JSONL request log file path. Default: stdout
- This is a mock backend, not a real cloud drive.
- File contents are kept in memory and are lost when the process exits.
- No authentication is required.
- It is designed for local development only; do not expose it to the internet.
- WebDAV coverage is intentionally minimal and only targets rclone smoke tests/log capture.
go test ./...
go build -o bin/rclone-webdav-mock-drive .
GOOS=windows GOARCH=amd64 go build -o dist/rclone-webdav-mock-drive-windows-amd64.exe .