12 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
9e46357a4d docs: streamline deployment guide and fix outdated instructions (#13)
DEPLOYMENT.md 从 1445 行精简至 318 行:
- 删除「非开发者部署指南」整章,该路径本身不合理(无命令行经验的
  用户应走一键部署),且内容细至教用户按 Win+R、用记事本存盘
- 合并重复内容:设置密码流程原有 4 处、密码强度要求 3 处、
  创建 KV 命令 3 处、生成加密密钥 4 处、升级指南 2 处
- 移除 87 行「 页面正常加载」式验证清单,改为 4 行关键验证要点
- 一键部署章节删除手动创建/绑定 KV 的过时步骤(wrangler.toml 已
  声明 SECRETS_KV,首次部署自动创建)

修正过时或错误的内容:
- KV 命令改为 wrangler 4.x 语法(kv:namespace 在 4.78 下报
  Unknown arguments,正确写法是 kv namespace),同步修正
  DEVELOPMENT.md 与 build-release.js 内嵌的部署说明
- CORS 章节改写:实现是基于请求 Host 的动态同源判断,
  原文档描述的 ALLOWED_ORIGINS 常量并不存在
- 自定义域名示例补 custom_domain = true 并去掉路由通配符,
  补充「修改后需重新部署」
- 开发环境部署命令改用 npm run deploy:dev,保留版本注入流程
- 修正浏览器控制台生成加密密钥的示例(原代码产出无效 Base64)
- DEVELOPMENT.md 修正 Token 有效期为 30 天(实际值,原写 1 天)

修复失效锚点:
- DEVELOPMENT.md 目录 10 处及 docs/README.md 3 处引用,emoji
  标题在 GitHub 生成的锚点形如 #-测试指南 / #️-开发环境
2026-08-01 17:37:52 +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
c2ce6beb40 feat(backup): auto-enable cloud drive target after OAuth authorization
Authorizing a cloud drive target now automatically enables it and starts
syncing, removing the extra manual toggle step. Rewrite the setup guide
with bilingual (CN/EN) labels and add screenshots walking through the
Google Drive, OneDrive, and Cloudflare configuration flows.
2026-04-19 00:21:51 +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
e5497acfae feat(ui): responsive multi-column grid layout for secret cards
Use CSS Grid auto-fill + minmax to dynamically determine column count
based on screen width, replacing fixed 2-column layout. Widen desktop
container from 900px to 1400px. Update desktop screenshot to reflect
the new 4-column layout.
2026-04-02 21:32:53 +08:00
wuzf
63e1d72567 docs: add upgrade and troubleshooting notes 2026-03-29 22:23:23 +08:00
wuzf
80043671bb feat(config): declare SECRETS_KV binding and update upgrade docs
Explicitly declare SECRETS_KV in wrangler.toml so Git auto-build
deployments can auto-create or reuse the linked KV resource. Update
README and DEPLOYMENT to reflect that Sync Upstream now auto-merges
wrangler.toml instead of requiring manual review.
2026-03-21 22:43:42 +08:00
wuzf
3eed220d12 docs: standardize in-place upgrade flow 2026-03-15 22:46:07 +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