Admin can browse NAS files under data/local including subfolders and share
them in place. Shares use file_path=local-ref, skip storage quota, and never
delete the original file on expire.
share_text/share_file/complete_upload/presign proxy/presign confirm now
delegate quota reservation, storage writes, record creation, rollback and
chunk cleanup to service methods; handlers keep auth, request validation,
rate limiting and response wrapping. validate_file_size and
PRESIGN_SESSION_EXPIRES move to services as shared single sources.
- quota.get_storage_usage (runs on every upload) now aggregates via Sum
instead of loading every row
- dashboard simple counters (total/size/expired/active/text/chunked/used,
yesterday/today, top suffixes, recent 8) moved to SQL; the per-row health
rules engine keeps its single pass (documented)
- storage contract drops UploadFile in favor of BinaryIO (+content_type param),
completing the framework decoupling of the storage layer
- LocalFileClass.read() leaked an open fd and its handle was passed where
save_file expected UploadFile — /admin/local/share 500ed on every call;
now reads bytes via with-block and shares correctly (regression tests added)
- OneDrive save_file additionally had save_path called as a function — fixed
- opendal_scheme was read directly by the OpenDAL backend but never declared
in DEFAULT_CONFIG: selecting that backend crashed with AttributeError
- chunk_expire_hours existed only as getattr fallbacks in two modules
- refresh_settings now warns about unknown user_config keys
- meta-test scans the codebase so any future settings.X reference without a
DEFAULT_CONFIG declaration fails the suite
- apps/base/setup_wizard.py: form parsing rules, setup options, and the
two admin-facing HTML pages
- apps/base/pages.py: setup/assets/index/robots/public-config routes and
theme resolution (404 handler registered on the app in main.py)
- tests updated to import from the new modules
- add pyproject.toml with pytest config and dev dependency group (PEP 735)
- add ruff (core correctness rules) + pre-commit hook
- fix stored XSS: html.escape site config before index template injection,
with regression tests
- log previously swallowed cleanup exceptions in upload rollback paths
- consolidate three duplicate path generators into build_file_path
(also aligns chunk/presign date dirs to get_now() instead of local time)
- drop redundant ip_limit sync in load_config (refresh_settings covers all limiters)
- remove dead code (calculate_file_hash, commented-out block), two orphan
guide docs, and stale .gitignore entries
- add dependabot for pip, docker, and github-actions
- bump starlette 1.3.1 -> 1.6.0 (no breaking API changes; verified with the
full test suite plus an ASGI smoke test incl. Range downloads)
- skip theme asset tests when themes/ is not built locally
Close the remaining security gaps: validate upload content against
file signatures, rate-limit admin login failures with configurable
thresholds, and run the container as uid 1000 instead of root.
Apply the useful security fixes from PR #494 with review corrections:
validate expire_style through a shared helper, accept previous download
token window, detect SQL dialect via Tortoise capabilities, close remote
download sessions on client abort, and disable invalid CORS credentials.