Davy

A Plug-based library for building WebDAV-compatible file servers in Elixir.

Davy handles the WebDAV HTTP protocol (RFC 4918) — PROPFIND/PROPPATCH XML processing, multistatus responses, COPY/MOVE semantics, locking, and client compatibility — and delegates actual storage operations to a user-provided backend module implementing the Davy.Backend behaviour.

Installation

Add davy to your dependencies:

def deps do
[{:davy, "~> 0.4.1"}]
end

Quick start

  1. Implement the Davy.Backend behaviour
  2. Mount Davy.Plug in your router:
forward "/dav", Davy.Plug, backend: MyApp.DavBackend

Features

Supported methods

MethodDescription
OPTIONSCapability discovery
GET / HEADRead file content
PUTCreate or replace files
DELETERemove resources (recursive for collections)
MKCOLCreate collections (directories)
COPYCopy resources
MOVEMove/rename resources
PROPFINDRetrieve resource properties
PROPPATCHModify resource properties
LOCKAcquire write locks
UNLOCKRelease write locks

Telemetry

Davy emits :telemetry spans for every request, every backend callback, and every lock store call. Attach handlers to measure latency, count error codes, or integrate with telemetry_metrics.

Event namespaces:

See Davy.Telemetry for the full event catalogue, measurements and metadata.

References

GitHub Mirror

Eventually, Forgejo will support fully federated operation, but for now there's a mirror of this repository on GitHub - feel free to open issues and PRs there.

Licence

Apache-2.0