feat: add CLI deployment instructions

This commit is contained in:
shuaiplus
2026-02-23 20:01:55 +08:00
parent f7a5966104
commit 2226bdd9ef
2 changed files with 42 additions and 17 deletions
+21 -9
View File
@@ -54,6 +54,27 @@ English[`README_EN.md`](./README_EN.md)
2. [![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/shuaiplus/nodewarden)
3. 打开部署后生成的链接,并根据网页提示完成后续操作。
### CLI 部署
```powershell
# 先把仓库拉到本地
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
# 部署
npx wrangler deploy
```
---
## 本地开发
@@ -64,16 +85,7 @@ English[`README_EN.md`](./README_EN.md)
npm install
npm run dev
```
## 可选:登录 TOTP2FA
- 在 Workers 的 Variables and Secrets 里新增 Secret`TOTP_SECRET`Base32)。
- 配置了 `TOTP_SECRET` 就启用登录 TOTP;删除该变量即关闭。
- 客户端流程:密码 -> TOTP 验证码。
- 支持“记住此设备”30 天。
---
## 常见问题
**Q: 如何备份数据?**