forked from XiaoMo/ChatGPT-Next-Web
Merge pull request #3171 from AnYiEE/docs-update
This commit is contained in:
commit
d1ec26ae83
@ -24,10 +24,10 @@ HIDE_USER_API_KEY=
|
|||||||
|
|
||||||
# (optional)
|
# (optional)
|
||||||
# Default: Empty
|
# Default: Empty
|
||||||
# If you do not want users to use GPT-4, set this value to 1.
|
# If you do want users to query balance, set this value to 1.
|
||||||
DISABLE_GPT4=
|
ENABLE_BALANCE_QUERY=
|
||||||
|
|
||||||
# (optional)
|
# (optional)
|
||||||
# Default: Empty
|
# Default: Empty
|
||||||
# If you do not want users to query balance, set this value to 1.
|
# If you want to disable parse settings from url, set this value to 1.
|
||||||
HIDE_BALANCE_QUERY=
|
DISABLE_FAST_LINK=
|
||||||
|
@ -20,7 +20,7 @@ export async function requestOpenai(req: NextRequest) {
|
|||||||
baseUrl = `${PROTOCOL}://${baseUrl}`;
|
baseUrl = `${PROTOCOL}://${baseUrl}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baseUrl.endsWith('/')) {
|
if (baseUrl.endsWith("/")) {
|
||||||
baseUrl = baseUrl.slice(0, -1);
|
baseUrl = baseUrl.slice(0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,9 +31,12 @@ export async function requestOpenai(req: NextRequest) {
|
|||||||
console.log("[Org ID]", process.env.OPENAI_ORG_ID);
|
console.log("[Org ID]", process.env.OPENAI_ORG_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
const timeoutId = setTimeout(() => {
|
const timeoutId = setTimeout(
|
||||||
controller.abort();
|
() => {
|
||||||
}, 10 * 60 * 1000);
|
controller.abort();
|
||||||
|
},
|
||||||
|
10 * 60 * 1000,
|
||||||
|
);
|
||||||
|
|
||||||
const fetchUrl = `${baseUrl}/${openaiPath}`;
|
const fetchUrl = `${baseUrl}/${openaiPath}`;
|
||||||
const fetchOptions: RequestInit = {
|
const fetchOptions: RequestInit = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
version: '3.9'
|
version: "3.9"
|
||||||
services:
|
services:
|
||||||
chatgpt-next-web:
|
chatgpt-next-web:
|
||||||
profiles: ["no-proxy"]
|
profiles: ["no-proxy"]
|
||||||
container_name: chatgpt-next-web
|
container_name: chatgpt-next-web
|
||||||
image: yidadaa/chatgpt-next-web
|
image: yidadaa/chatgpt-next-web
|
||||||
@ -13,8 +13,11 @@ services:
|
|||||||
- OPENAI_ORG_ID=$OPENAI_ORG_ID
|
- OPENAI_ORG_ID=$OPENAI_ORG_ID
|
||||||
- HIDE_USER_API_KEY=$HIDE_USER_API_KEY
|
- HIDE_USER_API_KEY=$HIDE_USER_API_KEY
|
||||||
- DISABLE_GPT4=$DISABLE_GPT4
|
- DISABLE_GPT4=$DISABLE_GPT4
|
||||||
|
- ENABLE_BALANCE_QUERY=$ENABLE_BALANCE_QUERY
|
||||||
|
- DISABLE_FAST_LINK=$DISABLE_FAST_LINK
|
||||||
|
- OPENAI_SB=$OPENAI_SB
|
||||||
|
|
||||||
chatgpt-next-web-proxy:
|
chatgpt-next-web-proxy:
|
||||||
profiles: ["proxy"]
|
profiles: ["proxy"]
|
||||||
container_name: chatgpt-next-web-proxy
|
container_name: chatgpt-next-web-proxy
|
||||||
image: yidadaa/chatgpt-next-web
|
image: yidadaa/chatgpt-next-web
|
||||||
@ -28,3 +31,6 @@ services:
|
|||||||
- OPENAI_ORG_ID=$OPENAI_ORG_ID
|
- OPENAI_ORG_ID=$OPENAI_ORG_ID
|
||||||
- HIDE_USER_API_KEY=$HIDE_USER_API_KEY
|
- HIDE_USER_API_KEY=$HIDE_USER_API_KEY
|
||||||
- DISABLE_GPT4=$DISABLE_GPT4
|
- DISABLE_GPT4=$DISABLE_GPT4
|
||||||
|
- ENABLE_BALANCE_QUERY=$ENABLE_BALANCE_QUERY
|
||||||
|
- DISABLE_FAST_LINK=$DISABLE_FAST_LINK
|
||||||
|
- OPENAI_SB=$OPENAI_SB
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Cloudflare Pages 部署指南
|
# Cloudflare Pages 部署指南
|
||||||
|
|
||||||
## 如何新建项目
|
## 如何新建项目
|
||||||
|
|
||||||
在 Github 上 fork 本项目,然后登录到 dash.cloudflare.com 并进入 Pages。
|
在 Github 上 fork 本项目,然后登录到 dash.cloudflare.com 并进入 Pages。
|
||||||
|
|
||||||
1. 点击 "Create a project"。
|
1. 点击 "Create a project"。
|
||||||
@ -30,10 +31,12 @@
|
|||||||
- `OPENAI_ORG_ID= 可选填,指定 OpenAI 中的组织 ID`
|
- `OPENAI_ORG_ID= 可选填,指定 OpenAI 中的组织 ID`
|
||||||
- `HIDE_USER_API_KEY=1 可选,不让用户自行填入 API Key`
|
- `HIDE_USER_API_KEY=1 可选,不让用户自行填入 API Key`
|
||||||
- `DISABLE_GPT4=1 可选,不让用户使用 GPT-4`
|
- `DISABLE_GPT4=1 可选,不让用户使用 GPT-4`
|
||||||
|
- `ENABLE_BALANCE_QUERY=1 可选,启用余额查询功能`
|
||||||
|
- `DISABLE_FAST_LINK=1 可选,禁用从链接解析预制设置`
|
||||||
|
|
||||||
12. 点击 "Save and Deploy"。
|
12. 点击 "Save and Deploy"。
|
||||||
13. 点击 "Cancel deployment",因为需要填写 Compatibility flags。
|
13. 点击 "Cancel deployment",因为需要填写 Compatibility flags。
|
||||||
14. 前往 "Build settings"、"Functions",找到 "Compatibility flags"。
|
14. 前往 "Build settings"、"Functions",找到 "Compatibility flags"。
|
||||||
15. 在 "Configure Production compatibility flag" 和 "Configure Preview compatibility flag" 中填写 "nodejs_compat"。
|
15. 在 "Configure Production compatibility flag" 和 "Configure Preview compatibility flag" 中填写 "nodejs_compat"。
|
||||||
16. 前往 "Deployments",点击 "Retry deployment"。
|
16. 前往 "Deployments",点击 "Retry deployment"。
|
||||||
17. Enjoy.
|
17. Enjoy.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Cloudflare Pages Deployment Guide
|
# Cloudflare Pages Deployment Guide
|
||||||
|
|
||||||
## How to create a new project
|
## How to create a new project
|
||||||
|
|
||||||
Fork this project on GitHub, then log in to dash.cloudflare.com and go to Pages.
|
Fork this project on GitHub, then log in to dash.cloudflare.com and go to Pages.
|
||||||
|
|
||||||
1. Click "Create a project".
|
1. Click "Create a project".
|
||||||
@ -11,12 +12,13 @@ Fork this project on GitHub, then log in to dash.cloudflare.com and go to Pages.
|
|||||||
6. For "Project name" and "Production branch", use the default values or change them as needed.
|
6. For "Project name" and "Production branch", use the default values or change them as needed.
|
||||||
7. In "Build Settings", choose the "Framework presets" option and select "Next.js".
|
7. In "Build Settings", choose the "Framework presets" option and select "Next.js".
|
||||||
8. Do not use the default "Build command" due to a node:buffer bug. Instead, use the following command:
|
8. Do not use the default "Build command" due to a node:buffer bug. Instead, use the following command:
|
||||||
```
|
```
|
||||||
npx @cloudflare/next-on-pages --experimental-minify
|
npx @cloudflare/next-on-pages --experimental-minify
|
||||||
```
|
```
|
||||||
9. For "Build output directory", use the default value and do not modify it.
|
9. For "Build output directory", use the default value and do not modify it.
|
||||||
10. Do not modify "Root Directory".
|
10. Do not modify "Root Directory".
|
||||||
11. For "Environment variables", click ">" and then "Add variable". Fill in the following information:
|
11. For "Environment variables", click ">" and then "Add variable". Fill in the following information:
|
||||||
|
|
||||||
- `NODE_VERSION=20.1`
|
- `NODE_VERSION=20.1`
|
||||||
- `NEXT_TELEMETRY_DISABLE=1`
|
- `NEXT_TELEMETRY_DISABLE=1`
|
||||||
- `OPENAI_API_KEY=your_own_API_key`
|
- `OPENAI_API_KEY=your_own_API_key`
|
||||||
@ -29,7 +31,10 @@ Fork this project on GitHub, then log in to dash.cloudflare.com and go to Pages.
|
|||||||
- `OPENAI_ORG_ID= Optional, specify the organization ID in OpenAI`
|
- `OPENAI_ORG_ID= Optional, specify the organization ID in OpenAI`
|
||||||
- `HIDE_USER_API_KEY=1 Optional, do not allow users to enter their own API key`
|
- `HIDE_USER_API_KEY=1 Optional, do not allow users to enter their own API key`
|
||||||
- `DISABLE_GPT4=1 Optional, do not allow users to use GPT-4`
|
- `DISABLE_GPT4=1 Optional, do not allow users to use GPT-4`
|
||||||
|
- `ENABLE_BALANCE_QUERY=1 Optional, allow users to query balance`
|
||||||
|
- `DISABLE_FAST_LINK=1 Optional, disable parse settings from url`
|
||||||
|
- `OPENAI_SB=1 Optional,use the third-party OpenAI-SB API`
|
||||||
|
|
||||||
12. Click "Save and Deploy".
|
12. Click "Save and Deploy".
|
||||||
13. Click "Cancel deployment" because you need to fill in Compatibility flags.
|
13. Click "Cancel deployment" because you need to fill in Compatibility flags.
|
||||||
14. Go to "Build settings", "Functions", and find "Compatibility flags".
|
14. Go to "Build settings", "Functions", and find "Compatibility flags".
|
||||||
|
Loading…
Reference in New Issue
Block a user