暗黑模式
WebDAV
WebDAV
Caddy2 WebDAV 插件
插件:https://caddyserver.com/docs/modules/http.handlers.webdav
构建带有 WebDAV 插件的 Caddy
- 方法一:xcaddy
- 方法二(推荐):https://caddyserver.com/download
- Platform: Linux arm64(Android Termux)
- 勾选 mholt/caddy-webdav
- 点击 Download
配置文件
折叠
bash:8080 { @get method GET @video path *.mp4 *.mov header @video Content-Type "video/mp4" redir /public /public/ redir /ronnie /ronnie/ redir /share /share/ root * /data/data/com.termux/files/home/webdav basicauth /public/* { public $2a$14$VDEwlQ8PiBZEg/HcFrX9Cu0beXOrWJsCBkBKTuYbk8n5QRmi8V75u admin $2a$14$fO64fexLskd0jy/tqvJcAO/zWh3g87Bv/JnghtKfNsPPJPbowC8u2 } basicauth /ronnie/* { ronnie $2a$14$Mn0ydU8hoReKyfKjQGy82uzWNolDe0zhQzWAMCkZSyAM1Vzql9Miyi admin $2a$14$fO64fexLskd0jy/tqvJcAO/zWh3g87Bv/JnghtKfNsPPJPbowC8u2 } @not-subfolders { not path /share/* /public/* /ronnie/* } handle @not-subfolders { basicauth { admin $2a$14$fO64fexLskd0jy/tqvJcAO/zWh3g87Bv/JnghtKfNsPPJPbowC8u2 } } route { file_server @get browse webdav } }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
WebDAV 客户端
Windows 资源管理器
配置支持 http
Windows 默认只支持 https 加密的 WebDAV
- 停止 WebClient 服务
CTRL+S
→services
→ 找到WebClient
- 右击 → 属性 → 启动类型:设置为
自动
- 左侧面板 →
停止此服务
- 修改注册表
CTRL+S
→regedit
→ 找到 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters- 把 BasicAuthLevel 值改成
2
,即同时支持 http 和 https,
- 重启
WebClient
服务 - 资源管理器中右击
此电脑
,点击 添加一个网络位置,输入 WebDAV 地址、账号和密码
RaiDrive for Windows
Cyberduck for Windows & MacOS
Mountainduck(Paid) for Windows & MacOS
ES File Browser for Android
Documents for iOS
MacOS Finder
Ubuntu built-in: dav://192.168.1.x:8080
Command-line Client
- bash
sudo apt update sudo apt install davfs2 # system-wide sudo mkdir /mnt/webdav sudo mount -t davfs http(s)://address:<port>/path /mnt/webdav sudo echo "http(s)://address:<port>/path /mnt/webdav davfs rw,user,noauto 0 0" >> /etc/fstab sudo echo "http(s)://address:<port>/path davusername davpassword" >> /etc/davfs2/secrets sudo chmod 600 /etc/davfs2/secrets sudo chown root:root /etc/davfs2/secrets # or user-wide mkdir ~/webdav mount -t davfs http(s)://address:<port>/path ~/webdav sudo echo "http(s)://address:<port>/path /mnt/webdav davfs rw,user,noauto 0 0" >> /etc/fstab echo "http(s)://address:<port>/path davusername davpassword" >> ~/.davfs2/secrets chmod 600 ~/.davfs2/secrets usermod -aG davfs2 yourusername reboot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
软链和硬链
bash
ln target_file.mp4 new_hardlink_file.mp4
ln -s target_file.mp4 new_softlink_file.mp4
ln -s /xx/xx/target_file.mp4 new_softlink_file_absolute_path.mp4 # 使用绝对路径
ln -s ${PWD}/target_file.mp4 new_softlink_file_absolute_path.mp4 # 同上
1
2
3
4
2
3
4