Skip to content

Commit 00a6d4e

Browse files
committed
docs: 添加环境变量
1 parent 8122f7d commit 00a6d4e

File tree

8 files changed

+303
-283
lines changed

8 files changed

+303
-283
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
### 自动部署 (推荐)
3333

34-
本项目已包含一个预先配置好的 GitHub Action 工作流,可以帮助您自动将 vMail 应用部署到 Cloudflare。
34+
本项目已包含一个预先配置好的 GitHub Action 工作流,可以帮助您自动将 Vmail 应用部署到 Cloudflare。
3535

3636
详细步骤请参考 [GitHub Action 自动部署教程](/docs/github-action-tutorial.md)
3737

@@ -63,6 +63,16 @@
6363
5. **配置电子邮件路由**
6464
在您的 Cloudflare 域名管理界面,进入 `Email` -> `Email Routing` -> `Routes`,设置一个 `Catch-all` 规则,将所有发送到您域名的邮件 `Send to a Worker`,选择您刚刚部署的 Worker。
6565

66+
### 环境变量
67+
68+
在部署到 Cloudflare Pages 时,您需要配置以下环境变量:
69+
70+
- `DATABASE_NAME`: 您的 D1 数据库名称。
71+
- `DATABASE_ID`: 您的 D1 数据库 ID。
72+
- `TURNSTILE_KEY`: 您的 Turnstile 站点密钥。
73+
- `TURNSTILE_SECRET`: 您的 Turnstile 密钥。
74+
- `COOKIES_SECRET`: 用于签名 Cookie 的密钥。
75+
6676
## 🔨 本地运行调试
6777

6878
1. **复制环境变量文件**

README_en.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This project is now fully based on Cloudflare Pages and Cloudflare D1, which gre
3232

3333
### Automatic Deployment (Recommended)
3434

35-
This project includes a pre-configured GitHub Action workflow to help you automatically deploy the vMail application to Cloudflare.
35+
This project includes a pre-configured GitHub Action workflow to help you automatically deploy the Vmail application to Cloudflare.
3636

3737
For detailed steps, please refer to the [GitHub Action Auto-Deployment Tutorial](/docs/github-action-tutorial.md).
3838

@@ -82,6 +82,16 @@ For detailed steps, please refer to the [GitHub Action Auto-Deployment Tutorial]
8282
This command starts both the frontend Vite development server and the local Wrangler Worker environment at the same time.
8383

8484

85+
### Environment Variables
86+
87+
When deploying to Cloudflare Pages, you need to configure the following environment variables:
88+
89+
- `DATABASE_NAME`: Your D1 database name.
90+
- `DATABASE_ID`: Your D1 database ID.
91+
- `TURNSTILE_KEY`: Your Turnstile site key.
92+
- `TURNSTILE_SECRET`: Your Turnstile secret key.
93+
- `COOKIES_SECRET`: A secret used to sign cookies.
94+
8595
## Community Group
8696

8797
- Discord: https://discord.gg/d68kWCBDEs

docs/github-action-tutorial.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GitHub Action 自动部署教程
22

3-
本项目已包含一个预先配置好的 GitHub Action 工作流文件 (`.github/workflows/deploy.yml`),可以帮助您自动将 vMail 应用部署到 Cloudflare Workers。
3+
本项目已包含一个预先配置好的 GitHub Action 工作流文件 (`.github/workflows/deploy.yml`),可以帮助您自动将 Vmail 应用部署到 Cloudflare Workers。
44

55
## 准备工作
66

@@ -12,16 +12,16 @@
1212

1313
前往您的 GitHub 仓库页面,点击 `Settings` -> `Secrets and variables` -> `Actions`,然后添加以下 `Repository secrets`
1414

15-
| Secret Name | 说明 | 示例值 |
16-
| :----------------- | :------------------------------------------------------------------------------------------------- | :--------------------------------- |
17-
| `CF_API_TOKEN` | Cloudflare API Token,用于授权 Wrangler 操作。请确保该 Token 具有编辑 Workers 和 D1 数据库的权限。 | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
18-
| `CF_ACCOUNT_ID` | 您的 Cloudflare 账户 ID,可以在 Cloudflare 控制台主页的右侧找到。 | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
15+
| Secret Name | 说明 | 示例值 |
16+
| :----------------- | :------------------------------------------------------------------------------------------------- | :------------------------------------- |
17+
| `CF_API_TOKEN` | Cloudflare API Token,用于授权 Wrangler 操作。请确保该 Token 具有编辑 Workers 和 D1 数据库的权限。 | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
18+
| `CF_ACCOUNT_ID` | 您的 Cloudflare 账户 ID,可以在 Cloudflare 控制台主页的右侧找到。 | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
1919
| `D1_DATABASE_ID` | 您的 D1 数据库 ID。 | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` |
20-
| `D1_DATABASE_NAME` | 您的 D1 数据库名称。 | `vmail` |
21-
| `EMAIL_DOMAIN` | 您的邮箱域名,如果多个域名请用逗号隔开。 | `vmail.dev,example.com` |
22-
| `COOKIES_SECRET` | 用于加密 Cookie 的密钥,请设置为一个随机且足够复杂的字符串。 | `a-very-strong-and-random-secret` |
23-
| `TURNSTILE_KEY` | Cloudflare Turnstile 网站密钥 (Site Key)。 | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
24-
| `TURNSTILE_SECRET` | Cloudflare Turnstile 密钥 (Secret Key)。 | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
20+
| `D1_DATABASE_NAME` | 您的 D1 数据库名称。 | `vmail` |
21+
| `EMAIL_DOMAIN` | 您的邮箱域名,如果多个域名请用逗号隔开。 | `vmail.dev,example.com` |
22+
| `COOKIES_SECRET` | 用于加密 Cookie 的密钥,请设置为一个随机且足够复杂的字符串。 | `a-very-strong-and-random-secret` |
23+
| `TURNSTILE_KEY` | Cloudflare Turnstile 网站密钥 (Site Key)。 | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
24+
| `TURNSTILE_SECRET` | Cloudflare Turnstile 密钥 (Secret Key)。 | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
2525

2626
## 触发自动部署
2727

frontend/build/client/assets/main-C4MSjDq3.js

Lines changed: 0 additions & 264 deletions
This file was deleted.

frontend/build/client/assets/main-Cj20Dz1y.js

Lines changed: 264 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/build/client/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="zh-CN">
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>vMail - 临时邮箱</title>
8-
<script type="module" crossorigin src="/assets/main-C4MSjDq3.js"></script>
7+
<title>Vmail - 临时邮箱</title>
8+
<script type="module" crossorigin src="/assets/main-Cj20Dz1y.js"></script>
99
<link rel="stylesheet" crossorigin href="/assets/main-B3RYd5Io.css">
1010
</head>
1111
<body>
1212
<div id="root"></div>
1313
</body>
14-
</html>
14+
</html>

frontend/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="zh-CN">
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>vMail - 临时邮箱</title>
7+
<title>Vmail - 临时邮箱</title>
88
</head>
99
<body>
1010
<div id="root"></div>
1111
<script type="module" src="/src/main.tsx"></script>
1212
</body>
13-
</html>
13+
</html>

0 commit comments

Comments
 (0)