Skip to content

feat(rpcclient): WebDAV bridge for mounting remote paths in Finder - #447

Merged
doronz88 merged 2 commits into
masterfrom
feat/webdav-mount
Aug 18, 2026
Merged

doronz88 merged 2 commits into
masterfrom
feat/webdav-mount

Conversation

@doronz88

@doronz88 doronz88 commented Aug 18, 2026 •

Copy link
Copy Markdown
Owner

What

Adds a WebDAV bridge so any remote target path can be mounted read-write in macOS Finder (or any WebDAV client).

A local async WebDAV server (ASGIWebDAV) runs inside the rpcclient process; every WebDAV request is translated into client.fs calls against the target. Nothing runs on the target and there are no C-server changes — it works identically for iOS / macOS / Linux targets since it only uses the existing fs subsystem.

WebDAV was chosen over FTP because macOS Finder mounts FTP read-only (it only permits writes to servers implementing WebDAV class-2 LOCK), whereas WebDAV mounts read-write. ASGIWebDAV is async-native, so the provider awaits client.fs directly on the client's event loop — no thread bridge.

Usage

rpcclient HOSTNAME webdav [--mount]      # subcommand
rpcdav HOSTNAME [--mount]                # standalone equivalent

--mount mounts it locally via mount_webdav and reveals it; otherwise the http://127.0.0.1:PORT URL is printed for Finder's Go → Connect to Server. Options: --path (default /), --host, --bind-port/--port, --readonly. Programmatic: await p.webdav.serve(path, ...).

Details

  • New webdav subsystem on CoreClient (RpcFsProvider implements PROPFIND/GET/HEAD/PUT/DELETE/MKCOL/MOVE against client.fs).
  • asgiwebdav + uvicorn added as default dependencies.
  • Finder metadata (.DS_Store, AppleDouble ._*, …) writes are swallowed — reported as success but never written to the remote, so they don't error on read-only roots (e.g. iOS /).
  • fs failures are translated into clean WebDAV statuses (403/409) instead of 500 tracebacks.

Testing

  • 10 TDD tests in tests/test_webdav.py — each WebDAV op round-trips against a live client, plus the .DS_Store-swallow and fs-failure-handling cases, plus CLI registration.
  • Verified end-to-end with macOS's own mount_webdav (the kernel client Finder uses): mounted read-write, full create/read/write/mkdir/rename/delete round-trip landing on the backing store, .DS_Store swallowed with zero tracebacks.

@doronz88
doronz88 force-pushed the feat/webdav-mount branch 5 times, most recently from 8131eb8 to 6323af9 Compare August 18, 2026 19:41
Serve any remote target path over a local async WebDAV server (ASGIWebDAV)
running inside the rpcclient process. Each WebDAV request is translated into
client.fs calls, so a WebDAV client (macOS Finder, Windows Explorer, GNOME
Files, ...) can browse and edit the remote filesystem read-write as a mounted
volume. Works for iOS/macOS/Linux targets since it only uses the fs subsystem;
no server-side changes.

- new `webdav` subsystem on CoreClient: `await p.webdav.serve(path, ...)`
- `rpcclient HOSTNAME webdav [PATH] [--mount]` subcommand and standalone `rpcdav`
- served path is a positional argument, defaulting to /
- `--mount` mounts and reveals the volume using the host's native mechanism
  (mount_webdav on macOS, net use on Windows, gio on Linux), falling back to
  printing the URL when none is available; the mount point is named
  rpc-<hostname>-<path>-<rand> so it is easy to spot in Finder
- swallow Finder metadata writes (.DS_Store / AppleDouble ._*) so they never
  hit the remote and never error on read-only roots
- refuse to open non-regular files (fifos/devices/sockets): opening them blocks
  the single serialized RPC channel and would wedge the whole mount
- build parent paths via remote_path() rather than RemotePath.parent, which
  drops the bound client on Python < 3.12
- translate fs failures into clean WebDAV statuses instead of 500 tracebacks

Adds asgiwebdav + uvicorn (and backports.zstd on Python < 3.14) as
dependencies, and httpx to the test extra.
Add a "Mounting in Finder (WebDAV)" guide covering rpcdav and the
rpcclient webdav subcommand, and surface the WebDav subsystem in the
core API reference. Notes cross-platform mounting, client-side caching
(out-of-band changes can appear stale until the client revalidates),
read-write behavior, .DS_Store handling, the non-regular-file limitation,
and the chmod/chown WebDAV limitation.
@doronz88
doronz88 merged commit feda057 into master Aug 18, 2026
45 of 50 checks passed
@doronz88
doronz88 deleted the feat/webdav-mount branch August 18, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant