From 18a955878c10743bba3da9c72671d3279c8d97df Mon Sep 17 00:00:00 2001 From: 619dev <86543624+619dev@users.noreply.github.com> Date: Thu, 26 Mar 2026 02:34:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=B4=E6=98=8E=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 26 ++++++++++++++++++++++---- README_EN.md | 26 ++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6921af3..730a714 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,27 @@ ## 快速启动 +### 方式零:Zeabur 一键云部署 + +[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/P2J7Y3?referralCode=619dev) + +> [!NOTE] +> 部署完成后需手动完成一步配置,否则注册/登录无法使用: +> 1. 进入 Zeabur 控制台 → **server 服务** → Environment Variables → 复制 `ZEABUR_WEB_URL` 的值(如 `http://10.43.x.x:3000`) +> 2. 进入 **client 服务** → Environment Variables → 添加变量 `SERVER_URL` = 上一步复制的值 +> 3. Restart client 服务 + +**已知注意事项:** +- 首次启动 server 会自动创建数据库表(`CREATE TABLE IF NOT EXISTS`),无需手动导入 schema +- Redis 在集群内无需密码,已默认关闭认证 +- 若需配置 MySQL root 密码,可在 server 服务的 `DB_PASS` 里手动填写 MySQL 服务的 `MYSQL_ROOT_PASSWORD` + +--- + ### 方式一:Docker Compose(推荐,无需本地构建) ```bash -# 克隆仓库(仅需配置文件,镜像直接从 Docker Hub 拉取) +# 克隆仓库 git clone && cd paperphone # 复制并编辑环境变量 @@ -74,18 +91,19 @@ open http://localhost > 镜像已发布至 Docker Hub: > - `facilisvelox/paperphone-client:latest` > - `facilisvelox/paperphone-server:latest` +> +> **注意**:server 首次启动会自动初始化数据库 schema,无需手动导入 SQL 文件。 ### 方式二:本地手动启动 #### 1. 准备环境 ```bash -# MySQL 创建数据库 -mysql -u root -p < server/db/schema.sql - # 复制并编辑环境变量 cp server/.env.example server/.env # 填写 DB_HOST / DB_PASS / REDIS_HOST / MINIO_* 等 + +# 注:server 首次启动会自动执行 schema.sql,无需手动导入 ``` #### 2. 启动后端 diff --git a/README_EN.md b/README_EN.md index 28af98b..e52bf5b 100644 --- a/README_EN.md +++ b/README_EN.md @@ -51,10 +51,27 @@ Cryptographic Layer ## Quick Start +### Option 0: Zeabur One-Click Cloud Deploy + +[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/P2J7Y3?referralCode=619dev) + +> [!NOTE] +> One manual step is required after the template deploys, otherwise login/register won't work: +> 1. Go to Zeabur Console → **server service** → Environment Variables → copy the value of `ZEABUR_WEB_URL` (e.g. `http://10.43.x.x:3000`) +> 2. Go to **client service** → Environment Variables → add variable `SERVER_URL` = the value copied above +> 3. Restart the client service + +**Known notes:** +- On first startup, the server automatically creates all database tables (`CREATE TABLE IF NOT EXISTS`) — no manual SQL import needed +- Redis runs without a password inside the cluster (intra-cluster network isolation is sufficient) +- If MySQL access is denied, manually set `DB_PASS` on the server service to the value of `MYSQL_ROOT_PASSWORD` from the MySQL service + +--- + ### Option 1: Docker Compose (Recommended — no local build needed) ```bash -# Clone the repository (config files only; images are pulled from Docker Hub) +# Clone the repository git clone && cd paperphone # Copy and edit environment variables @@ -74,18 +91,19 @@ open http://localhost > Pre-built images on Docker Hub: > - `facilisvelox/paperphone-client:latest` > - `facilisvelox/paperphone-server:latest` +> +> **Note**: The server automatically initialises the database schema on first startup — no manual SQL import required. ### Option 2: Manual Local Start #### 1. Prepare the environment ```bash -# Create MySQL database -mysql -u root -p < server/db/schema.sql - # Copy and edit environment variables cp server/.env.example server/.env # Fill in DB_HOST / DB_PASS / REDIS_HOST / MINIO_* etc. + +# Note: the server auto-runs schema.sql on first startup ``` #### 2. Start the backend