Commit Graph
100 Commits
Author SHA1 Message Date
MarSeventh 34167e28fe chore: fix a colon mistake in readme 2026-06-01 21:15:10 +08:00
MarSeventh 92fbd0260e fix: keep HuggingFace ranges unchanged 2026-05-30 18:04:18 +08:00
MarSeventh 399e3d35a7 fix: limit HuggingFace open-ended ranges 2026-05-30 17:46:20 +08:00
MarSeventh ef9c14163b revert: undo HuggingFace range streaming changes 2026-05-30 17:25:21 +08:00
MarSeventh 8c083db63a fix: stabilize HuggingFace range responses 2026-05-30 17:17:18 +08:00
MarSeventh 4ebe607f6a fix: improve HuggingFace range streaming 2026-05-30 16:44:59 +08:00
MarSeventh f81826dbf1 bump version to v2.7.3 2026-05-25 15:43:02 +08:00
MarSeventh f13424bae7 feat: Dashboard file rename dialog now supports confirming with Enter 2026-05-25 15:32:51 +08:00
MarSeventh a27405a237 feat: add upload trending in status page 2026-05-25 13:05:05 +08:00
MarSeventh 84246a2210 feat: add upload trend stats 2026-05-25 12:50:04 +08:00
MarSeventh 22e7e64610 readme: add G-Star badge 2026-05-22 14:40:52 +08:00
MarSeventh 459d32cb5a readme: add G-Star badge 2026-05-22 14:38:54 +08:00
MarSeventh 36d38f7ba4 readme: add hellogithub badge 2026-05-09 17:18:27 +08:00
MarSeventh 33daaef77d readme: add hellogithub badge 2026-05-09 17:17:07 +08:00
MarSeventh cedf224b14 readme: add hellogithub badge 2026-05-09 17:15:13 +08:00
MarSeventh c91f778d44 readme: add hellogithub badge 2026-05-09 17:13:27 +08:00
MarSeventh 3a6fc7f9fe readme: add hellogithub badge 2026-05-09 17:08:33 +08:00
MarSeventh fa4be36ebf fix: wrap Docker server responses with native Response 2026-05-06 16:41:16 +08:00
MarSeventh 0ba1b63c9d fix: PROPFIND file size fallback for old files and use real upload timestamp
- File size: prefer FileSizeBytes, fall back to FileSize (MB) * 1024^2
  for files uploaded before FileSizeBytes was added
- Timestamps: use TimeStamp from metadata instead of current time,
  so clients show the actual upload date, not the PROPFIND request time
2026-05-01 20:53:21 +08:00
MarSeventh 476827c009 fix: add getcontenttype to PROPFIND response for file preview in Alist
Read FileType from metadata to populate D:getcontenttype (e.g.
image/jpeg), enabling WebDAV clients like Alist to identify file
types and show image previews.
2026-05-01 20:41:19 +08:00
MarSeventh c2e4de5b8c fix: PROPFIND returns correct file size and href for WebDAV clients
- Read FileSizeBytes instead of non-existent File-Size metadata field,
  so getcontentlength reports actual bytes instead of always 0
- Add /dav prefix to file href so WebDAV clients can GET files at the
  correct path

Fixes files showing as 0B and being unopenable in RaiDrive, Cyberduck,
and Windows mapped drives.
2026-05-01 20:36:07 +08:00
MarSeventh 18b2db1224 fix: WebDAV internal calls use dedicated API Token for authentication
- Add 'internal' token type to API Token system, hidden from the
  security settings token list
- When WebDAV is enabled, auto-create an internal API Token with
  list/upload/delete permissions, stored in WebDAV config
- When WebDAV is disabled, auto-delete the internal token
- WebDAV handler reads the internal token from config and sends it
  as Bearer auth; if missing, creates one on-the-fly as fallback
- Works across both Docker and Cloudflare deployments since the
  token is persisted in KV/D1, not in process memory
2026-05-01 20:27:37 +08:00
MarSeventh bab238a6dc fix: catch-all [[path]].js route matching off-by-one for root paths
The loop in findFunctionFile started from parts.length - 1, which
skipped the directory-level [[path]].js match when the request path
had exactly one segment (e.g. /dav/, /file/). Changed to start from
parts.length so these root paths correctly resolve to their handlers.

