挂载群晖的WebDAV,使用群晖的WebDAV Server搭建的服务。
群晖配置了证书。
使用镜像:docker-webdav-client
docker run -it --rm \
--device /dev/fuse \
--cap-add SYS_ADMIN \
--security-opt "apparmor=unconfined" \
--env "WEBDRIVE_USERNAME=<YourUserName>" \
--env "WEBDRIVE_PASSWORD=<SuperSecretPassword>" \
--env "WEBDRIVE_URL=https://dav.box.com/dav" \
--env "DAVFS2_ASK_AUTH=0" \
-v /mnt/tmp:/mnt/webdrive:rshared \
efrecon/webdav-client
这个镜像就是封装了davfs2
用环境变量DAVFS2_开头可以将参数写入到此工具的配置文件:/etc/davfs2/davfs2.conf
DAVFS2_ASK_AUTH=0 :如果在secretsfile中找不到凭据和密码,则以交互方式询问用户。询问用户是否无法验证servercert。0 =否,1 =是。
在绑定过程中发生以下错误:
Caught TERM! Unmounting /mnt/webdrive...
Forwarding TERM to 13
the server certificate does not match the server name
the server certificate is not trusted
issuer: Synology Inc., Taipel, TW
subject: Synology Inc., Taipel, TW
identity: synology
fingerprint: xxxx
You only should accept this certificate, if you can
verify the fingerprint! The server might be faked
or there might be a man-in-the-middle-attack.
这是因为用的IP和SSL证书不匹配,解决:
导出群晖的证书:控制面板-安全性-证书-操作-导出证书 解压 只需要cert.pem,放到Linux服务器上
增加以下参数:
--env "DAVFS2_trust_server_cert=/cert/cert.pem" 用于指定证书,路径是容器内的
-v /root/webdav/cert:/cert 将证书映射进容器
docker run -it --rm \
--device /dev/fuse \
--cap-add SYS_ADMIN \
--security-opt "apparmor=unconfined" \
--env "WEBDRIVE_USERNAME=<YourUserName>" \
--env "WEBDRIVE_PASSWORD=<SuperSecretPassword>" \
--env "WEBDRIVE_URL=https://dav.box.com/dav" \
--env "DAVFS2_ASK_AUTH=0" \
--env "DAVFS2_trust_server_cert=/cert/cert.pem" \
-v /mnt/tmp:/mnt/webdrive:rshared \
-v /root/webdav/cert:/cert \
efrecon/webdav-client