gitmyhub

webdav

Go ★ 5.6k updated 2d ago

A simple and standalone WebDAV server.

A single-binary WebDAV file server you configure with a YAML file to share folders over your network with user accounts, per-user permissions, and optional HTTPS, no client installation needed on Windows, Mac, iOS, or Android.

GoYAMLDockersetup: easycomplexity 2/5

This is a standalone WebDAV server written in Go. WebDAV is a protocol that extends standard web file transfers to support creating, editing, moving, and deleting files over HTTP, the same protocol used to browse websites. Many apps, including file manager clients on Windows, macOS, iOS, and Android, can connect to a WebDAV server as if it were a network drive.

The server is a single binary with no external dependencies. You can install it by downloading a prebuilt release for your operating system, installing it through Homebrew on Mac, or pulling a Docker image. Configuration is done through a single YAML, JSON, or TOML file. The configuration file lets you set the address and port, toggle TLS for HTTPS connections, define a path prefix, and configure logging output and format.

User accounts are defined in the same configuration file. When at least one user is defined, the server requires basic authentication (a username and password). Passwords can be stored in plain text for development or hashed with bcrypt for production. You can also pull credentials from environment variables if you prefer not to put them in the config file. Each user can have their own root directory, separate from the global one, and their own permissions set. Permissions are expressed as combinations of four letters: C for create, R for read, U for update, and D for delete. Fine-grained rules per path or file pattern let you allow or restrict specific subdirectories or file types for individual users.

The README also covers running it behind a reverse proxy such as Nginx or Caddy, with example configuration snippets to ensure certain WebDAV operations work correctly through the proxy. A section on fail2ban integration is mentioned for automatically blocking repeated failed login attempts.

The project is well-documented with a full annotated configuration example covering every available option.

Where it fits