Skip to content

Commit 678a0dd

Browse files
authored
Merge branch 'rexzhang:main' into add-funding-acknowledgement
2 parents b117084 + 27f62c5 commit 678a0dd

84 files changed

Lines changed: 6932 additions & 2247 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-mypy.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: mypy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "**.py"
9+
10+
pull_request:
11+
branches:
12+
- main
13+
14+
jobs:
15+
mypy:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
# https://github.com/actions/setup-python
23+
with:
24+
python-version: "3.14"
25+
cache: "pip"
26+
27+
- name: Install packages
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y \
31+
build-essential \
32+
python3-dev \
33+
libldap2-dev \
34+
libsasl2-dev \
35+
krb5-multidev \
36+
libkrb5-dev
37+
38+
- name: Install dependencies
39+
run: |
40+
pip install -U -r requirements.d/full.txt
41+
pip install -U -r requirements.d/mypy.txt
42+
43+
- name: Run mypy
44+
run: mypy

.github/workflows/check-pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python-version: ["3.10", "3.11", "3.12", "3.13"]
19+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2020

2121
steps:
2222
- uses: actions/checkout@v4

.github/workflows/release-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
- uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.13"
23+
python-version: "3.14"
2424

2525
- name: Install system dependencies
2626
run: |

.github/workflows/release-pypi.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# - https://github.com/pypa/gh-action-pypi-publish
1+
# https://github.com/rexzhang/python-project-template/edit/main/.github/workflows/release-github.yaml
22
name: Publish package to PyPI
33

44
on:
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
environment:
1414
name: pypi
15-
url: https://pypi.org/project/ASGIWebDAV
15+
url: ${{ vars.PYPI_PROJECT_URL }}
1616
permissions:
1717
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1818
steps:
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/checkout@v5
2222
- name: Install dependencies
2323
run: |
24-
python3 -m pip install -U -r requirements/pypi.txt
24+
python3 -m pip install -U -r requirements.d/pypi.txt
2525
- name: Build wheels
2626
run: |
2727
python -m build

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ repos:
33
rev: v3.21.2
44
hooks:
55
- id: pyupgrade
6-
args: [ --py310-plus ]
6+
args: ["--py310-plus"]
77
- repo: https://github.com/psf/black
88
rev: 25.12.0
99
hooks:
1010
- id: black
11-
args: [ "--target-version", "py310" ]
11+
args: ["--target-version", "py310"]
1212
- repo: https://github.com/pycqa/isort
1313
rev: 7.0.0
1414
hooks:
@@ -18,7 +18,8 @@ repos:
1818
rev: 7.3.0
1919
hooks:
2020
- id: flake8
21-
# - repo: https://github.com/pre-commit/mirrors-mypy
22-
# rev: v1.19.0
23-
# hooks:
24-
# - id: mypy
21+
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#flake8
22+
# E203 Whitespace before ':'
23+
# E501 line too long
24+
# E704 Multiple statements on one line (def)
25+
args: ["--extend-ignore", "E203 E501 E704"]

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.13-alpine
1+
FROM python:3.14-alpine
22

