{"id":13434743,"url":"https://github.com/messense/aliyundrive-webdav","last_synced_at":"2025-05-13T15:02:34.894Z","repository":{"id":37454319,"uuid":"397618589","full_name":"messense/aliyundrive-webdav","owner":"messense","description":"阿里云盘 WebDAV 服务","archived":false,"fork":false,"pushed_at":"2025-05-05T14:54:56.000Z","size":3889,"stargazers_count":9696,"open_issues_count":26,"forks_count":1096,"subscribers_count":76,"default_branch":"main","last_synced_at":"2025-05-05T22:16:40.039Z","etag":null,"topics":["aliyundrive","aliyundrive-client","luci-app","openwrt-package","webdav-server"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/messense.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"messense","custom":"https://github.com/messense/messense/blob/master/SPONSOR.md#sponsor-my-open-source-works"}},"created_at":"2021-08-18T13:53:39.000Z","updated_at":"2025-05-05T16:12:52.000Z","dependencies_parsed_at":"2024-01-06T16:09:00.118Z","dependency_job_id":"2213944f-00ce-4379-be50-2eb0275011af","html_url":"https://github.com/messense/aliyundrive-webdav","commit_stats":{"total_commits":635,"total_committers":16,"mean_commits":39.6875,"dds":"0.11653543307086611","last_synced_commit":"3a28da0f10e1884ce952a68fcb18897f378fbe30"},"previous_names":[],"tags_count":117,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Faliyundrive-webdav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Faliyundrive-webdav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Faliyundrive-webdav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Faliyundrive-webdav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/messense","download_url":"https://codeload.github.com/messense/aliyundrive-webdav/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253968089,"owners_count":21992252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aliyundrive","aliyundrive-client","luci-app","openwrt-package","webdav-server"],"created_at":"2024-07-31T03:00:21.927Z","updated_at":"2025-05-13T15:02:34.868Z","avatar_url":"https://github.com/messense.png","language":"Rust","funding_links":["https://github.com/sponsors/messense","https://github.com/messense/messense/blob/master/SPONSOR.md#sponsor-my-open-source-works"],"categories":["HarmonyOS","Rust","网络服务"],"sub_categories":["Windows Manager","网络服务_其他"],"readme":"# aliyundrive-webdav\n\n[![GitHub Actions](https://github.com/messense/aliyundrive-webdav/workflows/CI/badge.svg)](https://github.com/messense/aliyundrive-webdav/actions?query=workflow%3ACI)\n[![PyPI](https://img.shields.io/pypi/v/aliyundrive-webdav.svg)](https://pypi.org/project/aliyundrive-webdav)\n[![Docker Image](https://img.shields.io/docker/pulls/messense/aliyundrive-webdav.svg?maxAge=2592000)](https://hub.docker.com/r/messense/aliyundrive-webdav/)\n[![aliyundrive-webdav](https://snapcraft.io/aliyundrive-webdav/badge.svg)](https://snapcraft.io/aliyundrive-webdav)\n[![Crates.io](https://img.shields.io/crates/v/aliyundrive-webdav.svg)](https://crates.io/crates/aliyundrive-webdav)\n\n\u003e 🚀 Help me to become a full-time open-source developer by [sponsoring me on GitHub](https://github.com/sponsors/messense)\n\n阿里云盘 WebDAV 服务，主要使用场景为配合支持 WebDAV 协议的客户端 App 如 [Infuse](https://firecore.com/infuse)、[nPlayer](https://nplayer.com)\n等实现在电视上直接观看云盘视频内容， 支持客户端 App 直接从阿里云盘获取文件播放而不经过运行本应用的服务器中转, 支持上传文件，但受限于 WebDAV 协议不支持文件秒传。\n\n**请注意：V2 版本基于阿里云盘开放平台接口实现，不再支持阿里云盘 Web 和 App 版本获取的 refresh token。**\n**由于本项目作者不再使用梅林固件，V2 版本不再免费支持 Koolshare 梅林固件系统，如有需要请考虑[付费支持](https://github.com/messense/aliyundrive-webdav/discussions/778)。**\n\n如果项目对你有帮助，请考虑[捐赠支持](https://github.com/messense/aliyundrive-webdav/discussions/126)项目持续维护。\n也可以考虑加入[aliyundrive-webdav 知识星球](https://t.zsxq.com/0c9sq6Ca8)获取咨询和技术支持服务。\n\n\u003e **Note**\n\u003e\n\u003e 本项目作者没有上传需求, 故上传文件功能测试不全面且没有持续迭代计划.\n\n## 安装\n\n可以从 [GitHub Releases](https://github.com/messense/aliyundrive-webdav/releases) 页面下载预先构建的二进制包， 也可以使用 pip 从 PyPI 下载:\n\n```bash\npip install aliyundrive-webdav\n```\n\n如果系统支持 [Snapcraft](https://snapcraft.io) 比如 Ubuntu、Debian 等，也可以使用 snap 安装：\n\n```bash\nsudo snap install aliyundrive-webdav\n```\n\n### OpenWrt 路由器\n\n[GitHub Releases](https://github.com/messense/aliyundrive-webdav/releases) 中有预编译的 ipk 文件， 目前提供了\naarch64/arm/mipsel/x86_64/i686 等架构的版本，可以下载后使用 opkg 安装，以 nanopi r4s 为例：\n\n```bash\nwget https://github.com/messense/aliyundrive-webdav/releases/download/v2.3.3/aliyundrive-webdav_2.3.3-1_aarch64_generic.ipk\nwget https://github.com/messense/aliyundrive-webdav/releases/download/v2.3.3/luci-app-aliyundrive-webdav_2.3.3_all.ipk\nwget https://github.com/messense/aliyundrive-webdav/releases/download/v2.3.3/luci-i18n-aliyundrive-webdav-zh-cn_2.3.3-1_all.ipk\nopkg install aliyundrive-webdav_2.3.3-1_aarch64_generic.ipk\nopkg install luci-app-aliyundrive-webdav_2.3.3_all.ipk\nopkg install luci-i18n-aliyundrive-webdav-zh-cn_2.3.3-1_all.ipk\n```\n\n其它 CPU 架构的路由器可在 [GitHub Releases](https://github.com/messense/aliyundrive-webdav/releases) 页面中查找对应的架构的主程序 ipk 文件下载安装， 常见\nOpenWrt 路由器 CPU 架构如下表（欢迎补充）：\n\n| 路由器       | CPU 架构           |\n| ------------ | ------------------ |\n| nanopi r4s   | aarch64_generic    |\n| 小米 AX3600  | aarch64_cortex-a53 |\n| 斐讯 N1 盒子 | aarch64_cortex-a53 |\n| Newifi D2    | mipsel_24kc        |\n| Pogoplug     | arm_mpcore         |\n\n\u003e Tips: 不清楚 CPU 架构类型可通过运行 `opkg print-architecture` 命令查询。\n\n![OpenWrt 配置界面](./doc/openwrt.png)\n\n## Docker 运行\n\n```bash\ndocker run -d --name=aliyundrive-webdav --restart=unless-stopped -p 8080:8080 \\\n  -v /etc/aliyundrive-webdav/:/etc/aliyundrive-webdav/ \\\n  -e REFRESH_TOKEN='your refresh token' \\\n  -e WEBDAV_AUTH_USER=admin \\\n  -e WEBDAV_AUTH_PASSWORD=admin \\\n  messense/aliyundrive-webdav\n```\n\n其中，`REFRESH_TOKEN` 环境变量为你的阿里云盘 `refresh_token`，`WEBDAV_AUTH_USER`\n和 `WEBDAV_AUTH_PASSWORD` 为连接 WebDAV 服务的用户名和密码。\n\n### QNAP 威联通 NAS\n\n#### QNAP 插件\n\n[qnap-aliyunpan-webdav](https://github.com/iranee/qnap-aliyunpan-webdav) by\n[@iranee](https://github.com/iranee).\n\n#### ContainerStation (Docker)\n\n管理员登陆 NAS 后安装 ContainerStation 并启动服务，在 Management (管理) 标签中 Create Application (新建应用)，配置如下\n\n```yaml\nversion: '3.3'\nservices:\n  aliyundrive-webdav:\n    container_name: aliyundrive-webdav\n    restart: unless-stopped\n    ports:\n      - '8080:8080'\n    environment:\n      - 'REFRESH_TOKEN=mytoken...'\n    image: messense/aliyundrive-webdav\n```\n\n其中 `REFRESH_TOKEN` 文档最下面说明；`:8080` 网盘访问映射端口，可以按需改为其他的。\n\n点击 Create (创建)后启动，访问 http://nas地址:8080/ 即可看到你网盘的自动生成索引网页文件。\n\n参考文档\n\n- https://docs.docker.com/compose/\n- https://www.composerize.com/\n\n## rclone\n\n为了避免重复上传文件，使用 rclone 时推荐使用 [Nextcloud WebDAV](https://rclone.org/webdav/#nextcloud) 模式，可以支持 sha1 checksums. \n另外需要配合 `--no-update-modtime` 参数，否则 rclone 为了更新文件修改时间还是会强制重新上传。\n\n举个例子：\n\n```bash\nrclone --no-update-modtime copy abc.pdf aliyundrive-nc://docs/\n```\n\n## 获取 refresh token\n\n* [通过在线工具获取 refresh token](https://messense-aliyundrive-webdav-backendrefresh-token-ucs0wn.streamlit.app/)\n* 命令行运行 `aliyundrive-webdav qr login` 扫码授权后会输出 refresh token\n\n![扫码获取 refresh token](./doc/refresh-token.png)\n\n## 命令行用法\n\n```bash\n$ aliyundrive-webdav --help\nWebDAV server for AliyunDrive\n\nUsage: aliyundrive-webdav [OPTIONS]\n       aliyundrive-webdav \u003cCOMMAND\u003e\n\nCommands:\n  qr    Scan QRCode\n  help  Print this message or the help of the given subcommand(s)\n\nOptions:\n      --host \u003cHOST\u003e\n          Listen host\n\n          [env: HOST=]\n          [default: 0.0.0.0]\n\n  -p, --port \u003cPORT\u003e\n          Listen port\n\n          [env: PORT=]\n          [default: 8080]\n\n      --client-id \u003cCLIENT_ID\u003e\n          Aliyun drive client_id\n\n          [env: CLIENT_ID=]\n\n      --client-secret \u003cCLIENT_SECRET\u003e\n          Aliyun drive client_secret\n\n          [env: CLIENT_SECRET=]\n\n      --drive-type \u003cDRIVE_TYPE\u003e\n          Aliyun drive type\n\n          [env: DRIVE_TYPE=]\n\n          Possible values:\n          - resource: Resource drive\n          - backup:   Backup drive\n          - default:  Default drive\n\n  -r, --refresh-token \u003cREFRESH_TOKEN\u003e\n          Aliyun drive refresh token\n\n          [env: REFRESH_TOKEN=]\n\n  -U, --auth-user \u003cAUTH_USER\u003e\n          WebDAV authentication username\n\n          [env: WEBDAV_AUTH_USER=]\n\n  -W, --auth-password \u003cAUTH_PASSWORD\u003e\n          WebDAV authentication password\n\n          [env: WEBDAV_AUTH_PASSWORD=]\n\n  -I, --auto-index\n          Automatically generate index.html\n\n  -S, --read-buffer-size \u003cREAD_BUFFER_SIZE\u003e\n          Read/download buffer size in bytes, defaults to 10MB\n\n          [default: 10485760]\n\n      --upload-buffer-size \u003cUPLOAD_BUFFER_SIZE\u003e\n          Upload buffer size in bytes, defaults to 16MB\n\n          [default: 16777216]\n\n      --cache-size \u003cCACHE_SIZE\u003e\n          Directory entries cache size\n\n          [default: 1000]\n\n      --cache-ttl \u003cCACHE_TTL\u003e\n          Directory entries cache expiration time in seconds\n\n          [default: 600]\n\n      --root \u003cROOT\u003e\n          Root directory path\n\n          [env: WEBDAV_ROOT=]\n          [default: /]\n\n  -w, --workdir \u003cWORKDIR\u003e\n          Working directory, refresh_token will be stored in there if specified\n\n      --no-trash\n          Delete file permanently instead of trashing it\n\n      --read-only\n          Enable read only mode\n\n      --tls-cert \u003cTLS_CERT\u003e\n          TLS certificate file path\n\n          [env: TLS_CERT=]\n\n      --tls-key \u003cTLS_KEY\u003e\n          TLS private key file path\n\n          [env: TLS_KEY=]\n\n      --strip-prefix \u003cSTRIP_PREFIX\u003e\n          Prefix to be stripped off when handling request\n\n          [env: WEBDAV_STRIP_PREFIX=]\n\n      --debug\n          Enable debug log\n\n      --no-self-upgrade\n          Disable self auto upgrade\n\n      --skip-upload-same-size\n          Skip uploading same size file\n\n      --prefer-http-download\n          Prefer downloading using HTTP protocol\n\n      --redirect\n          Enable 302 redirect when possible\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n```\n\n\u003e **Note**\n\u003e \n\u003e 注意：TLS/HTTPS 暂不支持 MIPS 架构。\n\n\u003e **Note**\n\u003e \n\u003e 注意：启用 `--skip-upload-same-size` 选项虽然能加速上传但可能会导致修改过的同样大小的文件不会被上传\n\n## License\n\nThis work is released under the MIT license. A copy of the license is provided in the [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Faliyundrive-webdav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmessense%2Faliyundrive-webdav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Faliyundrive-webdav/lists"}