54 Commits
Author SHA1 Message Date
vastsa 93a30a257c feat: mint extract codes from data/local without re-upload
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.
2026-09-16 18:31:00 +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 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 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 832266101e refactor: storage returns StoredDownload data; view layer builds starlette responses 2026-09-09 17:13:34 +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 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 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
vastsa da1dd06655 fix(chunk-upload): persist sanitized filenames 2026-08-29 12:38:46 +08:00
vastsa eda0a3127a fix: add magic-byte checks, login rate limits, and non-root Docker
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.
2026-07-23 22:23:04 +08:00
Lan ae7702603a Merge pull request #496 from vastsa/fix/pr494-security-patches
fix: harden share expiry, download token, quota SQL, and CORS
2026-07-23 19:41:40 +08:00
vastsa a41693f90d fix: harden share expiry, download token, quota SQL, and CORS
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.
2026-07-23 19:38:50 +08:00
monlor f2277e1649 support text direct downloads 2026-07-15 15:12:24 +08:00
Lan 818dd47b2a feat: add global storage capacity limit 2026-07-11 17:50:26 +08:00
Lan 8d7d856c62 fix: harden share retrieval and admin visibility (#482, #480) 2026-07-10 17:39:53 +08:00
Lan c1fb802223 fix: #473 normalize retrieve codes before lookup 2026-06-05 11:40:11 +08:00
Lan aa6904a12c fix: #465 restrict uploads by allowed file types 2026-06-05 11:29:37 +08:00
Lan 78b1dbe81f feat: add retrieve metadata endpoint 2026-06-03 03:17:01 +08:00
Lan 6fe68be2dd fix: support legacy presign proxy upload URLs 2026-06-03 02:57:29 +08:00
Lan 75d345e5d0 fix: accept form payloads for chunk uploads 2026-06-03 02:24:08 +08:00
Lan e80be564a5 fix: https://github.com/vastsa/FileCodeBox/issues/362 2026-01-07 19:50:02 +08:00
Lan 8e57a497f7 feat: 支持S3预签名上传 2025-12-31 03:25:09 +08:00
Lan e854eb068c fix: 自动清理过期的chunk 2025-12-01 15:24:47 +08:00
Lan c1966b3942 feat: s3适配切片上传 2025-12-01 15:13:33 +08:00
Lan bd6f646f5d fix: some error 2025-12-01 11:30:52 +08:00
Lan bdab5bb375 feat:code style 2025-07-05 00:02:04 +08:00
Lan a65cf32214 revert: 取消秒传 2025-03-01 11:20:37 +08:00
Lan c4e398bd31 fix: share auth 2025-02-25 22:55:42 +08:00
Lan fdada809d9 wip: 切片上传、文件秒传、断点续传陆续适配中当前进度(本地存储已适配) 2025-02-23 20:49:51 +08:00
Lan 1ff1d6c695 style: code format 2025-02-15 22:00:53 +08:00
Lan 037949b715 feat: 新增webdav存储 2025-02-09 20:25:23 +08:00
Lan efbfec2471 fix: 页面二维码和预览文本 2024-11-28 19:08:44 +08:00
Lan cc3a521d31 refact: some codes 2024-10-06 17:14:16 +08:00
Jialin0502 8d62f6ec33 文本分享后端大小限制,文件限制返回为MB形式 2024-07-28 21:59:21 +08:00
lan fafc56bc32 fix: issue #186 2024-07-28 19:03:37 +08:00
lan e421ab93bc update:存储改成单例模式,修复读取问题 2024-06-18 23:04:52 +08:00
vastsa af83340bc0 fix:文件大小变成字符串 2024-06-17 17:16:12 +08:00
lan 8eac6ed9fa feat: 重写settings,放弃env存储,改到数据库 2024-06-15 20:06:14 +08:00
lan 8215ef9e4b fix: 修复文本取件问题 2024-05-06 13:02:00 +08:00
buyfakett 3563b86b82 后端移动文件夹,前端在docker中编译,进一步减小镜像大小 2024-05-02 00:29:33 +08:00
Yanlongli 2b3c5242df fix: 阻止按日期授权时剩余次数无限减少 2024-03-29 14:23:12 +08:00
lan 4e9d859ab0 fix: 按单次取件过期问题 2024-01-11 17:51:05 +08:00
lan d5659ebc9c update:images 2023-12-06 08:37:33 +08:00
lan 16171ad0ed add:通过接口直接下载文件,方便终端取件 2023-09-12 22:25:42 +08:00
silver-ymz a198886d11 feat: support server transfer for opendal
Signed-off-by: silver-ymz <yinmingzhuo@gmail.com>
2023-08-24 14:04:00 +08:00
lan d91d64cad5 update:自动删除过期文件 2023-08-15 22:37:54 +08:00
lan 824d6e7cf2 update:重构基本完成 2023-08-15 21:33:58 +08:00
lan 6f4ccf78e3 update:文件大小限制 2023-08-15 20:40:25 +08:00