Commit Graph
83 Commits
Author SHA1 Message Date
MarSeventh 9b6461a272 feat: support custom upload IP query API 2026-06-14 14:45:00 +08:00
MarSeventh e1349b2d1a feat: add publicUrl to hf direct upload response 2026-06-12 19:16:41 +08:00
fengyuki 908eaacce4 fix: add publicUrl to chunked upload and merge responses
Chunked upload (uploadLargeFileToTelegram) and chunk merge responses
now also include publicUrl field when urlPrefix is configured, matching
the behavior of regular uploads.
2026-06-12 03:56:08 +08:00
fengyuki cff5ebea99 feat: upload API response includes publicUrl based on urlPrefix config
When urlPrefix is configured in page settings, the upload API now
returns a `publicUrl` field in addition to the existing `src` field,
allowing clients to directly access files via the configured public
domain (e.g. R2 custom domain) without needing to reconstruct the URL.
2026-06-12 03:23:40 +08:00
MarSeventh e9cb8cbdff refactor: simplify webdav channel config fields 2026-06-03 11:17:22 +08:00
MarSeventh 9b5a3520e1 refactor: trim stored channel metadata 2026-06-02 22:04:47 +08:00
sean908 b9182fdc85 fix: prevent metadata credential leaks 2026-06-02 09:34:52 +00:00
outlook84 5c101ff052 fix: improve error handling for multipart completion target and validation 2026-06-02 14:49:15 +08:00
outlook84 6a4dcc0e26 fix: update required fields check and normalize file type handling 2026-06-02 13:33:59 +08:00
outlook84 787fd5966c feat: add completeMultipart API for handling multipart uploads 2026-06-02 13:15:17 +08:00
MarSeventh 392ef53409 refactor: move storage api utils into subdirectory 2026-04-28 17:54:43 +08:00
htazq f046b15e6a Keep WebDAV secrets out of file metadata
WebDAV upload records now store only the channel identity and object/public paths. Read, delete, move, and rename operations resolve credentials and headers from the current WebDAV channel config by ChannelName, with a legacy metadata fallback so already-created records remain usable.

Constraint: Preserve existing WebDAV object lifecycle behavior while reducing metadata exposure

Rejected: Keep credentials on every file record | expands exposure through metadata reads, backups, and logs

Confidence: high

Scope-risk: moderate

Directive: Keep WebDAV credentials in upload config/env; do not reintroduce per-file credential metadata

Tested: npm test; node deploy/worker/generate-routes.js; npx wrangler deploy --dry-run --config deploy/worker/wrangler.toml; git diff --check

Not-tested: Live WebDAV provider move/delete/read workflow
2026-04-28 09:42:03 +08:00
htazq 9c7a2b4336 Enable third-party WebDAV storage without new runtime dependencies
Cloudflare Workers and Pages already provide the Fetch/Web APIs needed for WebDAV verbs, so the storage integration uses a small local helper instead of adding a Node-oriented WebDAV client. The channel now participates in upload, read, delete, move, rename, channel listing, and runtime config, with chunked uploads explicitly guarded because WebDAV has no portable server-side compose primitive.

