Spaces:
Runtime error
Runtime error
change the port
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .commitlintrc.json +3 -0
- .dockerignore +7 -0
- .editorconfig +11 -0
- .env +10 -0
- .eslintignore +2 -0
- .eslintrc.cjs +4 -0
- .gitattributes +17 -34
- .github/workflows/build_docker.yml +41 -0
- .github/workflows/ci.yml +47 -0
- .github/workflows/issues_close.yml +22 -0
- .gitignore +32 -0
- .husky/commit-msg +4 -0
- .husky/pre-commit +4 -0
- .npmrc +1 -0
- .vscode/extensions.json +3 -0
- .vscode/settings.json +65 -0
- CHANGELOG.md +578 -0
- CONTRIBUTING.en.md +49 -0
- CONTRIBUTING.md +49 -0
- Dockerfile +56 -0
- README.md +337 -11
- config/index.ts +1 -0
- config/proxy.ts +16 -0
- docker-compose/docker-compose.yml +47 -0
- docker-compose/nginx/nginx.conf +20 -0
- docker-compose/readme.md +14 -0
- docs/alipay.png +0 -0
- docs/c1-2.8.0.png +0 -0
- docs/c1-2.9.0.png +0 -0
- docs/c1.png +0 -0
- docs/c2-2.8.0.png +0 -0
- docs/c2-2.9.0.png +0 -0
- docs/c2.png +0 -0
- docs/docker.png +0 -0
- docs/wechat.png +0 -0
- index.html +83 -0
- kubernetes/README.md +9 -0
- kubernetes/deploy.yaml +66 -0
- kubernetes/ingress.yaml +21 -0
- license +21 -0
- package.json +71 -0
- pnpm-lock.yaml +0 -0
- postcss.config.js +6 -0
- public/favicon.ico +0 -0
- public/favicon.svg +1 -0
- public/pwa-192x192.png +0 -0
- public/pwa-512x512.png +0 -0
- service/.env.example +44 -0
- service/.eslintrc.json +5 -0
- service/.gitignore +31 -0
.commitlintrc.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"extends": ["@commitlint/config-conventional"]
|
3 |
+
}
|
.dockerignore
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
**/node_modules
|
2 |
+
*/node_modules
|
3 |
+
node_modules
|
4 |
+
Dockerfile
|
5 |
+
.*
|
6 |
+
*/.*
|
7 |
+
!.env
|
.editorconfig
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Editor configuration, see http://editorconfig.org
|
2 |
+
|
3 |
+
root = true
|
4 |
+
|
5 |
+
[*]
|
6 |
+
charset = utf-8
|
7 |
+
indent_style = tab
|
8 |
+
indent_size = 2
|
9 |
+
end_of_line = lf
|
10 |
+
trim_trailing_whitespace = true
|
11 |
+
insert_final_newline = true
|
.env
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Glob API URL
|
2 |
+
VITE_GLOB_API_URL=/api
|
3 |
+
|
4 |
+
VITE_APP_API_BASE_URL=http://127.0.0.1:3002/
|
5 |
+
|
6 |
+
# Whether long replies are supported, which may result in higher API fees
|
7 |
+
VITE_GLOB_OPEN_LONG_REPLY=false
|
8 |
+
|
9 |
+
# When you want to use PWA
|
10 |
+
VITE_GLOB_APP_PWA=false
|
.eslintignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
docker-compose
|
2 |
+
kubernetes
|
.eslintrc.cjs
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
module.exports = {
|
2 |
+
root: true,
|
3 |
+
extends: ['@antfu'],
|
4 |
+
}
|
.gitattributes
CHANGED
@@ -1,34 +1,17 @@
|
|
1 |
-
*.
|
2 |
-
*.
|
3 |
-
*.
|
4 |
-
*.
|
5 |
-
*.
|
6 |
-
*.
|
7 |
-
*.
|
8 |
-
*.
|
9 |
-
*.
|
10 |
-
*.
|
11 |
-
*.
|
12 |
-
*.
|
13 |
-
*.
|
14 |
-
*.
|
15 |
-
*.
|
16 |
-
*.
|
17 |
-
*.
|
18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
1 |
+
"*.vue" eol=lf
|
2 |
+
"*.js" eol=lf
|
3 |
+
"*.ts" eol=lf
|
4 |
+
"*.jsx" eol=lf
|
5 |
+
"*.tsx" eol=lf
|
6 |
+
"*.cjs" eol=lf
|
7 |
+
"*.cts" eol=lf
|
8 |
+
"*.mjs" eol=lf
|
9 |
+
"*.mts" eol=lf
|
10 |
+
"*.json" eol=lf
|
11 |
+
"*.html" eol=lf
|
12 |
+
"*.css" eol=lf
|
13 |
+
"*.less" eol=lf
|
14 |
+
"*.scss" eol=lf
|
15 |
+
"*.sass" eol=lf
|
16 |
+
"*.styl" eol=lf
|
17 |
+
"*.md" eol=lf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.github/workflows/build_docker.yml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: build_docker
|
2 |
+
|
3 |
+
on:
|
4 |
+
push:
|
5 |
+
branches: [main]
|
6 |
+
release:
|
7 |
+
types: [created] # 表示在创建新的 Release 时触发
|
8 |
+
|
9 |
+
jobs:
|
10 |
+
build_docker:
|
11 |
+
name: Build docker
|
12 |
+
runs-on: ubuntu-latest
|
13 |
+
steps:
|
14 |
+
- name: Checkout
|
15 |
+
uses: actions/checkout@v3
|
16 |
+
|
17 |
+
- run: |
|
18 |
+
echo "本次构建的版本为:${GITHUB_REF_NAME} (但是这个变量目前上下文中无法获取到)"
|
19 |
+
echo 本次构建的版本为:${{ github.ref_name }}
|
20 |
+
env
|
21 |
+
|
22 |
+
- name: Set up QEMU
|
23 |
+
uses: docker/setup-qemu-action@v2
|
24 |
+
- name: Set up Docker Buildx
|
25 |
+
uses: docker/setup-buildx-action@v2
|
26 |
+
- name: Login to DockerHub
|
27 |
+
uses: docker/login-action@v2
|
28 |
+
with:
|
29 |
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
30 |
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
31 |
+
- name: Build and push
|
32 |
+
id: docker_build
|
33 |
+
uses: docker/build-push-action@v4
|
34 |
+
with:
|
35 |
+
context: .
|
36 |
+
push: true
|
37 |
+
labels: ${{ steps.meta.outputs.labels }}
|
38 |
+
platforms: linux/amd64,linux/arm64
|
39 |
+
tags: |
|
40 |
+
${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-web:${{ github.ref_name }}
|
41 |
+
${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-web:latest
|
.github/workflows/ci.yml
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: CI
|
2 |
+
|
3 |
+
on:
|
4 |
+
push:
|
5 |
+
branches:
|
6 |
+
- main
|
7 |
+
|
8 |
+
pull_request:
|
9 |
+
branches:
|
10 |
+
- main
|
11 |
+
|
12 |
+
jobs:
|
13 |
+
lint:
|
14 |
+
runs-on: ubuntu-latest
|
15 |
+
steps:
|
16 |
+
- uses: actions/checkout@v3
|
17 |
+
- name: Set node
|
18 |
+
uses: actions/setup-node@v3
|
19 |
+
with:
|
20 |
+
node-version: 18.x
|
21 |
+
|
22 |
+
- name: Setup
|
23 |
+
run: npm i -g @antfu/ni
|
24 |
+
|
25 |
+
- name: Install
|
26 |
+
run: nci
|
27 |
+
|
28 |
+
- name: Lint
|
29 |
+
run: nr lint:fix
|
30 |
+
|
31 |
+
typecheck:
|
32 |
+
runs-on: ubuntu-latest
|
33 |
+
steps:
|
34 |
+
- uses: actions/checkout@v3
|
35 |
+
- name: Set node
|
36 |
+
uses: actions/setup-node@v3
|
37 |
+
with:
|
38 |
+
node-version: 18.x
|
39 |
+
|
40 |
+
- name: Setup
|
41 |
+
run: npm i -g @antfu/ni
|
42 |
+
|
43 |
+
- name: Install
|
44 |
+
run: nci
|
45 |
+
|
46 |
+
- name: Typecheck
|
47 |
+
run: nr type-check
|
.github/workflows/issues_close.yml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Close inactive issues
|
2 |
+
on:
|
3 |
+
schedule:
|
4 |
+
- cron: '30 1 * * *'
|
5 |
+
|
6 |
+
jobs:
|
7 |
+
close-issues:
|
8 |
+
runs-on: ubuntu-latest
|
9 |
+
permissions:
|
10 |
+
issues: write
|
11 |
+
pull-requests: write
|
12 |
+
steps:
|
13 |
+
- uses: actions/stale@v5
|
14 |
+
with:
|
15 |
+
days-before-issue-stale: 10
|
16 |
+
days-before-issue-close: 2
|
17 |
+
stale-issue-label: stale
|
18 |
+
stale-issue-message: This issue is stale because it has been open for 10 days with no activity.
|
19 |
+
close-issue-message: This issue was closed because it has been inactive for 2 days since being marked as stale.
|
20 |
+
days-before-pr-stale: -1
|
21 |
+
days-before-pr-close: -1
|
22 |
+
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
.gitignore
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Logs
|
2 |
+
logs
|
3 |
+
*.log
|
4 |
+
npm-debug.log*
|
5 |
+
yarn-debug.log*
|
6 |
+
yarn-error.log*
|
7 |
+
pnpm-debug.log*
|
8 |
+
lerna-debug.log*
|
9 |
+
|
10 |
+
node_modules
|
11 |
+
.DS_Store
|
12 |
+
dist
|
13 |
+
dist-ssr
|
14 |
+
coverage
|
15 |
+
*.local
|
16 |
+
|
17 |
+
/cypress/videos/
|
18 |
+
/cypress/screenshots/
|
19 |
+
|
20 |
+
# Editor directories and files
|
21 |
+
.vscode/*
|
22 |
+
!.vscode/settings.json
|
23 |
+
!.vscode/extensions.json
|
24 |
+
.idea
|
25 |
+
*.suo
|
26 |
+
*.ntvs*
|
27 |
+
*.njsproj
|
28 |
+
*.sln
|
29 |
+
*.sw?
|
30 |
+
|
31 |
+
# Environment variables files
|
32 |
+
/service/.env
|
.husky/commit-msg
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env sh
|
2 |
+
. "$(dirname -- "$0")/_/husky.sh"
|
3 |
+
|
4 |
+
npx --no -- commitlint --edit
|
.husky/pre-commit
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env sh
|
2 |
+
. "$(dirname -- "$0")/_/husky.sh"
|
3 |
+
|
4 |
+
npx lint-staged
|
.npmrc
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
strict-peer-dependencies=false
|
.vscode/extensions.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"recommendations": ["Vue.volar", "dbaeumer.vscode-eslint"]
|
3 |
+
}
|
.vscode/settings.json
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"prettier.enable": false,
|
3 |
+
"editor.formatOnSave": false,
|
4 |
+
"editor.codeActionsOnSave": {
|
5 |
+
"source.fixAll.eslint": true
|
6 |
+
},
|
7 |
+
"eslint.validate": [
|
8 |
+
"javascript",
|
9 |
+
"javascriptreact",
|
10 |
+
"typescript",
|
11 |
+
"typescriptreact",
|
12 |
+
"vue",
|
13 |
+
"html",
|
14 |
+
"json",
|
15 |
+
"jsonc",
|
16 |
+
"json5",
|
17 |
+
"yaml",
|
18 |
+
"yml",
|
19 |
+
"markdown"
|
20 |
+
],
|
21 |
+
"cSpell.words": [
|
22 |
+
"antfu",
|
23 |
+
"axios",
|
24 |
+
"bumpp",
|
25 |
+
"chatgpt",
|
26 |
+
"chenzhaoyu",
|
27 |
+
"commitlint",
|
28 |
+
"davinci",
|
29 |
+
"dockerhub",
|
30 |
+
"esno",
|
31 |
+
"GPTAPI",
|
32 |
+
"highlightjs",
|
33 |
+
"hljs",
|
34 |
+
"iconify",
|
35 |
+
"katex",
|
36 |
+
"katexmath",
|
37 |
+
"linkify",
|
38 |
+
"logprobs",
|
39 |
+
"mdhljs",
|
40 |
+
"mila",
|
41 |
+
"nodata",
|
42 |
+
"OPENAI",
|
43 |
+
"pinia",
|
44 |
+
"Popconfirm",
|
45 |
+
"rushstack",
|
46 |
+
"Sider",
|
47 |
+
"tailwindcss",
|
48 |
+
"traptitech",
|
49 |
+
"tsup",
|
50 |
+
"Typecheck",
|
51 |
+
"unplugin",
|
52 |
+
"VITE",
|
53 |
+
"vueuse",
|
54 |
+
"Zhao"
|
55 |
+
],
|
56 |
+
"i18n-ally.enabledParsers": [
|
57 |
+
"ts"
|
58 |
+
],
|
59 |
+
"i18n-ally.sortKeys": true,
|
60 |
+
"i18n-ally.keepFulfilled": true,
|
61 |
+
"i18n-ally.localesPaths": [
|
62 |
+
"src/locales"
|
63 |
+
],
|
64 |
+
"i18n-ally.keystyle": "nested"
|
65 |
+
}
|
CHANGELOG.md
ADDED
@@ -0,0 +1,578 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## v2.10.9
|
2 |
+
|
3 |
+
`2023-04-03`
|
4 |
+
|
5 |
+
> 更新默认 `accessToken` 反代地址为 [[acheong08](https://github.com/acheong08)] 的 `https://bypass.churchless.tech/api/conversation`
|
6 |
+
|
7 |
+
## Enhancement
|
8 |
+
- 添加 `socks5` 代理认证 [[yimiaoxiehou](https://github.com/Chanzhaoyu/chatgpt-web/pull/999)]
|
9 |
+
- 添加 `socks` 代理用户名密码的配置 [[hank-cp](https://github.com/Chanzhaoyu/chatgpt-web/pull/890)]
|
10 |
+
- 添加可选日志打印 [[zcong1993](https://github.com/Chanzhaoyu/chatgpt-web/pull/1041)]
|
11 |
+
- 更新侧边栏按钮本地化[[simonwu53](https://github.com/Chanzhaoyu/chatgpt-web/pull/911)]
|
12 |
+
- 优化代码块滚动条高度 [[Fog3211](https://github.com/Chanzhaoyu/chatgpt-web/pull/1153)]
|
13 |
+
## BugFix
|
14 |
+
- 修复 `PWA` 问题 [[bingo235](https://github.com/Chanzhaoyu/chatgpt-web/pull/807)]
|
15 |
+
- 修复 `ESM` 错误 [[kidonng](https://github.com/Chanzhaoyu/chatgpt-web/pull/826)]
|
16 |
+
- 修复反向代理开启时限流失效的问题 [[gitgitgogogo](https://github.com/Chanzhaoyu/chatgpt-web/pull/863)]
|
17 |
+
- 修复 `docker` 构建时 `.env` 可能被忽略的问题 [[zaiMoe](https://github.com/Chanzhaoyu/chatgpt-web/pull/877)]
|
18 |
+
- 修复导出异常错误 [[KingTwinkle](https://github.com/Chanzhaoyu/chatgpt-web/pull/938)]
|
19 |
+
- 修复空值异常 [[vchenpeng](https://github.com/Chanzhaoyu/chatgpt-web/pull/1103)]
|
20 |
+
- 移动端上的体验问题
|
21 |
+
|
22 |
+
## Other
|
23 |
+
- `Docker` 容器名字名义 [[LOVECHEN](https://github.com/Chanzhaoyu/chatgpt-web/pull/1035)]
|
24 |
+
- `kubernetes` 部署配置 [[CaoYunzhou](https://github.com/Chanzhaoyu/chatgpt-web/pull/1001)]
|
25 |
+
- 感谢 [[assassinliujie](https://github.com/Chanzhaoyu/chatgpt-web/pull/962)] 和 [[puppywang](https://github.com/Chanzhaoyu/chatgpt-web/pull/1017)] 的某些贡献
|
26 |
+
- 更新 `kubernetes/deploy.yaml` [[idawnwon](https://github.com/Chanzhaoyu/chatgpt-web/pull/1085)]
|
27 |
+
- 文档更新 [[#yi-ge](https://github.com/Chanzhaoyu/chatgpt-web/pull/883)]
|
28 |
+
- 文档更新 [[weifeng12x](https://github.com/Chanzhaoyu/chatgpt-web/pull/880)]
|
29 |
+
- 依赖更新
|
30 |
+
|
31 |
+
## v2.10.8
|
32 |
+
|
33 |
+
`2023-03-23`
|
34 |
+
|
35 |
+
如遇问题,请删除 `node_modules` 重新安装依赖。
|
36 |
+
|
37 |
+
## Feature
|
38 |
+
- 显示回复消息原文的选项 [[yilozt](https://github.com/Chanzhaoyu/chatgpt-web/pull/672)]
|
39 |
+
- 添加单 `IP` 每小时请求限制。环境变量: `MAX_REQUEST_PER_HOUR` [[zhuxindong ](https://github.com/Chanzhaoyu/chatgpt-web/pull/718)]
|
40 |
+
- 前端添加角色设定,仅 `API` 方式可见 [[quzard](https://github.com/Chanzhaoyu/chatgpt-web/pull/768)]
|
41 |
+
- `OPENAI_API_MODEL` 变量现在对 `ChatGPTUnofficialProxyAPI` 也生效,注意:`Token` 和 `API` 的模型命名不一致,不能直接填入 `gpt-3.5` 或者 `gpt-4` [[hncboy](https://github.com/Chanzhaoyu/chatgpt-web/pull/632)]
|
42 |
+
- 添加繁体中文 `Prompts` [[PeterDaveHello](https://github.com/Chanzhaoyu/chatgpt-web/pull/796)]
|
43 |
+
|
44 |
+
## Enhancement
|
45 |
+
- 重置回答时滚动定位至该回答 [[shunyue1320](https://github.com/Chanzhaoyu/chatgpt-web/pull/781)]
|
46 |
+
- 当 `API` 是 `gpt-4` 时增加可用的 `Max Tokens` [[simonwu53](https://github.com/Chanzhaoyu/chatgpt-web/pull/729)]
|
47 |
+
- 判断和忽略回复字符 [[liut](https://github.com/Chanzhaoyu/chatgpt-web/pull/474)]
|
48 |
+
- 切换会话时,自动聚焦输入框 [[JS-an](https://github.com/Chanzhaoyu/chatgpt-web/pull/735)]
|
49 |
+
- 渲染的链接新窗口打开
|
50 |
+
- 查询余额可选 `API_BASE_URL` 代理地址
|
51 |
+
- `config` 接口添加验证防止被无限制调用
|
52 |
+
- `PWA` 默认不开启,现在需手动修改 `.env` 文件 `VITE_GLOB_APP_PWA` 变量
|
53 |
+
- 当网络连接时,刷新页面,`500` 错误页自动跳转到主页
|
54 |
+
|
55 |
+
## BugFix
|
56 |
+
- `scrollToBottom` 调回 `scrollToBottomIfAtBottom` [[shunyue1320](https://github.com/Chanzhaoyu/chatgpt-web/pull/771)]
|
57 |
+
- 重置异常的 `loading` 会话
|
58 |
+
|
59 |
+
## Common
|
60 |
+
- 创建 `start.cmd` 在 `windows` 下也可以运行 [vulgatecnn](https://github.com/Chanzhaoyu/chatgpt-web/pull/656)]
|
61 |
+
- 添加 `visual-studio-code` 中调试配置 [[ChandlerVer5](https://github.com/Chanzhaoyu/chatgpt-web/pull/296)]
|
62 |
+
- 修复文档中 `docker` 端口为本地 [[kilvn](https://github.com/Chanzhaoyu/chatgpt-web/pull/802)]
|
63 |
+
## Other
|
64 |
+
- 依赖更新
|
65 |
+
|
66 |
+
|
67 |
+
## v2.10.7
|
68 |
+
|
69 |
+
`2023-03-17`
|
70 |
+
|
71 |
+
## BugFix
|
72 |
+
- 回退 `chatgpt` 版本,原因:导致 `OPENAI_API_BASE_URL` 代理失效
|
73 |
+
- 修复缺省状态的 `usingContext` 默认值
|
74 |
+
|
75 |
+
## v2.10.6
|
76 |
+
|
77 |
+
`2023-03-17`
|
78 |
+
|
79 |
+
## Feature
|
80 |
+
- 显示 `API` 余额 [[pzcn](https://github.com/Chanzhaoyu/chatgpt-web/pull/582)]
|
81 |
+
|
82 |
+
## Enhancement
|
83 |
+
- 美化滚动条样式和 `UI` 保持一致 [[haydenull](https://github.com/Chanzhaoyu/chatgpt-web/pull/617)]
|
84 |
+
- 优化移动端 `Prompt` 样式 [[CornerSkyless](https://github.com/Chanzhaoyu/chatgpt-web/pull/608)]
|
85 |
+
- 上下文开关改为全局开关,现在记录在本地缓存中
|
86 |
+
- 配置信息按接口类型显示
|
87 |
+
|
88 |
+
## Perf
|
89 |
+
- 优化函数方法 [[kirklin](https://github.com/Chanzhaoyu/chatgpt-web/pull/583)]
|
90 |
+
- 字符错误 [[pdsuwwz](https://github.com/Chanzhaoyu/chatgpt-web/pull/585)]
|
91 |
+
- 文档描述错误 [[lizhongyuan3](https://github.com/Chanzhaoyu/chatgpt-web/pull/636)]
|
92 |
+
|
93 |
+
## BugFix
|
94 |
+
- 修复 `Prompt` 导入、导出兼容性错误
|
95 |
+
- ���复 `highlight.js` 控制台兼容性警告
|
96 |
+
|
97 |
+
## Other
|
98 |
+
- 依赖更新
|
99 |
+
|
100 |
+
## v2.10.5
|
101 |
+
|
102 |
+
`2023-03-13`
|
103 |
+
|
104 |
+
更新依赖,`access_token` 默认代理为 [acheong08](https://github.com/acheong08) 的 `https://bypass.duti.tech/api/conversation`
|
105 |
+
|
106 |
+
## Feature
|
107 |
+
- `Prompt` 商店在线导入可以导入两种 `recommend.json`里提到的模板 [simonwu53](https://github.com/Chanzhaoyu/chatgpt-web/pull/521)
|
108 |
+
- 支持 `HTTPS_PROXY` [whatwewant](https://github.com/Chanzhaoyu/chatgpt-web/pull/308)
|
109 |
+
- `Prompt` 添加查询筛选
|
110 |
+
|
111 |
+
## Enhancement
|
112 |
+
- 调整输入框最大行数 [yi-ge](https://github.com/Chanzhaoyu/chatgpt-web/pull/502)
|
113 |
+
- 优化 `docker` 打包 [whatwewant](https://github.com/Chanzhaoyu/chatgpt-web/pull/520)
|
114 |
+
- `Prompt` 添加翻译和优化布局
|
115 |
+
- 「繁体中文」补全和审阅 [PeterDaveHello](https://github.com/Chanzhaoyu/chatgpt-web/pull/542)
|
116 |
+
- 语言选择调整为下路框形式
|
117 |
+
- 权限输入框类型调整为密码形式
|
118 |
+
|
119 |
+
## BugFix
|
120 |
+
- `JSON` 导入检查 [Nothing1024](https://github.com/Chanzhaoyu/chatgpt-web/pull/523)
|
121 |
+
- 修复 `AUTH_SECRET_KEY` 模式下跨域异常并添加对 `node.js 19` 版本的支持 [yi-ge](https://github.com/Chanzhaoyu/chatgpt-web/pull/499)
|
122 |
+
- 确定清空上下文时不应该重置会话标题
|
123 |
+
|
124 |
+
## Other
|
125 |
+
- 调整文档
|
126 |
+
- 更新依赖
|
127 |
+
|
128 |
+
## v2.10.4
|
129 |
+
|
130 |
+
`2023-03-11`
|
131 |
+
|
132 |
+
## Feature
|
133 |
+
- 感谢 [Nothing1024](https://github.com/Chanzhaoyu/chatgpt-web/pull/268) 添加 `Prompt` 模板和 `Prompt` 商店支持
|
134 |
+
|
135 |
+
## Enhancement
|
136 |
+
- 设置添加关闭按钮[#495]
|
137 |
+
|
138 |
+
## Demo
|
139 |
+
|
140 |
+
![Prompt](https://camo.githubusercontent.com/6a51af751eb29238cb7ef4f8fbd89f63db837562f97f33273095424e62dc9194/68747470733a2f2f73312e6c6f63696d672e636f6d2f323032332f30332f30342f333036326665633163613562632e676966)
|
141 |
+
|
142 |
+
## v2.10.3
|
143 |
+
|
144 |
+
`2023-03-10`
|
145 |
+
|
146 |
+
> 声明:除 `ChatGPTUnofficialProxyAPI` 使用的非官方代理外,本项目代码包括上游引用包均开源在 `GitHub`,如果你觉得本项目有监控后门或有问题导致你的账号、API被封,那我很抱歉。我可能`BUG`写的多,但我不缺德。此次主要为前端界面调整,周末愉快。
|
147 |
+
|
148 |
+
## Feature
|
149 |
+
- 支持长回复 [[yi-ge](https://github.com/Chanzhaoyu/chatgpt-web/pull/450)][[详情](https://github.com/Chanzhaoyu/chatgpt-web/pull/450)]
|
150 |
+
- 支持 `PWA` [[chenxch](https://github.com/Chanzhaoyu/chatgpt-web/pull/452)]
|
151 |
+
|
152 |
+
## Enhancement
|
153 |
+
- 调整移动端按钮和优化布局
|
154 |
+
- 调整 `iOS` 上安全距离
|
155 |
+
- 简化 `docker-compose` 部署 [[cloudGrin](https://github.com/Chanzhaoyu/chatgpt-web/pull/466)]
|
156 |
+
|
157 |
+
## BugFix
|
158 |
+
- 修复清空会话侧边栏标题不会重置的问题 [[RyanXinOne](https://github.com/Chanzhaoyu/chatgpt-web/pull/453)]
|
159 |
+
- 修复设置文字过长时导致的设置按钮消失的问题
|
160 |
+
|
161 |
+
## Other
|
162 |
+
- 更新依赖
|
163 |
+
|
164 |
+
## v2.10.2
|
165 |
+
|
166 |
+
`2023-03-09`
|
167 |
+
|
168 |
+
衔接 `2.10.1` 版本[详情](https://github.com/Chanzhaoyu/chatgpt-web/releases/tag/v2.10.1)
|
169 |
+
|
170 |
+
## Enhancement
|
171 |
+
- 移动端下输入框获得焦点时左侧按钮隐藏
|
172 |
+
|
173 |
+
## BugFix
|
174 |
+
- 修复 `2.10.1` 中添加 `OPENAI_API_MODEL` 变量的判断错误,会导致默认模型指定失效,抱歉
|
175 |
+
- 回退 `2.10.1` 中前端变量影响 `Docker` 打包
|
176 |
+
|
177 |
+
## v2.10.1
|
178 |
+
|
179 |
+
`2023-03-09`
|
180 |
+
|
181 |
+
注意:删除了 `.env` 文件改用 `.env.example` 代替,如果是手动部署的同学现在需要手动创建 `.env` 文件并从 `.env.example` 中复制需要的变量,并且 `.env` 文件现在会在 `Git` 提交中被忽略,原因如下:
|
182 |
+
|
183 |
+
- 在项目中添加 `.env` 从一开始就是个错误的示范
|
184 |
+
- 如果是 `Fork` 项目进行修改测试总是会被 `Git` 修改提示给打扰
|
185 |
+
- 感谢 [yi-ge](https://github.com/Chanzhaoyu/chatgpt-web/pull/395) 的提醒和修改
|
186 |
+
|
187 |
+
|
188 |
+
这两天开始,官方已经开始对第三方代理进行了拉闸, `accessToken` 即将或已经开始可能会不可使用。异常 `API` 使用也开始封号,封号缘由不明,如果出现使用 `API` 提示错误,请查看后端控制台信息,或留意邮箱。
|
189 |
+
|
190 |
+
## Feature
|
191 |
+
- 感谢 [CornerSkyless](https://github.com/Chanzhaoyu/chatgpt-web/pull/393) 添加是否发送上下文开关功能
|
192 |
+
|
193 |
+
## Enhancement
|
194 |
+
- 感谢 [nagaame](https://github.com/Chanzhaoyu/chatgpt-web/pull/415) 优化`docker`打包镜像文件过大的问题
|
195 |
+
- 感谢 [xieccc](https://github.com/Chanzhaoyu/chatgpt-web/pull/404) 新增 `API` 模型配置变量 `OPENAI_API_MODEL`
|
196 |
+
- 感谢 [acongee](https://github.com/Chanzhaoyu/chatgpt-web/pull/394) 优化输出时滚动条问题
|
197 |
+
|
198 |
+
## BugFix
|
199 |
+
- 感谢 [CornerSkyless](https://github.com/Chanzhaoyu/chatgpt-web/pull/392) 修复导出图片会丢失头像的问题
|
200 |
+
- 修复深色模式导出图片的样式问题
|
201 |
+
|
202 |
+
|
203 |
+
## v2.10.0
|
204 |
+
|
205 |
+
`2023-03-07`
|
206 |
+
|
207 |
+
- 老规矩,手动部署的同学需要删除 `node_modules` 安装包重新安装降低出错概率,其他部署不受影响,但是可能会有缓存问题。
|
208 |
+
- 虽然说了更新放缓,但是 `issues` 不看, `PR` 不改我睡不着,我的邮箱从每天早上`8`点到凌晨`12`永远在滴滴滴,所以求求各位,超时的`issues`自己关闭下哈,我真的需要缓冲一下。
|
209 |
+
- 演示图片���看最后
|
210 |
+
|
211 |
+
## Feature
|
212 |
+
- 添加权限功能,用法:`service/.env` 中的 `AUTH_SECRET_KEY` 变量添加密码
|
213 |
+
- 感谢 [PeterDaveHello](https://github.com/Chanzhaoyu/chatgpt-web/pull/348) 添加「繁体中文」翻译
|
214 |
+
- 感谢 [GermMC](https://github.com/Chanzhaoyu/chatgpt-web/pull/369) 添加聊天记录导入、导出、清空的功能
|
215 |
+
- 感谢 [CornerSkyless](https://github.com/Chanzhaoyu/chatgpt-web/pull/374) 添加会话保存为本地图片的功能
|
216 |
+
|
217 |
+
|
218 |
+
## Enhancement
|
219 |
+
- 感谢 [CornerSkyless](https://github.com/Chanzhaoyu/chatgpt-web/pull/363) 添加 `ctrl+enter` 发送消息
|
220 |
+
- 现在新消息只有在结束了之后才滚动到底部,而不是之前的强制性
|
221 |
+
- 优化部分代码
|
222 |
+
|
223 |
+
## BugFix
|
224 |
+
- 转义状态码前端显示,防止直接暴露 `key`(我可能需要更多的状态码补充)
|
225 |
+
|
226 |
+
## Other
|
227 |
+
- 更新依赖到最新
|
228 |
+
|
229 |
+
## 演示
|
230 |
+
> 不是界面最新效果,有美化改动
|
231 |
+
|
232 |
+
权限
|
233 |
+
|
234 |
+
![权限](https://user-images.githubusercontent.com/24789441/223438518-80d58d42-e344-4e39-b87c-251ff73925ed.png)
|
235 |
+
|
236 |
+
聊天记录导出
|
237 |
+
|
238 |
+
![聊天记录导出](https://user-images.githubusercontent.com/57023771/223372153-6d8e9ec1-d82c-42af-b4bd-232e50504a25.gif)
|
239 |
+
|
240 |
+
保存图片到本地
|
241 |
+
|
242 |
+
![保存图片到本地](https://user-images.githubusercontent.com/13901424/223423555-b69b95ef-8bcf-4951-a7c9-98aff2677e18.gif)
|
243 |
+
|
244 |
+
## v2.9.3
|
245 |
+
|
246 |
+
`2023-03-06`
|
247 |
+
|
248 |
+
## Enhancement
|
249 |
+
- 感谢 [ChandlerVer5](https://github.com/Chanzhaoyu/chatgpt-web/pull/305) 使用 `markdown-it` 替换 `marked`,解决代码块闪烁的问题
|
250 |
+
- 感谢 [shansing](https://github.com/Chanzhaoyu/chatgpt-web/pull/277) 改善文档
|
251 |
+
- 感谢 [nalf3in](https://github.com/Chanzhaoyu/chatgpt-web/pull/293) 添加英文翻译
|
252 |
+
|
253 |
+
## BugFix
|
254 |
+
- 感谢[sepcnt ](https://github.com/Chanzhaoyu/chatgpt-web/pull/279) 修复切换记录时编辑状态未关闭的问题
|
255 |
+
- 修复复制代码的兼容性报错问题
|
256 |
+
- 修复部分优化小问题
|
257 |
+
|
258 |
+
## v2.9.2
|
259 |
+
|
260 |
+
`2023-03-04`
|
261 |
+
|
262 |
+
手动部署的同学,务必删除根目录和`service`中的`node_modules`重新安装依赖,降低出现问题的概率,自动部署的不需要做改动。
|
263 |
+
|
264 |
+
### Feature
|
265 |
+
- 感谢 [hyln9](https://github.com/Chanzhaoyu/chatgpt-web/pull/247) 添加对渲染 `LaTex` 数学公式的支持
|
266 |
+
- 感谢 [ottocsb](https://github.com/Chanzhaoyu/chatgpt-web/pull/227) 添加支持 `webAPP` (苹果添加到主页书签访问)支持
|
267 |
+
- 添加 `OPENAI_API_BASE_URL` 可选环境变量[#249]
|
268 |
+
## Enhancement
|
269 |
+
- 优化在高分屏上主题内容的最大宽度[#257]
|
270 |
+
- 现在文字按单词截断[#215][#225]
|
271 |
+
### BugFix
|
272 |
+
- 修复动态生成时代码块不能被复制的问题[#251][#260]
|
273 |
+
- 修复 `iOS` 移动端输入框不会被键盘顶起的问题[#256]
|
274 |
+
- 修复控制台渲染警告
|
275 |
+
## Other
|
276 |
+
- 更新依赖至最新
|
277 |
+
- 修改 `README` 内容
|
278 |
+
|
279 |
+
## v2.9.1
|
280 |
+
|
281 |
+
`2023-03-02`
|
282 |
+
|
283 |
+
### Feature
|
284 |
+
- 代码块添加当前代码语言显示和复制功能[#197][#196]
|
285 |
+
- 完善多语言,现在可以切换中英文显示
|
286 |
+
|
287 |
+
## Enhancement
|
288 |
+
- 由[Zo3i](https://github.com/Chanzhaoyu/chatgpt-web/pull/187) 完善 `docker-compose` 部署文档
|
289 |
+
|
290 |
+
### BugFix
|
291 |
+
- 由 [ottocsb](https://github.com/Chanzhaoyu/chatgpt-web/pull/200) 修复头像修改不同步的问题
|
292 |
+
## Other
|
293 |
+
- 更新依赖至最新
|
294 |
+
- 修改 `README` 内容
|
295 |
+
## v2.9.0
|
296 |
+
|
297 |
+
`2023-03-02`
|
298 |
+
|
299 |
+
### Feature
|
300 |
+
- 现在能复制带格式的消息文本
|
301 |
+
- 新设计的设定页面,可以自定义姓名、描述、头像(链接方式)
|
302 |
+
- 新增`403`和`404`页面以便扩展
|
303 |
+
|
304 |
+
## Enhancement
|
305 |
+
- 更新 `chatgpt` 使 `ChatGPTAPI` 支持 `gpt-3.5-turbo-0301`(默认)
|
306 |
+
- 取消了前端超时限制设定
|
307 |
+
|
308 |
+
## v2.8.3
|
309 |
+
|
310 |
+
`2023-03-01`
|
311 |
+
|
312 |
+
### Feature
|
313 |
+
- 消息已输出内容不会因为中断而消失[#167]
|
314 |
+
- 添加复制消息按钮[#133]
|
315 |
+
|
316 |
+
### Other
|
317 |
+
- `README` 添加声明内容
|
318 |
+
|
319 |
+
## v2.8.2
|
320 |
+
|
321 |
+
`2023-02-28`
|
322 |
+
### Enhancement
|
323 |
+
- 代码主题调整为 `One Dark - light|dark` 适配深色模式
|
324 |
+
### BugFix
|
325 |
+
- 修复普通文本代码渲染和深色模式下的问题[#139][#154]
|
326 |
+
|
327 |
+
## v2.8.1
|
328 |
+
|
329 |
+
`2023-02-27`
|
330 |
+
|
331 |
+
### BugFix
|
332 |
+
- 修复 `API` 版本不是 `Markdown` 时,普通 `HTML` 代码会被渲染的问题 [#146]
|
333 |
+
|
334 |
+
## v2.8.0
|
335 |
+
|
336 |
+
`2023-02-27`
|
337 |
+
|
338 |
+
- 感谢 [puppywang](https://github.com/Chanzhaoyu/chatgpt-web/commit/628187f5c3348bda0d0518f90699a86525d19018) 修复了 `2.7.0` 版本中关于流输出数据的问题(使用 `nginx` 需要自行配置 `octet-stream` 相关内容)
|
339 |
+
|
340 |
+
- 关于为什么使用 `octet-stream` 而不是 `sse`,是因为更好的兼容之前的模式。
|
341 |
+
|
342 |
+
- 建议更新到此版本获得比较完整的体验
|
343 |
+
|
344 |
+
### Enhancement
|
345 |
+
- 优化了部份代码和类型提示
|
346 |
+
- 输入框添加换行提示
|
347 |
+
- 移动端输入框现在回车为换行,而不是直接提交
|
348 |
+
- 移动端双击标题返回顶部,箭头返回底部
|
349 |
+
|
350 |
+
### BugFix
|
351 |
+
- 流输出数据下的问题[#122]
|
352 |
+
- 修复了 `API Key` 下部份代码不换行的问题
|
353 |
+
- 修复移动端深色模式部份样式问题[#123][#126]
|
354 |
+
- 修复主题模式图标不一致的问题[#126]
|
355 |
+
|
356 |
+
## v2.7.3
|
357 |
+
|
358 |
+
`2023-02-25`
|
359 |
+
|
360 |
+
### Feature
|
361 |
+
- 适配系统深色模式 [#118](https://github.com/Chanzhaoyu/chatgpt-web/issues/103)
|
362 |
+
### BugFix
|
363 |
+
- 修复用户消息能被渲染为 `HTML` 问题 [#117](https://github.com/Chanzhaoyu/chatgpt-web/issues/117)
|
364 |
+
|
365 |
+
## v2.7.2
|
366 |
+
|
367 |
+
`2023-02-24`
|
368 |
+
### Enhancement
|
369 |
+
- 消息使用 [github-markdown-css](https://www.npmjs.com/package/github-markdown-css) 进行美化,现在支持全语法
|
370 |
+
- 移除测试无用函数
|
371 |
+
|
372 |
+
## v2.7.1
|
373 |
+
|
374 |
+
`2023-02-23`
|
375 |
+
|
376 |
+
因为消息流在 `accessToken` 中存在解析失败和消息不完整等一系列的问题,调整回正常消息形式
|
377 |
+
|
378 |
+
### Feature
|
379 |
+
- 现在可以中断请求过长没有答复的消息
|
380 |
+
- 现在可以删除单条消息
|
381 |
+
- 设置中显示当前版本信息
|
382 |
+
|
383 |
+
### BugFix
|
384 |
+
- 回退 `2.7.0` 的消息不稳定的问题
|
385 |
+
|
386 |
+
## v2.7.0
|
387 |
+
|
388 |
+
`2023-02-23`
|
389 |
+
|
390 |
+
### Feature
|
391 |
+
- 使用消息流返回信息,反应更迅速
|
392 |
+
|
393 |
+
### Enhancement
|
394 |
+
- 样式的一点小改动
|
395 |
+
|
396 |
+
## v2.6.2
|
397 |
+
|
398 |
+
`2023-02-22`
|
399 |
+
### BugFix
|
400 |
+
- 还原修改代理导致的异常问题
|
401 |
+
|
402 |
+
## v2.6.1
|
403 |
+
|
404 |
+
`2023-02-22`
|
405 |
+
|
406 |
+
### Feature
|
407 |
+
- 新增 `Railway` 部署模版
|
408 |
+
|
409 |
+
### BugFix
|
410 |
+
- 手动打包 `Proxy` 问题
|
411 |
+
|
412 |
+
## v2.6.0
|
413 |
+
|
414 |
+
`2023-02-21`
|
415 |
+
### Feature
|
416 |
+
- 新增对 `网页 accessToken` 调用 `ChatGPT`,更智能不过不太稳定 [#51](https://github.com/Chanzhaoyu/chatgpt-web/issues/51)
|
417 |
+
- 前端页面设置按钮显示查看当前后端服务配置
|
418 |
+
|
419 |
+
### Enhancement
|
420 |
+
- 新增 `TIMEOUT_MS` 环境变量设定后端超时时常(单位:毫秒)[#62](https://github.com/Chanzhaoyu/chatgpt-web/issues/62)
|
421 |
+
|
422 |
+
## v2.5.2
|
423 |
+
|
424 |
+
`2023-02-21`
|
425 |
+
### Feature
|
426 |
+
- 增加对 `markdown` 格式的支持 [Demo](https://github.com/Chanzhaoyu/chatgpt-web/pull/77)
|
427 |
+
### BugFix
|
428 |
+
- 重载会话时滚动条保持
|
429 |
+
|
430 |
+
## v2.5.1
|
431 |
+
|
432 |
+
`2023-02-21`
|
433 |
+
|
434 |
+
### Enhancement
|
435 |
+
- 调整路由模式为 `hash`
|
436 |
+
- 调整新增会话添加到
|
437 |
+
- 调整移动端样式
|
438 |
+
|
439 |
+
|
440 |
+
## v2.5.0
|
441 |
+
|
442 |
+
`2023-02-20`
|
443 |
+
|
444 |
+
### Feature
|
445 |
+
- 会话 `loading` 现在显示为光标动画
|
446 |
+
- 会话现在可以再次生成回复
|
447 |
+
- 会话异常可以再次进行请求
|
448 |
+
- 所有删除选项添加确认操作
|
449 |
+
|
450 |
+
### Enhancement
|
451 |
+
- 调整 `chat` 为路由页面而不是组件形式
|
452 |
+
- 更新依赖至最新
|
453 |
+
- 调整移动端体验
|
454 |
+
|
455 |
+
### BugFix
|
456 |
+
- 修复移动端左侧菜单显示不完整的问题
|
457 |
+
|
458 |
+
## v2.4.1
|
459 |
+
|
460 |
+
`2023-02-18`
|
461 |
+
|
462 |
+
### Enhancement
|
463 |
+
- 调整部份移动端上的样式
|
464 |
+
- 输入框支持换行
|
465 |
+
|
466 |
+
## v2.4.0
|
467 |
+
|
468 |
+
`2023-02-17`
|
469 |
+
|
470 |
+
### Feature
|
471 |
+
- 响应式支持移动端
|
472 |
+
### Enhancement
|
473 |
+
- 修改部份描述错误
|
474 |
+
|
475 |
+
## v2.3.3
|
476 |
+
|
477 |
+
`2023-02-16`
|
478 |
+
|
479 |
+
### Feature
|
480 |
+
- 添加 `README` 部份说明和贡献列表
|
481 |
+
- 添加 `docker` 镜像
|
482 |
+
- 添加 `GitHub Action` 自动化构建
|
483 |
+
|
484 |
+
### BugFix
|
485 |
+
- 回退依赖更新导致的 [Eslint 报错](https://github.com/eslint/eslint/issues/16896)
|
486 |
+
|
487 |
+
## v2.3.2
|
488 |
+
|
489 |
+
`2023-02-16`
|
490 |
+
|
491 |
+
### Enhancement
|
492 |
+
- 更新依赖至最新
|
493 |
+
- 优化部份内容
|
494 |
+
|
495 |
+
## v2.3.1
|
496 |
+
|
497 |
+
`2023-02-15`
|
498 |
+
|
499 |
+
### BugFix
|
500 |
+
- 修复多会话状态下一些意想不到的问题
|
501 |
+
|
502 |
+
## v2.3.0
|
503 |
+
|
504 |
+
`2023-02-15`
|
505 |
+
### Feature
|
506 |
+
- 代码类型信息高亮显示
|
507 |
+
- 支持 `node ^16` 版本
|
508 |
+
- 移动端响应式初步支持
|
509 |
+
- `vite` 中 `proxy` 代理
|
510 |
+
|
511 |
+
### Enhancement
|
512 |
+
- 调整超时处理范围
|
513 |
+
|
514 |
+
### BugFix
|
515 |
+
- 修复取消请求错误提示会添加到信息中
|
516 |
+
- 修复部份情况下提交请求不可用
|
517 |
+
- 修复侧边栏宽度变化闪烁的问题
|
518 |
+
|
519 |
+
## v2.2.0
|
520 |
+
|
521 |
+
`2023-02-14`
|
522 |
+
### Feature
|
523 |
+
- 会话和上下文本地储存
|
524 |
+
- 侧边栏本地储存
|
525 |
+
|
526 |
+
## v2.1.0
|
527 |
+
|
528 |
+
`2023-02-14`
|
529 |
+
### Enhancement
|
530 |
+
- 更新依赖至最新
|
531 |
+
- 联想功能移动至前端提交,后端只做转发
|
532 |
+
|
533 |
+
### BugFix
|
534 |
+
- 修复部份项目检测有关 `Bug`
|
535 |
+
- 修复清除上下文按钮失效
|
536 |
+
|
537 |
+
## v2.0.0
|
538 |
+
|
539 |
+
`2023-02-13`
|
540 |
+
### Refactor
|
541 |
+
重构并优化大部分内容
|
542 |
+
|
543 |
+
## v1.0.5
|
544 |
+
|
545 |
+
`2023-02-12`
|
546 |
+
|
547 |
+
### Enhancement
|
548 |
+
- 输入框焦点,连续提交
|
549 |
+
|
550 |
+
### BugFix
|
551 |
+
- 修复信息框样式问题
|
552 |
+
- 修复中文输入法提交问题
|
553 |
+
|
554 |
+
## v1.0.4
|
555 |
+
|
556 |
+
`2023-02-11`
|
557 |
+
|
558 |
+
### Feature
|
559 |
+
- 支持上下文联想
|
560 |
+
|
561 |
+
## v1.0.3
|
562 |
+
|
563 |
+
`2023-02-11`
|
564 |
+
|
565 |
+
### Enhancement
|
566 |
+
- 拆分 `service` 文件以便扩展
|
567 |
+
- 调整 `Eslint` 相关验证
|
568 |
+
|
569 |
+
### BugFix
|
570 |
+
- 修复部份控制台报错
|
571 |
+
|
572 |
+
## v1.0.2
|
573 |
+
|
574 |
+
`2023-02-10`
|
575 |
+
|
576 |
+
### BugFix
|
577 |
+
- 修复新增信息容器不会自动滚动到问题
|
578 |
+
- 修复文本过长不换行到问题 [#1](https://github.com/Chanzhaoyu/chatgpt-web/issues/1)
|
CONTRIBUTING.en.md
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Contribution Guide
|
2 |
+
Thank you for your valuable time. Your contributions will make this project better! Before submitting a contribution, please take some time to read the getting started guide below.
|
3 |
+
|
4 |
+
## Semantic Versioning
|
5 |
+
This project follows semantic versioning. We release patch versions for important bug fixes, minor versions for new features or non-important changes, and major versions for significant and incompatible changes.
|
6 |
+
|
7 |
+
Each major change will be recorded in the `changelog`.
|
8 |
+
|
9 |
+
## Submitting Pull Request
|
10 |
+
1. Fork [this repository](https://github.com/Chanzhaoyu/chatgpt-web) and create a branch from `main`. For new feature implementations, submit a pull request to the `feature` branch. For other changes, submit to the `main` branch.
|
11 |
+
2. Install the `pnpm` tool using `npm install pnpm -g`.
|
12 |
+
3. Install the `Eslint` plugin for `VSCode`, or enable `eslint` functionality for other editors such as `WebStorm`.
|
13 |
+
4. Execute `pnpm bootstrap` in the root directory.
|
14 |
+
5. Execute `pnpm install` in the `/service/` directory.
|
15 |
+
6. Make changes to the codebase. If applicable, ensure that appropriate testing has been done.
|
16 |
+
7. Execute `pnpm lint:fix` in the root directory to perform a code formatting check.
|
17 |
+
8. Execute `pnpm type-check` in the root directory to perform a type check.
|
18 |
+
9. Submit a git commit, following the [Commit Guidelines](#commit-guidelines).
|
19 |
+
10. Submit a `pull request`. If there is a corresponding `issue`, please link it using the [linking-a-pull-request-to-an-issue keyword](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).
|
20 |
+
|
21 |
+
## Commit Guidelines
|
22 |
+
|
23 |
+
Commit messages should follow the [conventional-changelog standard](https://www.conventionalcommits.org/en/v1.0.0/):
|
24 |
+
|
25 |
+
```bash
|
26 |
+
<type>[optional scope]: <description>
|
27 |
+
|
28 |
+
[optional body]
|
29 |
+
|
30 |
+
[optional footer]
|
31 |
+
```
|
32 |
+
|
33 |
+
### Commit Types
|
34 |
+
|
35 |
+
The following is a list of commit types:
|
36 |
+
|
37 |
+
- feat: New feature or functionality
|
38 |
+
- fix: Bug fix
|
39 |
+
- docs: Documentation update
|
40 |
+
- style: Code style or component style update
|
41 |
+
- refactor: Code refactoring, no new features or bug fixes introduced
|
42 |
+
- perf: Performance optimization
|
43 |
+
- test: Unit test
|
44 |
+
- chore: Other commits that do not modify src or test files
|
45 |
+
|
46 |
+
|
47 |
+
## License
|
48 |
+
|
49 |
+
[MIT](./license)
|
CONTRIBUTING.md
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 贡献指南
|
2 |
+
感谢你的宝贵时间。你的贡献将使这个项目变得更好!在提交贡献之前,请务必花点时间阅读下面的入门指南。
|
3 |
+
|
4 |
+
## 语义化版本
|
5 |
+
该项目遵循语义化版本。我们对重要的漏洞修复发布修订号,对新特性或不重要的变更发布次版本号,对重大且不兼容的变更发布主版本号。
|
6 |
+
|
7 |
+
每个重大更改都将记录在 `changelog` 中。
|
8 |
+
|
9 |
+
## 提交 Pull Request
|
10 |
+
1. Fork [此仓库](https://github.com/Chanzhaoyu/chatgpt-web),从 `main` 创建分支。新功能实现请发 pull request 到 `feature` 分支。其他更改发到 `main` 分支。
|
11 |
+
2. 使用 `npm install pnpm -g` 安装 `pnpm` 工具。
|
12 |
+
3. `vscode` 安装了 `Eslint` 插件,其它编辑器如 `webStorm` 打开了 `eslint` 功能。
|
13 |
+
4. 根目录下执行 `pnpm bootstrap`。
|
14 |
+
5. `/service/` 目录下执行 `pnpm install`。
|
15 |
+
6. 对代码库进行更改。如果适用的话,请确保进行了相应的测试。
|
16 |
+
7. 请在根目录下执行 `pnpm lint:fix` 进行代码格式检查。
|
17 |
+
8. 请在根目录下执行 `pnpm type-check` 进行类型检查。
|
18 |
+
9. 提交 git commit, 请同时遵守 [Commit 规范](#commit-指南)
|
19 |
+
10. 提交 `pull request`, 如果有对应的 `issue`,请进行[关联](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)。
|
20 |
+
|
21 |
+
## Commit 指南
|
22 |
+
|
23 |
+
Commit messages 请遵循[conventional-changelog 标准](https://www.conventionalcommits.org/en/v1.0.0/):
|
24 |
+
|
25 |
+
```bash
|
26 |
+
<类型>[可选 范围]: <描述>
|
27 |
+
|
28 |
+
[可选 正文]
|
29 |
+
|
30 |
+
[可选 脚注]
|
31 |
+
```
|
32 |
+
|
33 |
+
### Commit 类型
|
34 |
+
|
35 |
+
以下是 commit 类型列表:
|
36 |
+
|
37 |
+
- feat: 新特性或功能
|
38 |
+
- fix: 缺陷修复
|
39 |
+
- docs: 文档更新
|
40 |
+
- style: 代码风格或者组件样式更新
|
41 |
+
- refactor: 代码重构,不引入新功能和缺陷修复
|
42 |
+
- perf: 性能优化
|
43 |
+
- test: 单元测试
|
44 |
+
- chore: 其他不修改 src 或测试文件的提交
|
45 |
+
|
46 |
+
|
47 |
+
## License
|
48 |
+
|
49 |
+
[MIT](./license)
|
Dockerfile
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# build front-end
|
2 |
+
FROM node:lts-alpine AS frontend
|
3 |
+
|
4 |
+
RUN npm install pnpm -g
|
5 |
+
|
6 |
+
WORKDIR /app
|
7 |
+
|
8 |
+
COPY ./package.json /app
|
9 |
+
|
10 |
+
COPY ./pnpm-lock.yaml /app
|
11 |
+
|
12 |
+
RUN pnpm install
|
13 |
+
|
14 |
+
COPY . /app
|
15 |
+
|
16 |
+
RUN pnpm run build
|
17 |
+
|
18 |
+
# build backend
|
19 |
+
FROM node:lts-alpine as backend
|
20 |
+
|
21 |
+
RUN npm install pnpm -g
|
22 |
+
|
23 |
+
WORKDIR /app
|
24 |
+
|
25 |
+
COPY /service/package.json /app
|
26 |
+
|
27 |
+
COPY /service/pnpm-lock.yaml /app
|
28 |
+
|
29 |
+
RUN pnpm install
|
30 |
+
|
31 |
+
COPY /service /app
|
32 |
+
|
33 |
+
RUN pnpm build
|
34 |
+
|
35 |
+
# service
|
36 |
+
FROM node:lts-alpine
|
37 |
+
|
38 |
+
RUN npm install pnpm -g
|
39 |
+
|
40 |
+
WORKDIR /app
|
41 |
+
|
42 |
+
COPY /service/package.json /app
|
43 |
+
|
44 |
+
COPY /service/pnpm-lock.yaml /app
|
45 |
+
|
46 |
+
RUN pnpm install --production && rm -rf /root/.npm /root/.pnpm-store /usr/local/share/.cache /tmp/*
|
47 |
+
|
48 |
+
COPY /service /app
|
49 |
+
|
50 |
+
COPY --from=frontend /app/dist /app/public
|
51 |
+
|
52 |
+
COPY --from=backend /app/build /app/build
|
53 |
+
|
54 |
+
EXPOSE 7860
|
55 |
+
|
56 |
+
CMD ["pnpm", "run", "prod"]
|
README.md
CHANGED
@@ -1,11 +1,337 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ChatGPT Web
|
2 |
+
|
3 |
+
> 声明:此项目只发布于 GitHub,基于 MIT 协议,免费且作为开源学习使用。并且不会有任何形式的卖号、付费服务、讨论群、讨论组等行为。谨防受骗。
|
4 |
+
|
5 |
+
![cover](./docs/c1.png)
|
6 |
+
![cover2](./docs/c2.png)
|
7 |
+
|
8 |
+
- [ChatGPT Web](#chatgpt-web)
|
9 |
+
- [介绍](#介绍)
|
10 |
+
- [待实现路线](#待实现路线)
|
11 |
+
- [前置要求](#前置要求)
|
12 |
+
- [Node](#node)
|
13 |
+
- [PNPM](#pnpm)
|
14 |
+
- [填写密钥](#填写密钥)
|
15 |
+
- [安装依赖](#安装依赖)
|
16 |
+
- [后端](#后端)
|
17 |
+
- [前端](#前端)
|
18 |
+
- [测试环境运行](#测试环境运行)
|
19 |
+
- [后端服务](#后端服务)
|
20 |
+
- [前端网页](#前端网页)
|
21 |
+
- [环境变量](#环境变量)
|
22 |
+
- [打包](#打包)
|
23 |
+
- [使用 Docker](#使用-docker)
|
24 |
+
- [Docker 参数示例](#docker-参数示例)
|
25 |
+
- [Docker build \& Run](#docker-build--run)
|
26 |
+
- [Docker compose](#docker-compose)
|
27 |
+
- [使用 Railway 部署](#使用-railway-部署)
|
28 |
+
- [Railway 环境变量](#railway-环境变量)
|
29 |
+
- [手动打包](#手动打包)
|
30 |
+
- [后端服务](#后端服务-1)
|
31 |
+
- [前端网页](#前端网页-1)
|
32 |
+
- [常见问题](#常见问题)
|
33 |
+
- [参与贡献](#参与贡献)
|
34 |
+
- [赞助](#赞助)
|
35 |
+
- [License](#license)
|
36 |
+
## 介绍
|
37 |
+
|
38 |
+
支持双模型,提供了两种非官方 `ChatGPT API` 方法
|
39 |
+
|
40 |
+
| 方式 | 免费? | 可靠性 | 质量 |
|
41 |
+
| --------------------------------------------- | ------ | ---------- | ---- |
|
42 |
+
| `ChatGPTAPI(gpt-3.5-turbo-0301)` | 否 | 可靠 | 相对较笨 |
|
43 |
+
| `ChatGPTUnofficialProxyAPI(网页 accessToken)` | 是 | 相对不可靠 | 聪明 |
|
44 |
+
|
45 |
+
对比:
|
46 |
+
1. `ChatGPTAPI` 使用 `gpt-3.5-turbo` 通过 `OpenAI` 官方 `API` 调用 `ChatGPT`
|
47 |
+
2. `ChatGPTUnofficialProxyAPI` 使用非官方代理服务器访问 `ChatGPT` 的后端`API`,绕过`Cloudflare`(依赖于第三方服务器,并且有速率限制)
|
48 |
+
|
49 |
+
警告:
|
50 |
+
1. 你应该首先使用 `API` 方式
|
51 |
+
2. 使用 `API` 时,如果网络不通,那是国内被墙了,你需要自建代理,绝对不要使用别人的公开代理,那是危险的。
|
52 |
+
3. 使用 `accessToken` 方式时反向代理将向第三方暴露您的访问令牌,这样做应该不会产生任何不良影响,但在使用这种方法之前请考虑风险。
|
53 |
+
4. 使用 `accessToken` 时,不管你是国内还是国外的机器,都会使用代理。默认代理为 [acheong08](https://github.com/acheong08) 大佬的 `https://bypass.churchless.tech/api/conversation`,这不是后门也不是监听,除非你有能力自己翻过 `CF` 验证,用前请知悉。[社区代理](https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy)(注意:只有这两个是推荐,其他第三方来源,请自行甄别)
|
54 |
+
5. 把项目发布到公共网络时,你应该设置 `AUTH_SECRET_KEY` 变量添加你的密码访问权限,你也应该修改 `index.html` 中的 `title`,防止被关键词搜索到。
|
55 |
+
|
56 |
+
切换方式:
|
57 |
+
1. 进入 `service/.env.example` 文件,复制内容到 `service/.env` 文件
|
58 |
+
2. 使用 `OpenAI API Key` 请填写 `OPENAI_API_KEY` 字段 [(获取 apiKey)](https://platform.openai.com/overview)
|
59 |
+
3. 使用 `Web API` 请填写 `OPENAI_ACCESS_TOKEN` 字段 [(获取 accessToken)](https://chat.openai.com/api/auth/session)
|
60 |
+
4. 同时存在时以 `OpenAI API Key` 优先
|
61 |
+
|
62 |
+
环境变量:
|
63 |
+
|
64 |
+
全部参数变量请查看或[这里](#环境变量)
|
65 |
+
|
66 |
+
```
|
67 |
+
/service/.env.example
|
68 |
+
```
|
69 |
+
|
70 |
+
## 待实现路线
|
71 |
+
[✓] 双模型
|
72 |
+
|
73 |
+
[✓] 多会话储存和上下文逻辑
|
74 |
+
|
75 |
+
[✓] 对代码等消息类型的格式化美化处理
|
76 |
+
|
77 |
+
[✓] 访问权限控制
|
78 |
+
|
79 |
+
[✓] 数据导入、导出
|
80 |
+
|
81 |
+
[✓] 保存消息到本地图片
|
82 |
+
|
83 |
+
[✓] 界面多语言
|
84 |
+
|
85 |
+
[✓] 界面主题
|
86 |
+
|
87 |
+
[✗] More...
|
88 |
+
|
89 |
+
## 前置要求
|
90 |
+
|
91 |
+
### Node
|
92 |
+
|
93 |
+
`node` 需要 `^16 || ^18 || ^19` 版本(`node >= 14` 需要安装 [fetch polyfill](https://github.com/developit/unfetch#usage-as-a-polyfill)),使用 [nvm](https://github.com/nvm-sh/nvm) 可管理本地多个 `node` 版本
|
94 |
+
|
95 |
+
```shell
|
96 |
+
node -v
|
97 |
+
```
|
98 |
+
|
99 |
+
### PNPM
|
100 |
+
如果你没有安装过 `pnpm`
|
101 |
+
```shell
|
102 |
+
npm install pnpm -g
|
103 |
+
```
|
104 |
+
|
105 |
+
### 填写密钥
|
106 |
+
获取 `Openai Api Key` 或 `accessToken` 并填写本地环境变量 [跳转](#介绍)
|
107 |
+
|
108 |
+
```
|
109 |
+
# service/.env 文件
|
110 |
+
|
111 |
+
# OpenAI API Key - https://platform.openai.com/overview
|
112 |
+
OPENAI_API_KEY=
|
113 |
+
|
114 |
+
# change this to an `accessToken` extracted from the ChatGPT site's `https://chat.openai.com/api/auth/session` response
|
115 |
+
OPENAI_ACCESS_TOKEN=
|
116 |
+
```
|
117 |
+
|
118 |
+
## 安装依赖
|
119 |
+
|
120 |
+
> 为了简便 `后端开发人员` 的了解负担,所以并没有采用前端 `workspace` 模式,而是分文件夹存放。如果只需要前端页面做二次开发,删除 `service` 文件夹即可。
|
121 |
+
|
122 |
+
### 后端
|
123 |
+
|
124 |
+
进入文件夹 `/service` 运行以下命令
|
125 |
+
|
126 |
+
```shell
|
127 |
+
pnpm install
|
128 |
+
```
|
129 |
+
|
130 |
+
### 前端
|
131 |
+
根目录下运行以下命令
|
132 |
+
```shell
|
133 |
+
pnpm bootstrap
|
134 |
+
```
|
135 |
+
|
136 |
+
## 测试环境运行
|
137 |
+
### 后端服务
|
138 |
+
|
139 |
+
进入文件夹 `/service` 运行以下命令
|
140 |
+
|
141 |
+
```shell
|
142 |
+
pnpm start
|
143 |
+
```
|
144 |
+
|
145 |
+
### 前端网页
|
146 |
+
根目录下运行以下命令
|
147 |
+
```shell
|
148 |
+
pnpm dev
|
149 |
+
```
|
150 |
+
|
151 |
+
## 环境变量
|
152 |
+
|
153 |
+
`API` 可用:
|
154 |
+
|
155 |
+
- `OPENAI_API_KEY` 和 `OPENAI_ACCESS_TOKEN` 二选一
|
156 |
+
- `OPENAI_API_MODEL` 设置模型,可选,默认:`gpt-3.5-turbo`
|
157 |
+
- `OPENAI_API_BASE_URL` 设置接口地址,可选,默认:`https://api.openai.com`
|
158 |
+
- `OPENAI_API_DISABLE_DEBUG` 设置接口关闭 debug 日志,可选,默认:empty 不关闭
|
159 |
+
|
160 |
+
`ACCESS_TOKEN` 可用:
|
161 |
+
|
162 |
+
- `OPENAI_ACCESS_TOKEN` 和 `OPENAI_API_KEY` 二选一,同时存在时,`OPENAI_API_KEY` 优先
|
163 |
+
- `API_REVERSE_PROXY` 设置反向代理,可选,默认:`https://bypass.churchless.tech/api/conversation`,[社区](https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy)(注意:只有这两个是推荐,其他第三方来源,请自行甄别)
|
164 |
+
|
165 |
+
通用:
|
166 |
+
|
167 |
+
- `AUTH_SECRET_KEY` 访问权限密钥,可选
|
168 |
+
- `MAX_REQUEST_PER_HOUR` 每小时最大请求次数,可选,默认无限
|
169 |
+
- `TIMEOUT_MS` 超时,单位毫秒,可选
|
170 |
+
- `SOCKS_PROXY_HOST` 和 `SOCKS_PROXY_PORT` 一起时生效,可选
|
171 |
+
- `SOCKS_PROXY_PORT` 和 `SOCKS_PROXY_HOST` 一起时生效,可选
|
172 |
+
- `HTTPS_PROXY` 支持 `http`,`https`, `socks5`,可选
|
173 |
+
- `ALL_PROXY` 支持 `http`,`https`, `socks5`,可选
|
174 |
+
|
175 |
+
## 打包
|
176 |
+
|
177 |
+
### 使用 Docker
|
178 |
+
|
179 |
+
#### Docker 参数示例
|
180 |
+
|
181 |
+
![docker](./docs/docker.png)
|
182 |
+
|
183 |
+
#### Docker build & Run
|
184 |
+
|
185 |
+
```bash
|
186 |
+
docker build -t chatgpt-web .
|
187 |
+
|
188 |
+
# 前台运行
|
189 |
+
docker run --name chatgpt-web --rm -it -p 127.0.0.1:7860:7860 --env OPENAI_API_KEY=your_api_key chatgpt-web
|
190 |
+
|
191 |
+
# 后台运行
|
192 |
+
docker run --name chatgpt-web -d -p 127.0.0.1:7860:7860 --env OPENAI_API_KEY=your_api_key chatgpt-web
|
193 |
+
|
194 |
+
# 运行地址
|
195 |
+
http://localhost:7860/
|
196 |
+
```
|
197 |
+
|
198 |
+
#### Docker compose
|
199 |
+
|
200 |
+
[Hub 地址](https://hub.docker.com/repository/docker/chenzhaoyu94/chatgpt-web/general)
|
201 |
+
|
202 |
+
```yml
|
203 |
+
version: '3'
|
204 |
+
|
205 |
+
services:
|
206 |
+
app:
|
207 |
+
image: chenzhaoyu94/chatgpt-web # 总是使用 latest ,更新时重新 pull 该 tag 镜像即可
|
208 |
+
ports:
|
209 |
+
- 127.0.0.1:7860:7860
|
210 |
+
environment:
|
211 |
+
# 二选一
|
212 |
+
OPENAI_API_KEY: sk-xxx
|
213 |
+
# 二选一
|
214 |
+
OPENAI_ACCESS_TOKEN: xxx
|
215 |
+
# API接口地址,可选,设置 OPENAI_API_KEY 时可用
|
216 |
+
OPENAI_API_BASE_URL: xxx
|
217 |
+
# API模型,可选,设置 OPENAI_API_KEY 时可用,https://platform.openai.com/docs/models
|
218 |
+
# gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301, text-davinci-003, text-davinci-002, code-davinci-002
|
219 |
+
OPENAI_API_MODEL: xxx
|
220 |
+
# 反向代理,可选
|
221 |
+
API_REVERSE_PROXY: xxx
|
222 |
+
# 访问权限密钥,可选
|
223 |
+
AUTH_SECRET_KEY: xxx
|
224 |
+
# 每小时最大请求次数,可选,默认无限
|
225 |
+
MAX_REQUEST_PER_HOUR: 0
|
226 |
+
# 超时,单位毫秒,可选
|
227 |
+
TIMEOUT_MS: 60000
|
228 |
+
# Socks代理,可选,和 SOCKS_PROXY_PORT 一起时生效
|
229 |
+
SOCKS_PROXY_HOST: xxx
|
230 |
+
# Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效
|
231 |
+
SOCKS_PROXY_PORT: xxx
|
232 |
+
# HTTPS 代理,可选,支持 http,https,socks5
|
233 |
+
HTTPS_PROXY: http://xxx:7890
|
234 |
+
```
|
235 |
+
- `OPENAI_API_BASE_URL` 可选,设置 `OPENAI_API_KEY` 时可用
|
236 |
+
- `OPENAI_API_MODEL` 可选,设置 `OPENAI_API_KEY` 时可用
|
237 |
+
### 使用 Railway 部署
|
238 |
+
|
239 |
+
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/yytmgc)
|
240 |
+
|
241 |
+
#### Railway 环境变量
|
242 |
+
|
243 |
+
| 环境变量名称 | 必填 | 备注 |
|
244 |
+
| --------------------- | ---------------------- | -------------------------------------------------------------------------------------------------- |
|
245 |
+
| `PORT` | 必填 | 默认 `7860`
|
246 |
+
| `AUTH_SECRET_KEY` | 可选 | 访问权限密钥 |
|
247 |
+
| `MAX_REQUEST_PER_HOUR` | 可选 | 每小时最大请求次数,可选,默认无限 |
|
248 |
+
| `TIMEOUT_MS` | 可选 | 超时时间,单位毫秒 |
|
249 |
+
| `OPENAI_API_KEY` | `OpenAI API` 二选一 | 使用 `OpenAI API` 所需的 `apiKey` [(获取 apiKey)](https://platform.openai.com/overview) |
|
250 |
+
| `OPENAI_ACCESS_TOKEN` | `Web API` 二选一 | 使用 `Web API` 所需的 `accessToken` [(获取 accessToken)](https://chat.openai.com/api/auth/session) |
|
251 |
+
| `OPENAI_API_BASE_URL` | 可选,`OpenAI API` 时可用 | `API`接口地址 |
|
252 |
+
| `OPENAI_API_MODEL` | 可选,`OpenAI API` 时可用 | `API`模型 |
|
253 |
+
| `API_REVERSE_PROXY` | 可选,`Web API` 时可用 | `Web API` 反向代理地址 [详情](https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy) |
|
254 |
+
| `SOCKS_PROXY_HOST` | 可选,和 `SOCKS_PROXY_PORT` 一起时生效 | Socks代理 |
|
255 |
+
| `SOCKS_PROXY_PORT` | 可选,和 `SOCKS_PROXY_HOST` 一起时生效 | Socks代理端口 |
|
256 |
+
| `SOCKS_PROXY_USERNAME` | 可选,和 `SOCKS_PROXY_HOST` 一起时生效 | Socks代理用户名 |
|
257 |
+
| `SOCKS_PROXY_PASSWORD` | 可选,和 `SOCKS_PROXY_HOST` 一起时生效 | Socks代理密码 |
|
258 |
+
| `HTTPS_PROXY` | 可选 | HTTPS 代理,支持 http,https, socks5 |
|
259 |
+
| `ALL_PROXY` | 可选 | 所有代理 代理,支持 http,https, socks5 |
|
260 |
+
|
261 |
+
> 注意: `Railway` 修改环境变量会重新 `Deploy`
|
262 |
+
|
263 |
+
### 手动打包
|
264 |
+
#### 后端服务
|
265 |
+
> 如果你不需要本项目的 `node` 接口,可以省略如下操作
|
266 |
+
|
267 |
+
复制 `service` 文件夹到你有 `node` 服务环境的服务器上。
|
268 |
+
|
269 |
+
```shell
|
270 |
+
# 安装
|
271 |
+
pnpm install
|
272 |
+
|
273 |
+
# 打包
|
274 |
+
pnpm build
|
275 |
+
|
276 |
+
# 运行
|
277 |
+
pnpm prod
|
278 |
+
```
|
279 |
+
|
280 |
+
PS: 不进行打包,直接在服务器上运行 `pnpm start` 也可
|
281 |
+
|
282 |
+
#### 前端网页
|
283 |
+
|
284 |
+
1、修改根目录下 `.env` 文件中的 `VITE_GLOB_API_URL` 为你的实际后端接口地址
|
285 |
+
|
286 |
+
2、根目录下运行以下命令,然后将 `dist` 文件夹内的文件复制到你网站服务的根目录下
|
287 |
+
|
288 |
+
[参考信息](https://cn.vitejs.dev/guide/static-deploy.html#building-the-app)
|
289 |
+
|
290 |
+
```shell
|
291 |
+
pnpm build
|
292 |
+
```
|
293 |
+
|
294 |
+
## 常见问题
|
295 |
+
Q: 为什么 `Git` 提交总是报错?
|
296 |
+
|
297 |
+
A: 因为有提交信息验证,请遵循 [Commit 指南](./CONTRIBUTING.md)
|
298 |
+
|
299 |
+
Q: 如果只使用前端页面,在哪里改请求接口?
|
300 |
+
|
301 |
+
A: 根目录下 `.env` 文件中的 `VITE_GLOB_API_URL` 字段。
|
302 |
+
|
303 |
+
Q: 文件保存时全部爆红?
|
304 |
+
|
305 |
+
A: `vscode` 请安装项目推荐插件,或手动安装 `Eslint` 插件。
|
306 |
+
|
307 |
+
Q: 前端没有打字机效果?
|
308 |
+
|
309 |
+
A: 一种可能原因是经过 Nginx 反向代理,开启了 buffer,则 Nginx 会尝试从后端缓冲一定大小的数据再发送给浏览器。请尝试在反代参数后添加 `proxy_buffering off;`,然后重载 Nginx。其他 web server 配置同理。
|
310 |
+
|
311 |
+
## 参与贡献
|
312 |
+
|
313 |
+
贡献之前请先阅读 [贡献指南](./CONTRIBUTING.md)
|
314 |
+
|
315 |
+
感谢所有做过贡献的人!
|
316 |
+
|
317 |
+
<a href="https://github.com/Chanzhaoyu/chatgpt-web/graphs/contributors">
|
318 |
+
<img src="https://contrib.rocks/image?repo=Chanzhaoyu/chatgpt-web" />
|
319 |
+
</a>
|
320 |
+
|
321 |
+
## 赞助
|
322 |
+
|
323 |
+
如果你觉得这个项目对你有帮助,并且情况允许的话,可以给我一点点支持,总之非常感谢支持~
|
324 |
+
|
325 |
+
<div style="display: flex; gap: 20px;">
|
326 |
+
<div style="text-align: center">
|
327 |
+
<img style="max-width: 100%" src="./docs/wechat.png" alt="微信" />
|
328 |
+
<p>WeChat Pay</p>
|
329 |
+
</div>
|
330 |
+
<div style="text-align: center">
|
331 |
+
<img style="max-width: 100%" src="./docs/alipay.png" alt="支付宝" />
|
332 |
+
<p>Alipay</p>
|
333 |
+
</div>
|
334 |
+
</div>
|
335 |
+
|
336 |
+
## License
|
337 |
+
MIT © [ChenZhaoYu](./license)
|
config/index.ts
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
export * from './proxy'
|
config/proxy.ts
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { ProxyOptions } from 'vite'
|
2 |
+
|
3 |
+
export function createViteProxy(isOpenProxy: boolean, viteEnv: ImportMetaEnv) {
|
4 |
+
if (!isOpenProxy)
|
5 |
+
return
|
6 |
+
|
7 |
+
const proxy: Record<string, string | ProxyOptions> = {
|
8 |
+
'/api': {
|
9 |
+
target: viteEnv.VITE_APP_API_BASE_URL,
|
10 |
+
changeOrigin: true,
|
11 |
+
rewrite: path => path.replace('/api/', '/'),
|
12 |
+
},
|
13 |
+
}
|
14 |
+
|
15 |
+
return proxy
|
16 |
+
}
|
docker-compose/docker-compose.yml
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: '3'
|
2 |
+
|
3 |
+
services:
|
4 |
+
app:
|
5 |
+
container_name: chatgpt-web
|
6 |
+
image: chenzhaoyu94/chatgpt-web # 总是使用latest,更新时重新pull该tag镜像即可
|
7 |
+
ports:
|
8 |
+
- 7860:7860
|
9 |
+
environment:
|
10 |
+
# 二选一
|
11 |
+
OPENAI_API_KEY:
|
12 |
+
# 二选一
|
13 |
+
OPENAI_ACCESS_TOKEN:
|
14 |
+
# API接口地址,可选,设置 OPENAI_API_KEY 时可用
|
15 |
+
OPENAI_API_BASE_URL:
|
16 |
+
# API模型,可选,设置 OPENAI_API_KEY 时可用
|
17 |
+
OPENAI_API_MODEL:
|
18 |
+
# 反向代理,可选
|
19 |
+
API_REVERSE_PROXY:
|
20 |
+
# 访问权限密钥,可选
|
21 |
+
AUTH_SECRET_KEY:
|
22 |
+
# 每小时最大请求次数,可选,默认无限
|
23 |
+
MAX_REQUEST_PER_HOUR: 0
|
24 |
+
# 超时,单位毫秒,可选
|
25 |
+
TIMEOUT_MS: 60000
|
26 |
+
# Socks代理,可选,和 SOCKS_PROXY_PORT 一起时生效
|
27 |
+
SOCKS_PROXY_HOST:
|
28 |
+
# Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效
|
29 |
+
SOCKS_PROXY_PORT:
|
30 |
+
# Socks代理用户名,可选,和 SOCKS_PROXY_HOST & SOCKS_PROXY_PORT 一起时生效
|
31 |
+
SOCKS_PROXY_USERNAME:
|
32 |
+
# Socks代理密码,可选,和 SOCKS_PROXY_HOST & SOCKS_PROXY_PORT 一起时生效
|
33 |
+
SOCKS_PROXY_PASSWORD:
|
34 |
+
# HTTPS_PROXY 代理,可选
|
35 |
+
HTTPS_PROXY:
|
36 |
+
nginx:
|
37 |
+
container_name: nginx
|
38 |
+
image: nginx:alpine
|
39 |
+
ports:
|
40 |
+
- '80:80'
|
41 |
+
expose:
|
42 |
+
- '80'
|
43 |
+
volumes:
|
44 |
+
- ./nginx/html:/usr/share/nginx/html
|
45 |
+
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
|
46 |
+
links:
|
47 |
+
- app
|
docker-compose/nginx/nginx.conf
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
server {
|
2 |
+
listen 80;
|
3 |
+
server_name localhost;
|
4 |
+
charset utf-8;
|
5 |
+
error_page 500 502 503 504 /50x.html;
|
6 |
+
location / {
|
7 |
+
root /usr/share/nginx/html;
|
8 |
+
try_files $uri /index.html;
|
9 |
+
}
|
10 |
+
|
11 |
+
location /api {
|
12 |
+
proxy_set_header X-Real-IP $remote_addr; #转发用户IP
|
13 |
+
proxy_pass http://app:7860;
|
14 |
+
}
|
15 |
+
|
16 |
+
proxy_set_header Host $host;
|
17 |
+
proxy_set_header X-Real-IP $remote_addr;
|
18 |
+
proxy_set_header REMOTE-HOST $remote_addr;
|
19 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
20 |
+
}
|
docker-compose/readme.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### docker-compose 部署教程
|
2 |
+
- 将打包好的前端文件放到 `nginx/html` 目录下
|
3 |
+
- ```shell
|
4 |
+
# 启动
|
5 |
+
docker-compose up -d
|
6 |
+
```
|
7 |
+
- ```shell
|
8 |
+
# 查看运行状态
|
9 |
+
docker ps
|
10 |
+
```
|
11 |
+
- ```shell
|
12 |
+
# 结束运行
|
13 |
+
docker-compose down
|
14 |
+
```
|
docs/alipay.png
ADDED
docs/c1-2.8.0.png
ADDED
docs/c1-2.9.0.png
ADDED
docs/c1.png
ADDED
docs/c2-2.8.0.png
ADDED
docs/c2-2.9.0.png
ADDED
docs/c2.png
ADDED
docs/docker.png
ADDED
docs/wechat.png
ADDED
index.html
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="zh-cmn-Hans">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
|
6 |
+
<meta content="yes" name="apple-mobile-web-app-capable"/>
|
7 |
+
<link rel="apple-touch-icon" href="/favicon.ico">
|
8 |
+
<meta name="viewport"
|
9 |
+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
|
10 |
+
<title>ChatGPT Web</title>
|
11 |
+
</head>
|
12 |
+
|
13 |
+
<body class="dark:bg-black">
|
14 |
+
<div id="app">
|
15 |
+
<style>
|
16 |
+
.loading-wrap {
|
17 |
+
display: flex;
|
18 |
+
justify-content: center;
|
19 |
+
align-items: center;
|
20 |
+
height: 100vh;
|
21 |
+
}
|
22 |
+
|
23 |
+
.balls {
|
24 |
+
width: 4em;
|
25 |
+
display: flex;
|
26 |
+
flex-flow: row nowrap;
|
27 |
+
align-items: center;
|
28 |
+
justify-content: space-between;
|
29 |
+
}
|
30 |
+
|
31 |
+
.balls div {
|
32 |
+
width: 0.8em;
|
33 |
+
height: 0.8em;
|
34 |
+
border-radius: 50%;
|
35 |
+
background-color: #4b9e5f;
|
36 |
+
}
|
37 |
+
|
38 |
+
.balls div:nth-of-type(1) {
|
39 |
+
transform: translateX(-100%);
|
40 |
+
animation: left-swing 0.5s ease-in alternate infinite;
|
41 |
+
}
|
42 |
+
|
43 |
+
.balls div:nth-of-type(3) {
|
44 |
+
transform: translateX(-95%);
|
45 |
+
animation: right-swing 0.5s ease-out alternate infinite;
|
46 |
+
}
|
47 |
+
|
48 |
+
@keyframes left-swing {
|
49 |
+
|
50 |
+
50%,
|
51 |
+
100% {
|
52 |
+
transform: translateX(95%);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
@keyframes right-swing {
|
57 |
+
50% {
|
58 |
+
transform: translateX(-95%);
|
59 |
+
}
|
60 |
+
|
61 |
+
100% {
|
62 |
+
transform: translateX(100%);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
@media (prefers-color-scheme: dark) {
|
67 |
+
body {
|
68 |
+
background: #121212;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
</style>
|
72 |
+
<div class="loading-wrap">
|
73 |
+
<div class="balls">
|
74 |
+
<div></div>
|
75 |
+
<div></div>
|
76 |
+
<div></div>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
<script type="module" src="/src/main.ts"></script>
|
81 |
+
</body>
|
82 |
+
|
83 |
+
</html>
|
kubernetes/README.md
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## 增加一个Kubernetes的部署方式
|
2 |
+
```
|
3 |
+
kubectl apply -f deploy.yaml
|
4 |
+
```
|
5 |
+
|
6 |
+
### 如果需要Ingress域名接入
|
7 |
+
```
|
8 |
+
kubectl apply -f ingress.yaml
|
9 |
+
```
|
kubernetes/deploy.yaml
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
apiVersion: apps/v1
|
2 |
+
kind: Deployment
|
3 |
+
metadata:
|
4 |
+
name: chatgpt-web
|
5 |
+
labels:
|
6 |
+
app: chatgpt-web
|
7 |
+
spec:
|
8 |
+
replicas: 1
|
9 |
+
selector:
|
10 |
+
matchLabels:
|
11 |
+
app: chatgpt-web
|
12 |
+
strategy:
|
13 |
+
type: RollingUpdate
|
14 |
+
template:
|
15 |
+
metadata:
|
16 |
+
labels:
|
17 |
+
app: chatgpt-web
|
18 |
+
spec:
|
19 |
+
containers:
|
20 |
+
- image: chenzhaoyu94/chatgpt-web
|
21 |
+
name: chatgpt-web
|
22 |
+
imagePullPolicy: Always
|
23 |
+
ports:
|
24 |
+
- containerPort: 7860
|
25 |
+
env:
|
26 |
+
- name: OPENAI_API_KEY
|
27 |
+
value: sk-xxx
|
28 |
+
- name: OPENAI_API_BASE_URL
|
29 |
+
value: 'https://api.openai.com'
|
30 |
+
- name: OPENAI_API_MODEL
|
31 |
+
value: gpt-3.5-turbo
|
32 |
+
- name: API_REVERSE_PROXY
|
33 |
+
value: https://bypass.churchless.tech/api/conversation
|
34 |
+
- name: AUTH_SECRET_KEY
|
35 |
+
value: '123456'
|
36 |
+
- name: TIMEOUT_MS
|
37 |
+
value: '60000'
|
38 |
+
- name: SOCKS_PROXY_HOST
|
39 |
+
value: ''
|
40 |
+
- name: SOCKS_PROXY_PORT
|
41 |
+
value: ''
|
42 |
+
- name: HTTPS_PROXY
|
43 |
+
value: ''
|
44 |
+
resources:
|
45 |
+
limits:
|
46 |
+
cpu: 500m
|
47 |
+
memory: 500Mi
|
48 |
+
requests:
|
49 |
+
cpu: 300m
|
50 |
+
memory: 300Mi
|
51 |
+
---
|
52 |
+
apiVersion: v1
|
53 |
+
kind: Service
|
54 |
+
metadata:
|
55 |
+
labels:
|
56 |
+
app: chatgpt-web
|
57 |
+
name: chatgpt-web
|
58 |
+
spec:
|
59 |
+
ports:
|
60 |
+
- name: chatgpt-web
|
61 |
+
port: 7860
|
62 |
+
protocol: TCP
|
63 |
+
targetPort: 7860
|
64 |
+
selector:
|
65 |
+
app: chatgpt-web
|
66 |
+
type: ClusterIP
|
kubernetes/ingress.yaml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
apiVersion: networking.k8s.io/v1
|
2 |
+
kind: Ingress
|
3 |
+
metadata:
|
4 |
+
annotations:
|
5 |
+
kubernetes.io/ingress.class: nginx
|
6 |
+
nginx.ingress.kubernetes.io/proxy-connect-timeout: '5'
|
7 |
+
name: chatgpt-web
|
8 |
+
spec:
|
9 |
+
rules:
|
10 |
+
- host: chatgpt.example.com
|
11 |
+
http:
|
12 |
+
paths:
|
13 |
+
- backend:
|
14 |
+
service:
|
15 |
+
name: chatgpt-web
|
16 |
+
port:
|
17 |
+
number: 7860
|
18 |
+
path: /
|
19 |
+
pathType: ImplementationSpecific
|
20 |
+
tls:
|
21 |
+
- secretName: chatgpt-web-tls
|
license
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2023 ChenZhaoYu
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
package.json
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "chatgpt-web",
|
3 |
+
"version": "2.10.9",
|
4 |
+
"private": false,
|
5 |
+
"description": "ChatGPT Web",
|
6 |
+
"author": "ChenZhaoYu <chenzhaoyu1994@gmail.com>",
|
7 |
+
"keywords": [
|
8 |
+
"chatgpt-web",
|
9 |
+
"chatgpt",
|
10 |
+
"chatbot",
|
11 |
+
"vue"
|
12 |
+
],
|
13 |
+
"scripts": {
|
14 |
+
"dev": "vite",
|
15 |
+
"build": "run-p type-check build-only",
|
16 |
+
"preview": "vite preview",
|
17 |
+
"build-only": "vite build",
|
18 |
+
"type-check": "vue-tsc --noEmit",
|
19 |
+
"lint": "eslint .",
|
20 |
+
"lint:fix": "eslint . --fix",
|
21 |
+
"bootstrap": "pnpm install && pnpm run common:prepare",
|
22 |
+
"common:cleanup": "rimraf node_modules && rimraf pnpm-lock.yaml",
|
23 |
+
"common:prepare": "husky install"
|
24 |
+
},
|
25 |
+
"dependencies": {
|
26 |
+
"@traptitech/markdown-it-katex": "^3.6.0",
|
27 |
+
"@vueuse/core": "^9.13.0",
|
28 |
+
"highlight.js": "^11.7.0",
|
29 |
+
"html2canvas": "^1.4.1",
|
30 |
+
"katex": "^0.16.4",
|
31 |
+
"markdown-it": "^13.0.1",
|
32 |
+
"naive-ui": "^2.34.3",
|
33 |
+
"pinia": "^2.0.33",
|
34 |
+
"vue": "^3.2.47",
|
35 |
+
"vue-i18n": "^9.2.2",
|
36 |
+
"vue-router": "^4.1.6"
|
37 |
+
},
|
38 |
+
"devDependencies": {
|
39 |
+
"@antfu/eslint-config": "^0.35.3",
|
40 |
+
"@commitlint/cli": "^17.4.4",
|
41 |
+
"@commitlint/config-conventional": "^17.4.4",
|
42 |
+
"@iconify/vue": "^4.1.0",
|
43 |
+
"@types/crypto-js": "^4.1.1",
|
44 |
+
"@types/katex": "^0.16.0",
|
45 |
+
"@types/markdown-it": "^12.2.3",
|
46 |
+
"@types/markdown-it-link-attributes": "^3.0.1",
|
47 |
+
"@types/node": "^18.14.6",
|
48 |
+
"@vitejs/plugin-vue": "^4.0.0",
|
49 |
+
"autoprefixer": "^10.4.13",
|
50 |
+
"axios": "^1.3.4",
|
51 |
+
"crypto-js": "^4.1.1",
|
52 |
+
"eslint": "^8.35.0",
|
53 |
+
"husky": "^8.0.3",
|
54 |
+
"less": "^4.1.3",
|
55 |
+
"lint-staged": "^13.1.2",
|
56 |
+
"markdown-it-link-attributes": "^4.0.1",
|
57 |
+
"npm-run-all": "^4.1.5",
|
58 |
+
"postcss": "^8.4.21",
|
59 |
+
"rimraf": "^4.2.0",
|
60 |
+
"tailwindcss": "^3.2.7",
|
61 |
+
"typescript": "~4.9.5",
|
62 |
+
"vite": "^4.2.0",
|
63 |
+
"vite-plugin-pwa": "^0.14.4",
|
64 |
+
"vue-tsc": "^1.2.0"
|
65 |
+
},
|
66 |
+
"lint-staged": {
|
67 |
+
"*.{ts,tsx,vue}": [
|
68 |
+
"pnpm lint:fix"
|
69 |
+
]
|
70 |
+
}
|
71 |
+
}
|
pnpm-lock.yaml
ADDED
The diff for this file is too large to render.
See raw diff
|
|
postcss.config.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
module.exports = {
|
2 |
+
plugins: {
|
3 |
+
tailwindcss: {},
|
4 |
+
autoprefixer: {},
|
5 |
+
},
|
6 |
+
}
|
public/favicon.ico
ADDED
public/favicon.svg
ADDED
public/pwa-192x192.png
ADDED
public/pwa-512x512.png
ADDED
service/.env.example
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# OpenAI API Key - https://platform.openai.com/overview
|
2 |
+
OPENAI_API_KEY=
|
3 |
+
|
4 |
+
# change this to an `accessToken` extracted from the ChatGPT site's `https://chat.openai.com/api/auth/session` response
|
5 |
+
OPENAI_ACCESS_TOKEN=
|
6 |
+
|
7 |
+
# OpenAI API Base URL - https://api.openai.com
|
8 |
+
OPENAI_API_BASE_URL=
|
9 |
+
|
10 |
+
# OpenAI API Model - https://platform.openai.com/docs/models
|
11 |
+
OPENAI_API_MODEL=
|
12 |
+
|
13 |
+
# set `true` to disable OpenAI API debug log
|
14 |
+
OPENAI_API_DISABLE_DEBUG=
|
15 |
+
|
16 |
+
# Reverse Proxy - Available on accessToken
|
17 |
+
# Default: https://bypass.churchless.tech/api/conversation
|
18 |
+
# More: https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy
|
19 |
+
API_REVERSE_PROXY=
|
20 |
+
|
21 |
+
# timeout
|
22 |
+
TIMEOUT_MS=100000
|
23 |
+
|
24 |
+
# Rate Limit
|
25 |
+
MAX_REQUEST_PER_HOUR=
|
26 |
+
|
27 |
+
# Secret key
|
28 |
+
AUTH_SECRET_KEY=
|
29 |
+
|
30 |
+
# Socks Proxy Host
|
31 |
+
SOCKS_PROXY_HOST=
|
32 |
+
|
33 |
+
# Socks Proxy Port
|
34 |
+
SOCKS_PROXY_PORT=
|
35 |
+
|
36 |
+
# Socks Proxy Username
|
37 |
+
SOCKS_PROXY_USERNAME=
|
38 |
+
|
39 |
+
# Socks Proxy Password
|
40 |
+
SOCKS_PROXY_PASSWORD=
|
41 |
+
|
42 |
+
# HTTPS PROXY
|
43 |
+
HTTPS_PROXY=
|
44 |
+
|
service/.eslintrc.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"root": true,
|
3 |
+
"ignorePatterns": ["build"],
|
4 |
+
"extends": ["@antfu"]
|
5 |
+
}
|
service/.gitignore
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Logs
|
2 |
+
logs
|
3 |
+
*.log
|
4 |
+
npm-debug.log*
|
5 |
+
yarn-debug.log*
|
6 |
+
yarn-error.log*
|
7 |
+
pnpm-debug.log*
|
8 |
+
lerna-debug.log*
|
9 |
+
|
10 |
+
node_modules
|
11 |
+
.DS_Store
|
12 |
+
dist
|
13 |
+
dist-ssr
|
14 |
+
coverage
|
15 |
+
*.local
|
16 |
+
|
17 |
+
/cypress/videos/
|
18 |
+
/cypress/screenshots/
|
19 |
+
|
20 |
+
# Editor directories and files
|
21 |
+
.vscode/*
|
22 |
+
!.vscode/settings.json
|
23 |
+
!.vscode/extensions.json
|
24 |
+
.idea
|
25 |
+
*.suo
|
26 |
+
*.ntvs*
|
27 |
+
*.njsproj
|
28 |
+
*.sln
|
29 |
+
*.sw?
|
30 |
+
|
31 |
+
build
|