6 Commits

Author SHA1 Message Date
wuzf
8fdac0e3a8 fix(otp): correct codes when local clock is inaccurate
新增无需认证且禁止缓存的 /api/time,通过多样本往返时间估算建立单调时钟锚点。

TOTP 计算改用校准时间,并处理校时、时钟跳变和跨时间窗口期间的异步竞态;同时补充状态提示、缓存恢复、API 文档及回归测试。
2026-08-09 20:19:51 +08:00
wuzf
4ad42e2bc1 chore(release): v1.5.0
Bump package manifests, README badges, and logger/monitoring defaults
to 1.5.0 covering this cycle's user-facing changes:

- New POST /api/logout with CSRF guards (X-Requested-With + Origin +
  Sec-Fetch-Site) and the sensitive rate-limit preset; frontend
  logout() always clears local state (cache, OTP timers, secrets,
  search) so users can sign out even when the server is unreachable
- Bulk import is now chunked into 100-item batches with a
  pending_backup_hash trail so large imports stay within rate limits
  and never lose backup coverage on partial failures
- Restore flow now accepts directly uploaded backup files
- P1 responsive refactor: mobile bottom-sheet modals, sort moved into
  a search-row popover, FAB consolidated to bottom-right; theme and
  PWA install entries relocated under Settings > Preferences
- Native confirm() replaced with a themed showConfirmDialog (focus
  trap, ARIA, danger variant, re-entrancy guard); body-scroll lock
  is reference-counted so stacked modals stop leaking the lock

Docs:
- API_REFERENCE.md gains the /api/logout endpoint in the public list,
  endpoint table, dedicated section, and the rate-limiting matrix
- README.md / README_EN.md mention the Sign Out entry under Settings
2026-05-03 21:22:14 +08:00
wuzf
660edd5b8a feat: restore uploaded backup files 2026-05-02 22:24:02 +08:00
wuzf
c0b8369a81 feat(backup): add unified export endpoint with format preference
Add a dedicated /api/secrets/export route (api/secrets/export.js)
that streams the unified backup format (JSON/CSV/HTML/TXT) with size
and auth guards. Settings persist the preferred export format per
user; backup runs pick it up so generated files match the chosen
schema. The UI settings label/toast reads "导出偏好格式" to clarify
the preference applies to batch export and backup export. The
Service Worker passes through offline responses, utils/backup-format.js
is slimmed down after route consolidation, and unused createdAt is
dropped from the unified format and validation.
2026-04-12 01:36:28 +08:00
wuzf
e1dfb1e30f feat(backup): add OneDrive and Google Drive sync
Add OAuth2 flows and REST clients (utils/oauth.js, utils/onedrive.js,
utils/gdrive.js) plus UI tools so backups mirror to personal cloud
drives. New /api/onedrive/* and /api/gdrive/* routes handle auth,
token refresh and push; triggerBackup() fans out to configured
providers alongside S3/WebDAV. Adds CLOUD_DRIVE_SETUP.md, validation
for the new secrets, and coverage across api/utils layers.
2026-04-11 22:26:40 +08:00
wuzf
83e9042759 feat: restructure into modular architecture with full open-source setup
- Refactor monolithic worker into layered modules (api, otp, ui, utils)
- Add Vitest test suite with 598 tests across 17 files
- Set up GitHub Actions CI/CD, Dependabot
- Add community files (CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, templates)
- Add comprehensive documentation (API reference, architecture, deployment)
- Configure ESLint, Prettier, and Husky pre-commit hooks
- Implement PWA frontend with modular scripts, styles, and service worker
2025-06-07 23:31:55 +08:00