mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 13:00:39 +00:00
feat: add CLI deployment instructions
This commit is contained in:
@@ -54,6 +54,27 @@ English:[`README_EN.md`](./README_EN.md)
|
|||||||
2. [](https://deploy.workers.cloudflare.com/?url=https://github.com/shuaiplus/nodewarden)
|
2. [](https://deploy.workers.cloudflare.com/?url=https://github.com/shuaiplus/nodewarden)
|
||||||
3. 打开部署后生成的链接,并根据网页提示完成后续操作。
|
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 install
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
## 可选:登录 TOTP(2FA)
|
|
||||||
|
|
||||||
- 在 Workers 的 Variables and Secrets 里新增 Secret:`TOTP_SECRET`(Base32)。
|
|
||||||
- 配置了 `TOTP_SECRET` 就启用登录 TOTP;删除该变量即关闭。
|
|
||||||
- 客户端流程:密码 -> TOTP 验证码。
|
|
||||||
- 支持“记住此设备”30 天。
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 常见问题
|
## 常见问题
|
||||||
|
|
||||||
**Q: 如何备份数据?**
|
**Q: 如何备份数据?**
|
||||||
|
|||||||
+21
-8
@@ -57,6 +57,27 @@
|
|||||||
2. [](https://deploy.workers.cloudflare.com/?url=https://github.com/shuaiplus/nodewarden)
|
2. [](https://deploy.workers.cloudflare.com/?url=https://github.com/shuaiplus/nodewarden)
|
||||||
3. Open the generated service URL and follow the on-page instructions.
|
3. Open the generated service URL and follow the on-page instructions.
|
||||||
|
|
||||||
|
### CLI deploy
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
# Clone repository
|
||||||
|
git clone https://github.com/shuaiplus/NodeWarden.git
|
||||||
|
cd NodeWarden
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# Cloudflare CLI login
|
||||||
|
npx wrangler login
|
||||||
|
|
||||||
|
# Create cloud resources (D1 + R2)
|
||||||
|
npx wrangler d1 create nodewarden-db
|
||||||
|
npx wrangler r2 bucket create nodewarden-attachments
|
||||||
|
|
||||||
|
# Deploy
|
||||||
|
npx wrangler deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Local development
|
## Local development
|
||||||
|
|
||||||
@@ -66,14 +87,6 @@ This repo is a Cloudflare Workers TypeScript project (Wrangler).
|
|||||||
npm install
|
npm install
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
## Optional Login TOTP (2FA)
|
|
||||||
|
|
||||||
- Add Workers Secret `TOTP_SECRET` (Base32) to enable login TOTP.
|
|
||||||
- Remove `TOTP_SECRET` to disable login TOTP.
|
|
||||||
- Client flow: password -> TOTP code.
|
|
||||||
- "Remember this device" is supported for 30 days.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|||||||
Reference in New Issue
Block a user