33
ARG BUILD_ENV
44
ARG IMAGE_VERSION

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ An asynchronous WebDAV server implementation, Support multi-provider, multi-acco
2222
- Support optional home directory
2323
- Support store password in raw/hashlib/LDAP(experimental) mode
2424
- Full asyncio file IO
25-
- Passed all [litmus(0.13)](http://www.webdav.org/neon/litmus) test, except 3 warning
25+
- Passed all [litmus(0.13)](http://www.webdav.org/neon/litmus) test, except 1 warning(A security alert that will not be triggered in an ASGI environment.)
2626
- Browse the file directory in the browser
2727
- Support HTTP Basic/Digest authentication
2828
- Support response in Gzip/Zstd
@@ -57,6 +57,14 @@ docker run -dit --restart unless-stopped \
5757

5858
[Documentation at GitHub Page](https://rexzhang.github.io/asgi-webdav/)
5959

60+
## Contributing
61+
62+
Please refer to the [Contributing](docs/contributing.en.md) for more information.
63+
64+
## Acknowledgements
65+
66+
Please refer to the [Acknowledgements](docs/acknowledgements.md) for more information.
67+
6068
## Related Projects
6169

6270
- <https://github.com/bootrino/reactoxide>

TODO

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,74 @@
11
进行中:
2+
☐ Fix MemoryProvider with macOS finder(create new file)
3+
☐ Test big(1GB+) file in MemoryProvider
24
☐ 配置文件现代化
35
保存对 JSON 格式的支持
46
TOML 作为配置文件的第一格式
57
✔ pydantic => dataclass @done
68
✔ 添加 TOML 支持 @done
79
✔ docker 环境支持自动尝试多种配置文件后缀 @done(25-10-31)
810
✔ 默认配置文件改为 webdav.toml @done(25-10-31)
9-
☐ 自动尝试多种配置文件后缀这个行为通过命令行打开,默认不开启
11+
✔ 自动尝试多种配置文件后缀这个行为通过命令行打开 @done(25-12-20)
12+
☐ 梳理 Config 对象的使用(目的:清理代码) @wip
1013
☐ 通过配置文件实现 dev 模式的切换
1114
☐ 通过配置文件实现 litmus 模式的切换 @wip
1215
☐ 更新文档 @wip
1316
☐ 使用 TOML 方便添加注释的特性, 增加各种使用场景配置范例 @long-term
1417
☐ 以 TOML 下的可读性为标准,适当调整配置文件结构 @long-term
15-
☐ 重构 DAVResponse
16-
统一 401 的响应行为 @high @next-release
17-
浏览器请求才弹认证请求框, 服务器返回 401 时不弹认证框
18+
☐ 重构 DAVResponse @wip
19+
统一 401 的响应行为 @high @next-release @done(25-12-21)
20+
浏览器请求才弹认证请求框, 服务器返回 401 时不弹认证框 @done(25-12-22)
1821
☐ 重构部分 DAVResponse 代码, 这个与压缩依赖部分一起修改
19-
☐ 顺带解决 litmus 的一个告警?
2022
✔ 移除 brotli 压缩方法 @done(25-11-14)
2123
✔ 添加sztd支持 @done(25-11-14)
24+
✔ example 子项目代码更新 @high @done(25-12-28)
25+
✔ 测试覆盖 @done(25-12-28)
26+
☐ HTTP 范围支持
27+
✔ 断点续传支持开始和结尾,而不是只支持开始 @done(25-12-28)
28+
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests
29+
- https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Guides/Range_requests
30+
✔ - file_system._dav_response_body_generator() 更好的支持异步, block_size @done(25-12-26)
31+
✔ 请求头 Range 的完整解析 @done(25-12-26)
32+
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Range
33+
✔ 请求头 If-Range 支持(断点续传需要) @done(25-12-27)
34+
- https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Reference/Headers/If-Range
35+
✔ 响应头 Accept-Ranges 梳理 @done(25-12-27)
36+
- https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Reference/Headers/Accept-Ranges
37+
✔ 重构到一处生成 @done(25-12-27)
38+
✔ GET @done(25-12-27)
39+
✔ HEAD @done(25-12-27)
40+
✔ 响应头 Content-Range 梳理 @done(25-12-27)
41+
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range
42+
✔ 状态码支持 @done(25-12-27)
43+
✔ 206 Partial Content @done(25-12-27)
44+
✔ 416 Range Not Satisfiable @done(25-12-27)
45+
☐ 支持 multi-range
46+
✔ DAVTime 的 Web 时间格式时区应该是 GMT @high @done(25-12-29)
47+
https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Reference/Headers/Last-Modified
48+
https://datatracker.ietf.org/doc/html/rfc9110.html#field.last-modified
49+
HTTP-date
50+
RFC 1123
51+
https://datatracker.ietf.org/doc/html/rfc822#section-5
52+
✔ DAVPath 测试覆盖 @high @done(25-12-29)
53+
☐ 重构Lock 实现
54+
✔ 消除 mypy 告警 @high @done(26-01-07)
55+
✔ 状态码 423 Locked 支持 @done(26-01-06)
56+
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/423
57+
✔ 完善 litmus 测试 @done(26-01-06)
58+
LOCK on unmapped url returned 200 not 201 (RFC4918:S7.3)
59+
✔ 创建锁时, 支持 Depth.INFINITY 检查 @done(26-01-14)
60+
✔ 性能优化检查 @done(26-01-17)
61+
☐ 支持 multi-token
62+
- create_propfind_response()
63+
☐ 梳理 propfind/proppatch 等 XML 解析和生成代码 @low
64+
☐ 将 DAVPropertyBasicData.get_get_head_response_headers() 迁移到 DAVResponse
65+
☐ fileball连接会导致500错误
66+
应该是 xml 解析依赖更新导致的问题
67+
- 考虑设计一个中间件,方便在docker中可选的拦截请求和响应,以便故障分析
68+
✔ 临时方案 @done(25-12-27)
69+
☐ 重构部分 DAVRequest
70+
✔ 将部分代码执行后移,提高性能 @done(26-01-07)
71+
☐ 更好的支持静态类型检查
2272
☐ 浏览器后台(内部)界面 @low
2373
☐ info界面
2474
☐ /_/admin/INDEX
@@ -35,13 +85,12 @@
3585
/_/admin/gpw
3686

3787
长期性任务:
38-
整理好后迁移到 github issues
39-
- 更好的类型标注
40-
主要解决类型推断问题, 提高对静态类型检查工具的支持
41-
终极目标为: 能通过mypy的检查
88+
☐ 更好的类型标注
89+
- 主要解决类型推断问题, 提高对静态类型检查工具的支持
4290
- 在维护代码时顺便解决相关代码出现的类型推断错误
43-
☐ 消除 DAVRequest 相关的类型推断错误
44-
☐ 消除 DAVResponse 相关的类型推断错误
91+
☐ 终极目标:通过 mypy 检查
92+
✔ 消除 DAVResponse 相关的类型推断错误 @done(25-12-28)
93+
✔ 消除 DAVRequest 相关的类型推断错误 @done(26-01-17)
4594
- 解耦/分离可作为第三方库的核心代码和实现应用的代码
4695
降低耦合度, 让其他项目能更便捷的添加 webdav 能力
4796
终极目标为: 实现将核心代码剥离为一个独立的库
@@ -54,8 +103,8 @@
54103
✔ xmltodict v1.0.2 @done(25-12-09)
55104

56105
待实现:
106+
☐ DAVProvider._do_get_etag() 梳理
57107
☐ 基于配置,检查依赖安装情况,以便在启动时告警
58-
☐ 兼容 Py3.14 @block dataclass-wizard 不兼容 py3.14
59108
☐ 浏览器前台界面 @low
60109
☐ 更干净的目录过滤机制
61110
☐ 更好看的界面
@@ -85,8 +134,6 @@
85134
☐ 文件获取
86135

87136
待验证 bug:
88-
☐ fileball连接会导致500错误
89-
☐ 断点续传支持开始和结尾,而不是只支持开始
90137
☐ 每次切换目录时在递归遍历目录下的所有文件
91138
0.3.1 以及以前没有这个问题
92139
当请求者不是浏览器的时候不遍历目录下所有文件
@@ -102,9 +149,7 @@
102149
☐ 完善的 LDAP 支持 @high
103150
☐ display server info in page `/_/admin` or `/_/` @high
104151
☐ Fail2ban(docker) @critical
105-
☐ Fix MemoryProvider with macOS finder(create new file)
106152
☐ NFSProvider
107-
☐ Test big(1GB+) file in MemoryProvider
108153
☐ SQL database provider
109154
☐ 支持 docker health check @high, 参考 watchtowe
110155
☐ 性能优化

asgi-webdav.spec

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)