750 Commits
Author SHA1 Message Date
github-actions[bot] 18d344cc9b chore(master): release 2.6.0 (#515)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v2.6.0
2026-09-14 13:47:00 +00:00
Lan 8215f91edf Merge pull request #514 from Marrrrrrrrry/fix/m0-stop-bleeding
工程化加固、安全与性能修复、API 契约统一 snake_case(含 CI 测试流水线)
2026-09-14 22:46:18 +09:00
Marrrrrrrrry 775f3fc4ce ci: add test pipeline and API contract guard
- ci.yml: ruff + pytest on push/PR, installing from the hashed lockfile
  with --require-hashes, plus a lockfile-vs-requirements consistency
  check (dependabot cannot regenerate the lockfile; drift was silent).
- test_api_contract.py: deep-scans public config, dashboard, admin file
  list and share metadata responses for camelCase keys - the regression
  net for the D7 public-config leak found during review.
2026-09-11 04:24:47 +08:00
Marrrrrrrrry 13f572a86a test: follow public-config snake_case rename in admin-address test 2026-09-11 04:11:47 +08:00
Marrrrrrrrry 800bac0128 fix: snake_case the public config contract (D7 follow-up)
build_public_config/build_public_meta served a mixed camel/snake
contract (allowedFileTypes, meta.features.*, api.legacyConfig,
limits.uploadWindowMinutes). Rename to snake_case; frontend reads
allowed_file_types only.
2026-09-11 04:09:25 +08:00
Marrrrrrrrry 8972344235 docs: rename legacy camelCase config keys to snake_case in guides
Sync zh/en guide docs with migration 007 key names (upload_size,
open_upload, enable_chunk, expire_style, error_count, etc.) so existing
deployments following the docs use the current schema.
2026-09-11 03:38:52 +08:00
Marrrrrrrrry 6e7580b8dc docs: refresh API reference - real version, snake_case fields, EN presign page
API version 2.1.0 -> 2.5.6; response examples use the single message
field; dashboard/list examples and params match current snake_case
contract; drop stale save_path from presign init response; add English
presign-upload page and sidebar entry; uploadSize -> upload_size.
2026-09-11 03:37:24 +08:00
Marrrrrrrrry c7b5eabe7c refactor: single canonical snake_case keys across admin/share APIs (D7)
Drop the message/msg envelope twin, all camel+snake dual-field response
pairs (file list/detail/policy/storage, dashboard counters, batch op
counts, status insights, presets, metadata), and camel request fields
(clearExpiredAt, downloadLimit, sortBy/sortOrder, maxChars). Stored
KeyValue JSON (metadata, presets, activities) keeps legacy-key read
fallbacks so existing deployments normalize transparently.
2026-09-11 03:10:04 +08:00
Marrrrrrrrry bb40f40a18 refactor: hoist all five upload-entry workflows into FileUploadService (2.3)
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.
2026-09-11 02:56:13 +08:00
Marrrrrrrrry a49727b63d refactor: move admin update_file orchestration into FileService (2.3) 2026-09-11 02:56:02 +08:00
Marrrrrrrrry 0038636a2a fix: serialize KeyValue JSON read-modify-write sections behind a process lock (D5)
settings/activities/view-presets are whole-blob KeyValue rows; concurrent
admin operations could silently drop each other's writes (last-writer-wins).
Single-worker deployment assumption documented; lock is process-local.
2026-09-09 19:09:14 +08:00
Marrrrrrrrry 3c93718d4b fix: FileCodes.expired_count defaults to -1 (time-based) instead of instantly-expired 0 (D4) 2026-09-09 19:05:26 +08:00
Marrrrrrrrry baecebd81e perf: dashboard counters and storage quota use SQL aggregation (D3)
- 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)
2026-09-09 19:04:12 +08:00
Marrrrrrrrry bb95017aa3 fix: save_file accepts plain binary streams; repair admin local file share (D2)
- 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
2026-09-09 18:53:31 +08:00
Marrrrrrrrry 61d72ab6cc perf: cache settings refresh behind a 2s TTL, force refresh on write paths (D6) 2026-09-09 18:47:40 +08:00
Marrrrrrrrry ec424dd909 perf: make is_config_initialized cheap — no scrypt on the per-request probe (D1) 2026-09-09 18:33:27 +08:00
Marrrrrrrrry 5121db6edc feat: rename all config keys to snake_case with DB migration 007
- 20 camelCase keys (uploadSize, expireStyle, openUpload, ...) renamed across
  DEFAULT_CONFIG, settings accessors, setup form fields, and ConfigService
- migrations_007 renames keys inside the existing settings KeyValue row,
  preserving all values for existing deployments
