From 64be43e6dfdbe2ac7f56eaf0bcfe020eef8f1fc4 Mon Sep 17 00:00:00 2001 From: oiov Date: Mon, 13 May 2024 13:32:55 +0800 Subject: [PATCH] docs: upd sql create step --- README.md | 4 ++++ docs/receive-tutorial.md | 50 ++++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index c6d69eb..a9df40b 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,10 @@ pnpm run remix:dev 运行前复制 `apps/remix/.env.example` 文件并重命名为 `apps/remix/.env`,填写必要的环境变量。 +## 🌈 下一步计划 + +- [ ] 使用 [Cloudflare D1](https://developers.cloudflare.com/d1/) 数据库重构,简化部署流程 + ## ❤️ 交流群 有任何问题或意见,欢迎加入交流群讨论。 diff --git a/docs/receive-tutorial.md b/docs/receive-tutorial.md index 72fe281..d7091ef 100644 --- a/docs/receive-tutorial.md +++ b/docs/receive-tutorial.md @@ -8,28 +8,7 @@ 然后,创建一个名为 `emails` 的表。 -选择您的数据库,您会看到“编辑表”按钮,点击并进入: - -![](https://img.inke.app/file/d49086f9b450edd5a2cef.png) - -> ⚠️ 注意:**左上角有一个加号按钮,我尝试点击它没有任何提示或效果,所以我使用了 turso 提供的 cli 来初始化表。** - -Cli 文档:https://docs.turso.tech/cli/introduction - -Linux (或 mac/windows) 终端执行: - -```bash -# 安装(安装后记得重启终端生效) -curl -sSfL https://get.tur.so/install.sh | bash - -# 登录账户 -turso auth login - -# 连接到您的Turso数据库 -turso db shell -``` - -将sql脚本复制到终端运行(packages/database/drizzle/0000_sturdy_arclight.sql) +选择您的数据库,您会看到“编辑表”按钮,点击并进入,继续点击左上角的 `SQL runner` 按钮,将[sql脚本](https://github.com/oiov/vmail/blob/main/packages/database/drizzle/0000_sturdy_arclight.sql)复制到终端运行:
查看脚本内容 @@ -59,8 +38,34 @@ turso db shell
+
+手动创建表(旧版方法) +![](https://img.inke.app/file/d49086f9b450edd5a2cef.png) +> ⚠️ 注意:**左上角有一个加号按钮,我尝试点击它没有任何提示或效果,所以我使用了 turso 提供的 cli 来初始化表。** +Cli 文档:https://docs.turso.tech/cli/introduction +Linux (或 mac/windows) 终端执行: +```bash +# 安装(安装后记得重启终端生效) +curl -sSfL https://get.tur.so/install.sh | bash +# 登录账户 +turso auth login +# 连接到您的Turso数据库 +turso db shell +``` +
+ **2.部署 email worker** +需要准备 Node 环境(推荐 18.x 及以上),并且需要安装 wrangler cli 并在本地登录 (登录时建议开启VPN) + +```bash +# 安装 pnpm +npm install -g pnpm + +# 安装 wrangler cli, 参考 https://developers.cloudflare.com/workers/wrangler/install-and-update +npm install wrangler --save-dev +``` + ```bash git clone https://github.com/oiov/vmail @@ -83,7 +88,6 @@ pnpm install ```bash cd apps/email-worker -# 需要 Node 环境,并且需要安装 wrangler cli 并在本地登录,参考 https://developers.cloudflare.com/workers/wrangler/install-and-update pnpm run deploy ```