Fixes /dav/ returning 404 and /file/ similarly affected.
2026-05-01 19:24:57 +08:00
MarSeventh 99a8f8d9c5 fix: reduce customer config list load
Return only customer summaries from the list endpoint and lazy-load per-IP files to avoid sending full upload records on every page load.
2026-04-29 16:53:58 +08:00
MarSeventh 7b1211d181 readme: uniform sponsor name 2026-04-29 16:16:23 +08:00
MarSeventh 7823315b44 fix: reduce manage mutation response payloads 2026-04-29 16:04:36 +08:00
MarSeventh 8a479f75ca fix: prevent cached manage API mutations 2026-04-29 15:59:03 +08:00
MarSeventh 6cec90176b fix: require admin auth for file preview
Treat from=admin as an admin preview marker that requires validated admin credentials, and keep admin preview responses privately cached.
2026-04-29 15:18:31 +08:00
MarSeventh 7d01d04547 fix: skip records without timestamps in batch list 2026-04-28 23:25:22 +08:00
MarSeventh 2dbc1ea232 refactor: simplify saving logic of upload config in sysCog API 2026-04-28 21:30:37 +08:00
MarSeventh 36f886b1d7 readme: add more support channels 2026-04-28 20:57:03 +08:00
MarSeventh 9004ed86cb readme: add more support channels 2026-04-28 20:47:38 +08:00
MarSeventh 30dad1f599 readme: add more support channels 2026-04-28 20:38:52 +08:00
MarSeventh 495a0d1b81 readme: add more support channels 2026-04-28 20:35:14 +08:00
MarSeventh c7a0370928 readme: add more support channels 2026-04-28 20:33:29 +08:00
MarSeventh ab3b55567c readme: add more support channels 2026-04-28 20:26:01 +08:00
MarSeventh e5a38f2b6d test: remove webdav test files 2026-04-28 17:56:53 +08:00
MarSeventh 392ef53409 refactor: move storage api utils into subdirectory 2026-04-28 17:54:43 +08:00
MarSeventh 8290321dd6 fix: disappeared custom header setting for webdav channel 2026-04-28 17:47:44 +08:00
MarSeventh ba4081b288 bump version to v2.7.2 2026-04-28 17:06:46 +08:00
MarSeventh 9d84a0b34a fix: migrate session storage to manage@ prefix and fix D1 adapter routing
- Change SESSION_PREFIX from 'session@' to 'manage@session@' to prevent
  sessions from appearing in file index and backups
- Add KV expirationTtl for automatic session cleanup on expiry
- Fix D1 adapter: route all manage@ keys to settings table instead of
  files table (fixes blockipList and session storage in wrong table)
- Fix D1 list({ prefix: 'manage@' }) not matching settings table
  (fixes backup not containing settings data)
