Commit Graph
20 Commits
Author SHA1 Message Date
MarSeventh 39ae1a7407 feat: configure image resizing in security settings 2026-07-28 11:54:01 +08:00
MarSeventh 9b6461a272 feat: support custom upload IP query API 2026-06-14 14:45:00 +08:00
MarSeventh 6e90b6bf3a fix: clamp session max age before KV write 2026-06-09 18:56:44 +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 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 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 2c1ff7241b 目录树设置和体验优化 2026-03-01 11:25:39 +08:00
MarSeventh 3dcf08e8b2 目录树设置和体验优化 2026-03-01 11:13:43 +08:00
MarSeventh 99e1443102 v2.6.1:增加文件夹候选项;部分安全和体验优化 2026-02-28 16:50:46 +08:00
MarSeventh 0d722b97bd Feat:移除官方图像审查渠道 2025-12-18 19:08:55 +08:00
MarSeventh 19856a0e87 Bug:修复APITokens保存失效问题 2025-09-15 22:58:08 +08:00
初衷 dbea752676 fix:所有模块导入/导出的兼容性问题 2025-08-13 19:09:01 +08:00
初衷 a49c1b75a3 fix:语法兼容性修复 2025-08-13 18:12:11 +08:00
初衷 e901a08af9 feat:现有的 KV 存储数据迁移到 D1 数据库 2025-08-13 16:26:04 +08:00
MarSeventh bab8dd35a6 Feat:支持备份和恢复;支持APIToken鉴权;支持指定部分默认上传设置 2025-07-31 16:22:25 +08:00
MarSeventh be81a8b170 优化部分页面显示效果;登录密码增加有效性检查 2025-06-27 21:06:24 +08:00
MarSeventh fa2dc202ac Bug:白名单设置不生效 2025-06-25 14:51:42 +08:00
MarSeventh 132cb96040 Feat:支持nsfwjs审查渠道 2025-06-22 22:50:24 +08:00
MarSeventh 1ea5e16634 v2beta 2025-02-06 18:18:39 +08:00