- schema guard meta-test keeps future keys declared
2026-09-09 18:09:19 +08:00
Marrrrrrrrry c5d525df08 feat: declare missing config keys (opendal_scheme, chunk_expire_hours) and add config schema guard
- 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
2026-09-09 17:43:28 +08:00
Marrrrrrrrry 61724cbf32 chore: warn at startup when multi-worker deployment weakens in-process rate limiting 2026-09-09 17:37:06 +08:00
Marrrrrrrrry 6587ec86be refactor: extract setup wizard and public pages from main.py (945 -> 148 lines)
- 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
2026-09-09 17:25:42 +08:00
Marrrrrrrrry 832266101e refactor: storage returns StoredDownload data; view layer builds starlette responses 2026-09-09 17:13:34 +08:00
Marrrrrrrrry ad3d319362 refactor: storage raises framework-neutral StorageError rendered identically by app handler 2026-09-09 17:07:43 +08:00
Marrrrrrrrry 892fb24ffc refactor: storage layer accepts plain StoredFile refs and caller-fetched chunk records (core/ is now ORM-free) 2026-09-09 17:05:38 +08:00
Marrrrrrrrry 3396644da3 refactor: move config and tasks modules from core to apps/base (core no longer imports apps) 2026-09-09 17:00:42 +08:00
Marrrrrrrrry 81d33b70de refactor: extract shared chunk-record fetch and hash verification into storage base class 2026-09-09 16:41:29 +08:00
Marrrrrrrrry a75936d85a refactor: use rollback_saved_file helper in presign proxy/confirm workflows 2026-09-09 16:39:42 +08:00
Marrrrrrrrry 357ab2fb6f refactor: extract FileUploadService into apps/base/services.py with shared rollback helper 2026-09-09 16:38:37 +08:00
Marrrrrrrrry 443cfe7472 feat: upgrade password hashing to memory-hard scrypt with transparent rehash
- new hashes use scrypt (n=2^14, r=8, p=1); sha256 and plaintext formats
  keep verifying unchanged, so existing deployments are unaffected
- on successful login a legacy-stored admin password is rehashed to scrypt
  in the settings KeyValue row
- add password_needs_rehash() and extend scheme detection; stdlib only, no
  new dependency
2026-09-09 16:33:07 +08:00
Marrrrrrrrry bde1fee17e docs: document lockfile regeneration flow in dependabot config 2026-09-09 16:28:36 +08:00
Marrrrrrrrry 964cba3636 chore: install dependencies from hashed lockfile in Docker build 2026-09-09 16:28:14 +08:00
Marrrrrrrrry 4904695955 chore: add hashed universal lockfile (uv pip compile --generate-hashes) 2026-09-09 16:27:38 +08:00
Marrrrrrrrry 4cab625d5a fix: validate background config as http(s) URL to close CSS quote-breakout in 2023 theme 2026-09-09 16:21:35 +08:00
Marrrrrrrrry a8c4072497 test: cover presigned upload journey (proxy mode auto-confirm, status, cancel, size limit) 2026-09-09 16:17:41 +08:00
Marrrrrrrrry 2bc278a58e test: cover merge_chunks failure modes and temp-file hygiene 2026-09-09 13:51:36 +08:00
Marrrrrrrrry 3f58e42be1 test: cover the three data-deleting cleanup tasks (expired files, stale chunks, presign sessions) 2026-09-09 13:42:11 +08:00
Marrrrrrrrry 625e50ca95 test: add end-to-end ASGI journey tests for share, chunk, and auth flows 2026-09-09 13:37:33 +08:00
Marrrrrrrrry 177a212c0f test: add shared test helpers and ASGI fixtures, dedupe 10x boilerplate
- tests/helpers.py: SettingsOverrideMixin + init_memory_db()/close_db()
- tests/conftest.py: httpx ASGI client fixtures (db, client, initialized_client)
- enable pytest asyncio_mode=auto
- replace 6 duplicated SettingsOverrideMixin copies and 4 duplicated
  Tortoise.init blocks across the legacy unittest suite
2026-09-08 17:47:21 +08:00
Marrrrrrrrry d701c6e00e chore: engineering hardening - test tooling, lint, security fix, and cleanup
- 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
2026-09-07 23:43:50 +08:00
github-actions[bot] 6c76aabe1e chore(master): release 2.5.6 (#509)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v2.5.6
2026-09-01 16:08:44 +00:00
vastsa e08555a6e8 Merge fix/prod-log-noise-20260901 2026-09-01 23:56:25 +08:00
vastsa 5537f56b88 fix(logging): reduce production log noise 2026-09-01 23:56:08 +08:00
github-actions[bot] 00f1f1d8da chore(master): release 2.5.5 (#507)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v2.5.5
2026-08-29 04:44:30 +00:00
Lan 5a7195c5c7 Merge pull request #506 from vastsa/fix/pr505-hardened
fix: harden chunk upload filename metadata
2026-08-29 12:44:06 +08:00
vastsa da1dd06655 fix(chunk-upload): persist sanitized filenames 2026-08-29 12:38:46 +08:00
vastsa d510aa7f57 Merge remote-tracking branch 'contributor/pr505' into fix/pr505-hardened 2026-08-29 12:32:00 +08:00
zhou-kkk cebac32145 fix: sanitize chunk upload file_name to prevent path traversal 2026-08-29 12:13:39 +08:00
vastsa f76d1e9841 docs: refresh readme and docs screenshots
Replace legacy PNG assets with new WebP banners and UI captures, and point Chinese/English readme plus docs pages at the updated images.
2026-07-24 16:34:24 +08:00
github-actions[bot] 287b647da1 chore(master): release 2.5.4 (#501)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v2.5.4
2026-07-23 14:35:42 +00:00
Lan fbcd4a5b2b Merge pull request #500 from vastsa/fix/docker-run-as-root
fix: run Docker as root for volume compatibility
2026-07-23 22:35:20 +08:00
vastsa fc0cbeb4f0 fix: run Docker image as root for data volume compatibility
Revert the non-root container user so existing deployments with
root-owned data volumes keep working without a manual chown step.
2026-07-23 22:35:00 +08:00