diff --git a/docs/en/env.md b/docs/en/env.md index 7bc6cb3..6f46e95 100644 --- a/docs/en/env.md +++ b/docs/en/env.md @@ -2,14 +2,14 @@ ## Frontend Environment Variables List -| Name | Required | Description | Default Value | Example Value | -|--------------|----------|-----------------------------------------|---------------|----------------------------------------------------| -| API_URL | Yes | Backend URL | None | http://localhost:3001 | -| AVATAR | Yes | Avatar URL for the top left of the site | None | https://avatars.githubusercontent.com/u/36541432 | -| NAME | Yes | Name & Title for the top left of the site | None | Xeu | -| DESCRIPTION | No | Description for the top left of the site | None | Omnivore | -| PAGE_SIZE | No | Default pagination limit | 5 | 5 | -| RSS_ENABLE | No | Enable RSS (displays RSS link at the bottom of the site if enabled) | false | true | +| Name | Required | Description | Default Value | Example Value | +|-------------|----------|---------------------------------------------------------------------|---------------|--------------------------------------------------| +| API_URL | Yes | Backend URL | None | http://localhost:3001 | +| AVATAR | Yes | Avatar URL for the top left of the site | None | https://avatars.githubusercontent.com/u/36541432 | +| NAME | Yes | Name & Title for the top left of the site | None | Xeu | +| DESCRIPTION | No | Description for the top left of the site | None | Omnivore | +| PAGE_SIZE | No | Default pagination limit | 5 | 5 | +| RSS_ENABLE | No | Enable RSS (displays RSS link at the bottom of the site if enabled) | false | true | **Deployment Environment Variables** @@ -17,10 +17,10 @@ The following environment variables are required for deployment to Cloudflare Pages and cannot be modified. ::: -| Name | Value | Description | -|--------------------------|-----------------------------------------------------------|-------------------------------| -| SKIP_DEPENDENCY_INSTALL | true | Skip the default npm install command | -| UNSTABLE_PRE_BUILD | asdf install bun latest && asdf global bun latest && bun i | Install and use Bun for dependency installation | +| Name | Value | Description | +|-------------------------|------------------------------------------------------------|-------------------------------------------------| +| SKIP_DEPENDENCY_INSTALL | true | Skip the default npm install command | +| UNSTABLE_PRE_BUILD | asdf install bun latest && asdf global bun latest && bun i | Install and use Bun for dependency installation | ## Backend Environment Variables List @@ -30,16 +30,16 @@ The following environment variables are required for deployment to Cloudflare Pa The following variables can remain unencrypted in Cloudflare Workers. ::: -| Name | Required | Description | Default Value | Example Value | -|-------------------|----------|-------------------------------------------------------|----------------|-------------------------------------------------------------------| -| FRONTEND_URL | Temporarily required | Required for including comment article link in comment notification Webhook, can be left blank | None | https://xeu.life | -| S3_FOLDER | Yes | File path for storing resources when uploading images | None | images/ | -| S3_BUCKET | Yes | Name of the S3 bucket | None | images | -| S3_REGION | Yes | Region of the S3 bucket, use 'auto' for Cloudflare R2 | None | auto | -| S3_ENDPOINT | Yes | Endpoint address of the S3 bucket | None | https://1234567890abcdef1234567890abcd.r2.cloudflarestorage.com | -| WEBHOOK_URL | No | Target address for sending Webhook notifications when a new comment is added | None | https://webhook.example.com/webhook | -| S3_ACCESS_HOST | No | Access address of the S3 bucket | S3_ENDPOINT | https://image.xeu.life | -| S3_CACHE_FOLDER | No | S3 cache folder (for SEO and high-frequency request caching) | cache/ | cache/ | +| Name | Required | Description | Default Value | Example Value | +|-----------------|----------------------|------------------------------------------------------------------------------------------------|---------------|-----------------------------------------------------------------| +| FRONTEND_URL | Temporarily required | Required for including comment article link in comment notification Webhook, can be left blank | None | https://xeu.life | +| S3_FOLDER | Yes | File path for storing resources when uploading images | None | images/ | +| S3_BUCKET | Yes | Name of the S3 bucket | None | images | +| S3_REGION | Yes | Region of the S3 bucket, use 'auto' for Cloudflare R2 | None | auto | +| S3_ENDPOINT | Yes | Endpoint address of the S3 bucket | None | https://1234567890abcdef1234567890abcd.r2.cloudflarestorage.com | +| WEBHOOK_URL | No | Target address for sending Webhook notifications when a new comment is added | None | https://webhook.example.com/webhook | +| S3_ACCESS_HOST | No | Access address of the S3 bucket | S3_ENDPOINT | https://image.xeu.life | +| S3_CACHE_FOLDER | No | S3 cache folder (for SEO and high-frequency request caching) | cache/ | cache/ | **Encrypted Environment Variables** @@ -47,10 +47,10 @@ The following variables can remain unencrypted in Cloudflare Workers. All of the following variables are required (except Webhook) and must be encrypted after debugging in Cloudflare Workers. Unencrypted variables will be cleared during deployment if not listed in `wrangler.toml`. ::: -| Name | Description | Example Value | -|--------------------------|----------------------------------------------------------|-----------------------------------------------------------------| -| RIN_GITHUB_CLIENT_ID | Client ID for GitHub OAuth | Ux66poMrKi1k11M1Q1b2 | -| RIN_GITHUB_CLIENT_SECRET | Client secret for GitHub OAuth | 1234567890abcdef1234567890abcdef12345678 | -| JWT_SECRET | Secret key required for JWT authentication, can be any regular format password | J0sT%Ch@nge#Me1 | -| S3_ACCESS_KEY_ID | KEY ID required for accessing the S3 bucket, for Cloudflare R2 use an API token ID with R2 edit permissions | 1234567890abcdef1234567890abcd | -| S3_SECRET_ACCESS_KEY | Secret required for accessing the S3 bucket, for Cloudflare R2 use an API token with R2 edit permissions | 1234567890abcdef1234567890abcd| \ No newline at end of file +| Name | Description | Example Value | +|--------------------------|-------------------------------------------------------------------------------------------------------------|------------------------------------------| +| RIN_GITHUB_CLIENT_ID | Client ID for GitHub OAuth | Ux66poMrKi1k11M1Q1b2 | +| RIN_GITHUB_CLIENT_SECRET | Client secret for GitHub OAuth | 1234567890abcdef1234567890abcdef12345678 | +| JWT_SECRET | Secret key required for JWT authentication, can be any regular format password | J0sT%Ch@nge#Me1 | +| S3_ACCESS_KEY_ID | KEY ID required for accessing the S3 bucket, for Cloudflare R2 use an API token ID with R2 edit permissions | 1234567890abcdef1234567890abcd | +| S3_SECRET_ACCESS_KEY | Secret required for accessing the S3 bucket, for Cloudflare R2 use an API token with R2 edit permissions | 1234567890abcdef1234567890abcd | \ No newline at end of file diff --git a/docs/en/guide/deploy.mdx b/docs/en/guide/deploy.mdx index 75883b2..5d43a95 100644 --- a/docs/en/guide/deploy.mdx +++ b/docs/en/guide/deploy.mdx @@ -42,7 +42,7 @@ bun wrangler d1 create rin 后端负责处理具体的逻辑,在本项目中后端运行在 Cloudflare Workers 上,前端通过 API 与后端通信,后端通过 Cloudflare D1 保存文章等数据,通过 Cloudflare R2 存储文章中的图片 -下文提到的前端与后端你可以分别等价代换为 Cloudflare Pages 与 Cloudflare Workers,当提到说需要前端地址或者后端地址时,即为 Cloudflare Pages 地址或 Cloudflare Workers 地址,你可以在 oudflare 控制面板中通过少量的操作找到这两个地址,如下面的截图所示: +下文提到的前端与后端你可以分别等价代换为 Cloudflare Pages 与 Cloudflare Workers,当提到说需要前端地址或者后端地址时,即为 Cloudflare Pages 地址或 Cloudflare Workers 地址,你可以在 Cloudflare 控制面板中通过少量的操作找到这两个地址,如下面的截图所示: 前端(Pages)的地址在 `Workers 和 Pages` > 你的 Pages 项目 > `部署` 中可以找到: ![图片](https://github.com/OXeu/Rin/assets/36541432/d9dcc5f2-6930-4487-af4b-0ab52e948114) 图中的`rin-6qe.pages.dev`,`direct.xeu.life` 都是前端地址,如果有更多的地址,你还可以点击形如 `+2 个域` 的链接查看更多的地址,这些地址都是可以访问的,你可以使用其中任意一个地址,但是需持不同地方都填写的是同一个前端地址(如果有多个环境变量要求填写前端地址的话),通常来说前端地址是 `https://rin-6qe.pages.dev` 或 `https://direct.xeu.life` 这样的形式 @@ -193,7 +193,7 @@ S3_SECRET_ACCESS_KEY=<你的S3SecretAccessKey> ## 接入 GitHub OAuth -打开 https://github.com/settings/developers,选择 `New OAuth App` 创建一个新的 Oauth App,填入自己的应用名称与主页地址(带`http://`或`https://`),`Authorization callback URL` 填写 +打开 https://github.com/settings/developers ,选择`New OAuth App` 创建一个新的 Oauth App,填入自己的应用名称与主页地址(带`http://`或`https://`),`Authorization callback URL` 填写 ``` https://<你的后端地址>/user/github/callback diff --git a/docs/zh/guide/deploy.mdx b/docs/zh/guide/deploy.mdx index 50a9a7f..f4f1ad6 100644 --- a/docs/zh/guide/deploy.mdx +++ b/docs/zh/guide/deploy.mdx @@ -39,7 +39,7 @@ bun wrangler d1 create rin 后端负责处理具体的逻辑,在本项目中后端运行在 Cloudflare Workers 上,前端通过 API 与后端通信,后端通过 Cloudflare D1 保存文章等数据,通过 Cloudflare R2 存储文章中的图片 -下文提到的前端与后端你可以分别等价代换为 Cloudflare Pages 与 Cloudflare Workers,当提到说需要前端地址或者后端地址时,即为 Cloudflare Pages 地址或 Cloudflare Workers 地址,你可以在 oudflare 控制面板中通过少量的操作找到这两个地址,如下面的截图所示: +下文提到的前端与后端你可以分别等价代换为 Cloudflare Pages 与 Cloudflare Workers,当提到说需要前端地址或者后端地址时,即为 Cloudflare Pages 地址或 Cloudflare Workers 地址,你可以在 Cloudflare 控制面板中通过少量的操作找到这两个地址,如下面的截图所示: 前端(Pages)的地址在 `Workers 和 Pages` > 你的 Pages 项目 > `部署` 中可以找到: ![图片](https://github.com/OXeu/Rin/assets/36541432/d9dcc5f2-6930-4487-af4b-0ab52e948114) 图中的`rin-6qe.pages.dev`,`direct.xeu.life` 都是前端地址,如果有更多的地址,你还可以点击形如 `+2 个域` 的链接查看更多的地址,这些地址都是可以访问的,你可以使用其中任意一个地址,但是需持不同地方都填写的是同一个前端地址(如果有多个环境变量要求填写前端地址的话),通常来说前端地址是 `https://rin-6qe.pages.dev` 或 `https://direct.xeu.life` 这样的形式 @@ -190,7 +190,7 @@ S3_SECRET_ACCESS_KEY=<你的S3SecretAccessKey> ## 接入 GitHub OAuth -打开 https://github.com/settings/developers,选择 `New OAuth App` 创建一个新的 Oauth App,填入自己的应用名称与主页地址(带`http://`或`https://`),`Authorization callback URL` 填写 +打开 https://github.com/settings/developers ,选择`New OAuth App` 创建一个新的 Oauth App,填入自己的应用名称与主页地址(带`http://`或`https://`),`Authorization callback URL` 填写 ``` https://<你的后端地址>/user/github/callback