mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 13:00:39 +00:00
7d5681665f
- Updated the deployment script to build the web application before deploying. - Upgraded Wrangler dependency from 4.61.1 to 4.69.0. feat: add import item limit and request body size limit - Introduced a new limit for the maximum total items allowed in a single import (5000). - Set a hard body size limit for JSON API endpoints (25 MB). feat: validate KDF parameters during registration and password change - Added validation for KDF parameters to ensure compliance with Bitwarden's minimum requirements. - Enhanced error handling for invalid KDF parameters during user registration and password change. feat: clean up R2 files on user deletion - Implemented cleanup of R2 files associated with user attachments and sends before deleting user metadata. feat: verify folder ownership when creating or updating ciphers - Added checks to ensure that users cannot reference folders owned by other users when creating or updating ciphers. fix: handle corrupted cipher data gracefully - Improved error handling when retrieving ciphers from the database to avoid crashes due to corrupted data. feat: increment send access count atomically - Added a method to atomically increment the access count for sends and return whether the update was successful. fix: enforce request body size limits - Implemented checks to reject oversized request bodies for non-file upload paths. fix: update error handling for database initialization - Enhanced error logging for database initialization failures while providing a generic message to clients. feat: enhance security with Content Security Policy - Added a Content Security Policy to the web application to improve security against XSS attacks. fix: remove plaintext TOTP secret from localStorage - Updated the TOTP enabling process to remove the plaintext secret from localStorage after it is stored on the server. fix: ensure only PBKDF2 hash is sent for public send access - Modified the public send access payload to ensure only the PBKDF2 hash is sent, never the plaintext password.
5.1 KiB
5.1 KiB
运行在 Cloudflare Workers 的 Bitwarden 第三方服务端,兼容官方客户
English:README_EN.md
免责声明
本项目仅供学习交流使用。我们不对任何数据丢失负责,强烈建议定期备份您的密码库。
本项目与 Bitwarden 官方无关,请勿向 Bitwarden 官方反馈问题。
与 Bitwarden 官方服务端能力对比
| 能力项 | Bitwarden | NodeWarden | 说明 |
|---|---|---|---|
| Web Vault(登录/笔记/卡片/身份) | ✅ | ✅ | 网页端密码库管理页面 |
| 文件夹 / 收藏 | ✅ | ✅ | 常用管理能力可用 |
全量同步 /api/sync |
✅ | ✅ | 已做兼容与性能优化 |
| 附件上传/下载 | ✅ | ✅ | 基于 Cloudflare R2 |
| 导入功能 | ✅ | ✅ | 覆盖常见导入路径 |
| 网站图标代理 | ✅ | ✅ | 通过 /icons/{hostname}/icon.png |
| passkey、TOTP字段 | ❌ | ✅ | 官方需要会员,我们的不需要 |
| Send | ✅ | ✅ | 已支持文本 Send 与文件 Send |
| 多用户 | ✅ | ✅ | 完整的用户管理,邀请机制 |
| 组织/集合/成员权限 | ✅ | ❌ | 没必要实现 |
| 登录 2FA(TOTP/WebAuthn/Duo/Email) | ✅ | ⚠️ 部分支持 | 仅支持 TOTP(通过 TOTP_SECRET) |
| SSO / SCIM / 企业目录 | ✅ | ❌ | 没必要实现 |
| 紧急访问 | ✅ | ❌ | 没必要实现 |
| 管理后台 / 计费订阅 | ✅ | ❌ | 纯免费 |
| 推送通知完整链路 | ✅ | ❌ | 没必要实现 |
测试情况:
- ✅ Windows 客户端(v2026.1.0)
- ✅ 手机 App(v2026.1.0)
- ✅ 浏览器扩展(v2026.1.0)
- ✅ Linux 客户端(v2026.1.0)
- ⬜ macOS 客户端(未测试)
快速开始
一键部署
部署步骤:
- 首先Fork本仓库,命名为NodeWarden
- 点击下面的一键部署按钮,修改项目名称为NodeWarden2,修改JWT_SECRET成32为随机字符串
- 部署完成后,同一页面打开workers设置,将Git存储库断开连接
- 同一位置,Git存储库链接至第一步Fork的仓库
同步上游(更新):
- 手动:Github打开你Fork的私人仓库,看到顶部同步提示时,点击 “Sync fork”。
- 自动:进入你的 Fork 仓库 → Actions,点击 “I understand my workflows, go ahead and enable them”,每天凌晨三点自动同步至上游
CLI 部署
# 先把仓库拉到本地
git clone https://github.com/shuaiplus/NodeWarden.git
cd NodeWarden
# 安装依赖
npm install
# Cloudflare CLI 登录
npx wrangler login
# 创建云资源(D1 + R2)
npx wrangler d1 create nodewarden-db
npx wrangler r2 bucket create nodewarden-attachments
# 部署
npm run deploy
# 需更新时重新拉取仓库,重新部署即可,无需创建云资源
git clone https://github.com/shuaiplus/NodeWarden.git
cd NodeWarden
npm run deploy
本地开发
这是一个 Cloudflare Workers 的 TypeScript 项目(Wrangler)。
npm install
npm run dev
常见问题
Q: 如何备份数据?
A: 在客户端中选择「导出密码库」,保存 JSON 文件。
Q: 忘记主密码怎么办?
A: 无法恢复,这是端到端加密的特性。建议妥善保管主密码。
Q: 可以多人使用吗?
A: 支持。第一个注册的用户自动成为管理员,管理员可在管理页面生成邀请码,其他用户凭邀请码注册。
开源协议
LGPL-3.0 License
致谢
- Bitwarden - 原始设计和客户端
- Vaultwarden - 服务器实现参考
- Cloudflare Workers - 无服务器平台
