WebDAV 尚未消亡。
WebDAV isn't dead yet

原始链接: https://blog.feld.me/posts/2025/09/webdav-isnt-dead-yet/

## 放弃S3:WebDAV的优势 作者认为,对于许多用例来说,默认依赖亚马逊S3进行文件存储过于复杂。虽然S3在FTP/SFTP消亡后变得普及,但许多项目仅仅需要安全、认证的文件访问——WebDAV在这方面表现出色。 作者的核心需求是认证、高效的写入/同步以及默认的隐私性,而不需要S3的高级功能,如版本控制或分层存储。作者反对像Openstack Swift或Minio等复杂的替代方案,并强调后者最近在易用性方面出现了倒退。 WebDAV令人惊讶地易于访问,得到MacOS Finder、Windows Explorer和`rclone`等工具的支持,并且可以轻松集成到现有的Web服务器(Apache、Nginx等)中。作者详细介绍了一种使用LDAP认证的安全的Apache配置,确保用户被限制在自己的目录中。 目前,作者使用WebDAV与Joplin和Keepassium等应用程序配合使用,并通过`rclone`进行静态博客发布。作者总结说,WebDAV并未过时,并且为许多个人和自托管项目提供了一种更简单、可行的S3替代方案。

## WebDAV:2025年仍然适用 尽管有传言称其已过时,但WebDAV仍然是一种可行的文件访问和同步协议。文章强调了它在各种应用中的持续使用,包括rclone用于同步、Tailscale的驱动共享、Fastmail的文件存储、CopyParty挂载,甚至在OmniFocus和Paperless-NGX等工具中。 虽然该协议并非完美——缺乏标准化的随机写入,并且由于不一致的实现需要变通方法——但由于其基于优化的Web技术,它比SFTP具有速度优势。用户报告了针对特定需求的成功实施,例如同步Devonthink数据库和提供媒体服务。 讨论还涉及SFTP、NFS和S3等替代方案,承认它们的优点和缺点。虽然FTP在某些遗留系统中仍然存在,但WebDAV提供了一种更现代且通常更易于访问的解决方案,尤其是在不同的操作系统(Windows、macOS)上。尽管Windows Explorer的性能存在挑战,但WebDAV仍然为那些寻求开放标准和自托管解决方案的人们找到了一席之地。
相关文章

原文

I should have titled this post "I hate S3".

📢 What is the status quo?

FTP is dead (yay), SFTP is too dependent on SSH and unix authentication. AWS made S3 pervasive and now every webapp that needs to store files assumes you'll be able to connect it S3. This is good for Amazon, but painful for everyone else.

📢 But who is WebDAV useful for?

Most people working on personal projects, self-hosting, or just need filesystem-over-HTTP-ish capabilities do not need S3, they just need a place for their files behind some form of authentication. I stopped reaching for S3 and started running from S3 a while ago and I think you should consider doing the same.

Here are my core requirements:

  • authentication
  • write files
  • efficiently sync files
  • ensure those files aren't publicly accessible by default
  • relatively easy to make those files public

Here's what I don't need:

  • advanced ACLs and roles
  • signed URLs
  • versioning (the V in WebDAV is actually versioning, but still...)
  • tiered storage
  • lifecycle rules
  • quotas, but could be done at the filesystem level (e.g., ZFS)
  • many things I can't think of right now

This list probably resonates with you as well. I just don't think we should be encouraging people to run Openstack Swift, CEPH, Minio, or unfinished projects like Garage just to achieve file-storage-over-HTTP.

And with Minio recently killing off most of their admin UI and making people suffer through crafting JSON policy files and uploading them with the mc tool... just let it go. It's not worth your time.

How would you access WebDAV to manage files if you've never tried before? Lots of tools support it:

  • MacOS Finder (Go->Connect to Server... enter https://...) and iOS Files
  • Windows Explorer (Map Network Drive, Connect to a Web site...)
  • rclone
  • curl
  • Popular things like CyberDuck, WinSCP, Filezilla...

It's broadly available as you can see even though it's considered by many to be archaic or obsolete. Your webserver that you're running probably already supports it and you just need to integrate auth and setup a vhost / domain for it: Apache, Nginx, Caddy, Lighttpd, IIS ... You'll even find support in OwnCloud/NextCloud too.

In fact, you're already using WebDAV and you just don't realize it. This is how your contacts and calendars are synced on your devices. The CardDAV and CalDAV protocols are somewhat like extensions to WebDAV so it suits those purposes more efficiently, and they are not likely to go away any time soon.

So here's how I'm using it with Apache. I already have a few things that work optimally in Apache so I didn't choose another webserver, but I will note that Caddy probably has the simplest configuration for ensuring individual users get dropped into a private directory. A lot of out-of-the-box WebDAV solutions will be exposing all of the files to anyone who can authenticate which is silly, but it's solvable. I'll admit that Apache's config is probably the most convoluted and verbose to achieve a multi-user setup with some semblance of privacy, but it's not impossible.

My setup is using LDAP auth, but you can plug in your own obviously.

Behold:

# DAV specific modules you want
LoadModule dav_module libexec/apache24/mod_dav.so
LoadModule dav_fs_module libexec/apache24/mod_dav_fs.so
LoadModule dav_lock_module libexec/apache24/mod_dav_lock.so

# Ancient fixes Apache includes in example config, kept just because...
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[01234]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
BrowserMatch " Konqueror/4" redirect-carefully

<VirtualHost *:443>
    ServerName webdav.example.com
    DocumentRoot /usr/local/www/webdav
    SSLEngine on
    # other SSL settings left to you

    # This is really important when serving WebDAV
    # or some operations fail due to an index attempting to be served
    DirectoryIndex disabled

    DavLockDB "/tmp/DavLock"
    DavMinTimeout 600
    DavDepthInfinity On

    <Directory /usr/local/www/webdav/>
        DAV On
        AllowOverride None

        AuthType Basic
        AuthName WebDAV
        AuthBasicProvider ldap
        AuthLDAPURL ldaps://ldapserver:636/ou=users,dc=example,dc=com?uid
        AuthLDAPRemoteUserAttribute uid
        <Limit GET HEAD POST PUT OPTIONS MOVE DELETE COPY LOCK UNLOCK PROPFIND PROPPATCH MKCOL DUPLICATE>
            Require ldap-group cn=webdav,ou=groups,dc=example,dc=com
            Require valid-user
        </Limit>
    </Directory>

    # Force users to only be able to see files in the subdirectory matching their username
    RewriteEngine On
    # Only rewrite if NOT already in user's directory
    RewriteCond %{REQUEST_URI} !^/%{LA-U:REMOTE_USER}/
    RewriteCond %{LA-U:REMOTE_USER} ^(.+)$
    RewriteRule ^(.*)$ /%1$1 [L]
</VirtualHost>

And now if there's a subdirectory under /usr/local/www/webdav matching the user's name and writable by the webserver, they'll be able to authenticate and use the storage space.

So what am I using this with?

  • Joplin, a self hosted notes app that syncs to my own server
  • Keepassium, Keepass app well integrated into iOS/MacOS
  • VLC
  • Infuse
  • Publishing this static blog with rclone (it's faster than rsync over NFS/SMB, and I won't need a VPN when I'm roaming!)

While writing this article I came across an interesting project under development, Altmount. This would allow you to "mount" published content on Usenet and access it directly without downloading it... super interesting considering I can get multi-gigabit access to Usenet pretty easily.

Don't sleep on WebDAV, give it a chance. It's not dead yet.

联系我们 contact @ memedata.com