- Exclude manage@session@ keys from settings backup export
2026-04-28 17:04:41 +08:00
MarSeventh 062a71213d feat: add webdav upload channel 2026-04-28 16:38:12 +08:00
MarSeventh 322cf49532 build: update frontend dist (login keyboard avoidance rework + mobile spacing optimization) 2026-04-27 15:40:55 +08:00
MarSeventh e50ff0e16f chore: update static media asset paths 2026-04-26 19:34:03 +08:00
MarSeventh 28d0827f19 Merge branch 'dev' 2026-04-26 18:17:11 +08:00
MarSeventh 59790e3422 chore: update github actions runtime versions 2026-04-26 18:14:32 +08:00
MarSeventh 3d23462dfc chore: update github actions runtime versions 2026-04-26 18:09:42 +08:00
MarSeventh ab23ee76ae Move deployment adapters under deploy 2026-04-26 17:46:38 +08:00
MarSeventh 3a15fc0792 fix: add Pages context compatibility for worker routes 2026-04-26 16:51:56 +08:00
MarSeventh 92f60ecdd8 refactor: move wrangler.worker.toml into worker/ directory
- Rename to worker/wrangler.toml
- Update all paths (main, assets directory) to be relative to worker/
- Update package.json, workflow, generate-toml.js, .dockerignore
- Fix .gitignore to only ignore root wrangler.toml
2026-04-25 20:31:41 +08:00
MarSeventh b70d0a6f89 fix: remove redundant checkDatabaseConfig from manage middleware
Already executed by parent api/_middleware.js in the chain.
2026-04-25 19:09:58 +08:00
MarSeventh 842d4cea9d chore: remove outdated .worker-assets comment from wrangler.worker.toml 2026-04-25 18:08:25 +08:00
MarSeventh 8a334a850e refactor: move static/readme to root level, remove empty static/ 2026-04-25 18:02:34 +08:00
MarSeventh e5a4d3f6c2 chore: exclude unnecessary files from Docker image 2026-04-25 17:59:55 +08:00
MarSeventh 83300a9b7b chore: remove duplicate static assets from outer static/ 2026-04-25 17:58:25 +08:00
MarSeventh a48c4499b8 fix: add static assets (404/block/whitelist images) to frontend-dist 2026-04-25 17:55:51 +08:00
MarSeventh e37125c71c feat: skip Worker deployment when CLOUDFLARE_API_TOKEN not configured 2026-04-24 23:53:47 +08:00
MarSeventh 7c22e0ccdb fix: remove secrets check from job-level if (not allowed by GitHub Actions) 2026-04-24 20:22:41 +08:00
MarSeventh 41e8bdd3f1 refactor: use github.event.repository.fork instead of hardcoded repo name 2026-04-24 20:17:58 +08:00
MarSeventh c56a0e0ec3 feat: support WORKER_NAME from secrets for push-triggered deploys 2026-04-24 20:12:57 +08:00
MarSeventh a03d2f3135 feat: support WORKER_NAME from secrets for push-triggered deploys 2026-04-24 20:10:44 +08:00
MarSeventh 35125655ca feat: auto-deploy Workers on main branch push
- Add push trigger on main branch (works with sync.yml)
- Skip deployment on original repo and forks without secrets
2026-04-24 20:09:18 +08:00
MarSeventh 336963b7f2 fix: update generate-toml.js assets directory to frontend-dist 2026-04-24 19:22:46 +08:00
MarSeventh 4f629eab7e docs: add v2.7.1 build output directory change notice to README 2026-04-24 19:11:58 +08:00
MarSeventh 106a5c9ecf chore: remove worker-assets from .gitignore 2026-04-24 19:04:37 +08:00
MarSeventh ba81e1b814 refactor: remove prepare-assets, point wrangler directly to frontend-dist
- Delete worker/prepare-assets.js
- wrangler.worker.toml assets directory → frontend-dist
- Remove prepare-assets step from workflow and deploy script
- Remove .worker-assets from .gitignore
2026-04-24 19:01:42 +08:00
MarSeventh 010dc9f82c refactor: update paths for frontend-dist directory
- Pages dev: serve from frontend-dist/ instead of root
- Docker server: static files and index.html from frontend-dist/
- Worker prepare-assets: copy frontend-dist/ directly to .worker-assets/
2026-04-24 18:59:45 +08:00
MarSeventh 36c13fbc8f refactor: move Docker-only deps to optionalDependencies
- Move better-sqlite3, hono, @hono/node-server to optionalDependencies
- Worker workflow uses --omit=optional instead of --ignore-scripts
- Docker/Pages install still gets all packages as before
2026-04-24 18:55:39 +08:00
MarSeventh 4ad766266d bump version to v2.7.1 2026-04-24 17:34:28 +08:00
MarSeventh f64292817b docs: update WORKER_VARS comment in workflow 2026-04-24 17:31:09 +08:00
MarSeventh 051fb4fd32 chore: minor comment update in deploy-worker workflow 2026-04-24 17:17:39 +08:00
MarSeventh 12f89d0b99 feat: add Cloudflare Workers deployment support
- worker/index.js: auto-generated route adapter for Workers
- worker/generate-routes.js: scans functions/ to generate routes
- worker/generate-toml.js: generates wrangler config from env vars
- worker/prepare-assets.js: collects frontend assets for deployment
- .github/workflows/deploy-worker.yml: GitHub Actions workflow
- wrangler.worker.toml: template config for local deployment
2026-04-24 17:06:56 +08:00
MarSeventh 7a710e586e bump version to v2.6.7 2026-04-21 11:02:31 +08:00
MarSeventh 61f210e0cb feat: 会话安全策略 - 后端支持动态 Secure/MaxAge 配置
- 扩展 getSecurityConfig 和 fetchSecurityConfig 默认值,新增 sessionSecure、userSessionMaxAge、adminSessionMaxAge 字段
- 改造 buildSessionCookie 支持 secure 参数
- createSession 根据 authType 动态读取配置计算 maxAge
- destroySession 读取 sessionSecure 确保清除 Cookie 属性一致
2026-04-21 10:58:54 +08:00
MarSeventh 252a62a2fc docs: add desktop software link in readme 2026-04-20 10:39:37 +08:00
MarSeventh 9d0cc7d2b8 fix: remove Secure flag from session cookie for HTTP Docker compatibility 2026-04-19 20:16:36 +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 3f995f6820 fix: sessionCheck adminRequired should also consider password-only config 2026-04-18 16:23:20 +08:00
MarSeventh 876e94b790 refactor: extract rehashIfNeeded to passwordHash.js, deduplicate login rehash logic 2026-04-18 15:35:13 +08:00
MarSeventh 56464b68e4 fix: return explicit authType instead of null when auth is unconfigured
- checkAdmin: return 'admin' when admin auth not configured
- checkUser: return 'user' when authCode not configured
- directoryTree: use authType !== 'admin' to gate user-only checks
2026-04-18 15:28:01 +08:00
MarSeventh f7ab7843ed refactor: split authCore into checkAdmin/checkUser, extract API Token to public layer 2026-04-18 15:15:31 +08:00
MarSeventh b45867920b refactor: split authCore into checkAdmin/checkUser, extract API Token to public layer 2026-04-18 15:05:49 +08:00
MarSeventh 7ef317265f refactor: remove Basic Auth, add /api/auth/adminLogin endpoint
- Remove Basic Auth (verifyBasicAuth, parseBasicAuth) from authCore.js
- Add /api/auth/adminLogin POST endpoint for admin login via JSON body
- Delete legacy /api/manage/check, login, logout (no longer referenced)
- Fix adminConfigured to consider password-only config
2026-04-18 14:49:01 +08:00
MarSeventh cb4720bdf4 bump version to v2.6.6 2026-04-18 14:00:14 +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 636f23375a security: upgrade password hashing to PBKDF2 and fix API token generation
- Replace single-round SHA-256 with PBKDF2 (100k iterations) via Web Crypto API
- Auto-rehash old SHA-256/plaintext passwords to PBKDF2 on successful login
- Add timing-safe comparison to prevent timing attacks
- Replace Math.random() with crypto.getRandomValues() for API token and token ID generation
- Maintain full backward compatibility with existing SHA-256 hashes and plaintext passwords
2026-04-18 00:45:04 +08:00
MarSeventh 531ee40f57 fix: delete unauthorized pop-up when first logging in 2026-04-18 00:22:05 +08:00
MarSeventh a6b202c328 fix: redundant pop-up when changing admin password 2026-04-18 00:04:03 +08:00
MarSeventh 91603e47d3 v2.6.5:improve auth security 2026-04-17 23:54:42 +08:00
MarSeventh d193d06b9f merge: session-based auth with password hashing 2026-04-17 23:50:58 +08:00
MarSeventh 61181b54ed refactor: move auth endpoints to /api/auth/ subdirectory
- login.js -> auth/login.js (/api/auth/login)
- logout.js -> auth/logout.js (/api/auth/logout)
- sessionCheck.js -> auth/sessionCheck.js (/api/auth/sessionCheck)
- resetAuth.js -> auth/resetAuth.js (/api/auth/resetAuth)
- Update import paths in moved files
2026-04-17 23:46:24 +08:00
MarSeventh b3f8a03ec3 feat: add /api/resetAuth endpoint for password recovery
Allows resetting all auth config when locked out:
- Requires RESET_KEY environment variable to be set
- GET /api/resetAuth?key=YOUR_RESET_KEY
- Clears security config from database (falls back to env vars)
- Destroys all active sessions
2026-04-17 23:37:11 +08:00
MarSeventh 298897edf4 fix: use ?? for config fallback, add clear password support and auth-required check
- Fix getSecurityConfig: use ?? instead of || so empty string is preserved
- Handle _clear flag to explicitly remove passwords
- Clear adminUsername together with adminPassword on _clear
- sessionCheck now returns adminRequired/userRequired fields
- Return 200 instead of 401 from sessionCheck for frontend to decide
2026-04-17 23:32:27 +08:00
MarSeventh 62c5aa0eed feat: session-based auth with password hashing
- Add passwordHash.js: SHA-256 + salt hashing with plaintext backward compatibility
- Add sessionManager.js: HttpOnly cookie sessions with separate admin_session/user_session
- Add sessionCheck.js: session validation endpoint for frontend route guards
- Add logout.js: session destruction endpoint with authType support
- Update login.js: return user_session cookie on successful login
- Update check.js: return admin_session cookie on successful admin auth
- Update _middleware.js: check admin_session before Basic Auth, remove WWW-Authenticate header
- Update security.js: hash passwords on save, mask in GET, clear sessions on password change
- Update dualAuth.js/userAuth.js: use verifyPassword and session validation
2026-04-17 23:11:45 +08:00
MarSeventh 02aa72aade opt:add smooth transition for the sidebar in sysconfig page 2026-04-03 00:17:20 +08:00
MarSeventh b1f6c0c92d Opt:optimize language toggle visuals;improve background transition smoothness 2026-03-29 00:01:03 +08:00
MarSeventh 298a09661a Fix:something missed in upload page 2026-03-28 22:26:23 +08:00
MarSeventh cfeb5d9dad v2.6.4: Add i18n support 2026-03-28 22:12:06 +08:00
MarSeventh e3befa3ab0 docs: swap README - English as default, Chinese as README_zh.md 2026-03-28 22:10:07 +08:00