Constraint: Preserve Pages Functions and generated Worker deployment paths
Constraint: No new npm dependency for WebDAV client behavior
Rejected: Add a WebDAV npm client | likely Node API/compatibility and package-lock churn
Rejected: Treat WebDAV as External URL only | not a complete storage channel lifecycle
Confidence: high
Scope-risk: moderate
Directive: WebDAV here is third-party storage; keep it distinct from the built-in /dav server settings
Tested: npm test; node worker/generate-routes.js; npx wrangler deploy --dry-run --config worker/wrangler.toml; git diff --cached --check
Not-tested: Live third-party WebDAV provider credentials; Digest-only WebDAV authentication
2026-04-28 00:05:12 +08:00
MarSeventh 0a0ca51e36 fix: use createResponse in huggingface upload endpoints to include CORS headers
Replace all new Response calls in commitUpload.js and getUploadUrl.js with
createResponse from uploadTools so that responses include Access-Control-Allow-Origin
and other CORS headers, fixing cross-origin requests.
2026-04-19 16:47:37 +08:00
MarSeventh 5d34c9f0a5 fix: D1模式下分块上传失败时不保存二进制数据,避免SQLITE_TOOBIG 2026-04-19 11:17:34 +08:00
MarSeventh 4d2796f54a refactor: unify auth logic into authCore with authScope parameter
- Extract shared authentication logic into utils/auth/authCore.js
- Replace enableBasicAuth/enableAuthCode flags with clear authScope enum (ADMIN/USER/EITHER)
- Move all auth-related files into utils/auth/ subdirectory
- Eliminate duplicated admin auth logic between _middleware.js and dualAuth.js
- Fix: user session no longer grants access to admin-only endpoints
- Fix: dualAuth no longer bypasses authCode when admin is not configured
- Update all 17 import references across the codebase
- Preserve original function signatures (userAuthCheck, dualAuthCheck) for zero caller changes
2026-04-18 13:24:53 +08:00
MarSeventh c14c596889 Bug:修复偶发的HF渠道移动文件导致文件丢失的问题 2026-03-02 22:13:18 +08:00
MarSeventh 14b7a8f976 Bug:偶发的TG渠道分块上传失败问题修复 2026-03-02 00:19:37 +08:00
MarSeventh 2c1ff7241b 目录树设置和体验优化 2026-03-01 11:25:39 +08:00
MarSeventh 3dcf08e8b2 目录树设置和体验优化 2026-03-01 11:13:43 +08:00
MarSeventh 950428aaba Bug:依赖漏洞修复 2026-02-26 21:35:53 +08:00
MarSeventh 26889ae11a Feat:D1存储支持大文件分块上传 2026-02-24 21:22:56 +08:00
XMZO b6a9703641 Update chunkUpload.js 2026-02-24 19:39:57 +08:00
MarSeventh 09c18cdf10 路径安全处理逻辑优化 2026-02-24 10:52:32 +08:00
MarSeventh 65dd8ef258 上传路径识别优化 2026-02-23 16:45:27 +08:00
MarSeventh a18342354f 后端文件后缀处理逻辑优化 2026-02-23 15:27:47 +08:00
MarSeventh b3b560bf8c 路径穿越检测增强 2026-02-23 15:05:32 +08:00
MarSeventh 345ca37470 重建索引功能优化,提升安全性 2026-02-23 14:43:34 +08:00
MarSeventh bda782c141 hf渠道大文件上传优化 2026-02-23 13:44:49 +08:00
MarSeventh 8a7326eb95 v2.5.12:增加路径穿越防护 2026-02-23 13:20:42 +08:00
MarSeventh a5412af686 尺寸提取功能优化 2026-01-30 17:15:22 +08:00
MarSeventh e92a8e0ef1 update v2.5.7 2026-01-30 16:14:19 +08:00
Zhang Chao 28f13a13bd fix(s3/storage): 恢复因合并异常丢失的S3 CDN代码,导致功能失效的问题 2026-01-27 04:20:24 +00:00
MarSeventh 381f0264b0 update v2.5.4 2026-01-23 20:50:26 +08:00
zcwwww1996 2b0859058d Feat: 为 S3 存储渠道添加 CDN 加速支持
新增功能:
- 支持为 S3 渠道配置自定义 CDN 域名
- 上传时自动生成完整的 CDN 文件路径并存储到 metadata
- 读取文件时优先使用 CDN,失败时自动回退到 S3 API
- 管理面板支持配置和查看 CDN 域名
- 文件详情页面新增 S3 CDN URL 标签页
2026-01-23 19:50:11 +08:00
MarSeventh 4e67af3c26 update v2.5.3 2026-01-17 15:50:58 +08:00
MarSeventh 8ba16825c5 Feat:上传支持指定渠道名;webdav支持设置上传渠道 2026-01-10 14:31:14 +08:00
MarSeventh 04e142e671 Fix:HuggingFace渠道文件命名和读取问题 2026-01-08 19:51:34 +08:00
MarSeventh ffb65ba2f6 Feat:telegram渠道支持设置代理;优化上传设置页面使用体验 2026-01-07 17:44:33 +08:00
MarSeventh 7a83e069fe Bug:修复Discord渠道文件失效问题 2026-01-02 13:11:24 +08:00
MarSeventh 3f981ec0c9 Feat:优化访客图库展示效果,支持根目录展示;Bug:修复Telegram渠道无法关闭服务端压缩重试的问题 2026-01-01 15:57:49 +08:00
MarSeventh 8f77954999 Feat:优化上传错误处理;优化上传时清除文件的逻辑;优化Telegram渠道上传体验 2025-12-31 15:02:42 +08:00
axibayuit 86f0904aa2 feat: optimize TG chunk size to 16MB (safety margin from 20MB getFile limit) 2025-12-30 22:46:30 +08:00
axibayuit 1e92c6de82 feat(discord): implement chunked upload for large files (>20MB)
- Add uploadSingleChunkToDiscord function with rate limit handling
- Add uploadChunkToDiscordWithRetry with 429 retry support
- Add mergeDiscordChunksInfo for chunk metadata assembly
- Add handleDiscordChunkedFile for streaming download
- Add fetchDiscordChunkWithRetry for reliable chunk fetching
- Discord uses 9MB chunks (vs 10MB for others) for safety margin
- Support Range requests for video seeking
- Support proxy URL for Discord CDN
2025-12-30 22:01:19 +08:00
axibayuit b1af1a92bb feat: optimize HuggingFace upload - compute SHA256 on frontend to avoid CF Workers CPU timeout 2025-12-30 20:31:33 +08:00
axibayuit 9f3636e4fd debug: add detailed logging for HuggingFace upload 2025-12-30 18:09:09 +08:00
axibayuit 2df7e1ebea feat: add HuggingFace storage channel support
- Add HuggingFace API wrapper class (huggingfaceAPI.js)
- Support upload, download, delete operations via HuggingFace Hub API
- Support public repos (unlimited storage) and private repos (100GB limit)
- Private repos: server proxies requests with Authorization header
- Auto-create repo if not exists (with write token)
- Add HuggingFace to auto-retry channel list
- Environment variables: HF_TOKEN, HF_REPO, HF_PRIVATE
- Support load balancing for multiple HuggingFace channels
2025-12-30 17:46:11 +08:00
axibayuit 8a4e9f5fcb feat: Discord 渠道添加 Nitro 会员开关,支持 25MB 上传 2025-12-30 15:39:39 +08:00
axibayuit 9a0ab93790 feat: 添加 Discord 渠道支持
- 新增 Discord API 封装类 (discordAPI.js)
- 支持 Discord 文件上传(10MB 限制,超过自动切换其他渠道)
- 支持 Discord 文件读取和代理 URL(国内访问)
- 前端添加 Discord 渠道配置 UI(负载均衡、表单验证)
- 支持环境变量配置:DISCORD_BOT_TOKEN, DISCORD_CHANNEL_ID, DISCORD_PROXY_URL
- 修复 sysConfig.js 中 Discord 渠道过滤
2025-12-30 15:08:19 +08:00
axibayuit fdb876673f refactor: 移除不再使用的 updateQuotaCounter 函数 2025-12-29 23:23:21 +08:00