feat:更新rustdesk、chatgpt-web

This commit is contained in:
okxlin 2023-07-29 10:32:10 +08:00
parent 4e630047a2
commit e31bd4a9cd
6 changed files with 116 additions and 26 deletions

View File

@ -1,20 +1,12 @@
# 使用介绍
可以国际互联的可以访问官方链接获取`ACCESS_TOKEN`
[官方链接获取 AccessToken](https://chat.openai.com/api/auth/session)
# 原始相关
# ChatGPT Web
> 声明:此项目只发布于 GitHub基于 MIT 协议,免费且作为开源学习使用。并且不会有任何形式的卖号、付费服务、讨论群、讨论组等行为。谨防受骗。
![cover](https://raw.githubusercontent.com/Chanzhaoyu/chatgpt-web/main/docs/c1.png)
![cover2](https://raw.githubusercontent.com/Chanzhaoyu/chatgpt-web/main/docs/c2.png)
更多功能:[chatgpt-web-plus](https://github.com/Chanzhaoyu/chatgpt-web-plus)
![cover](https://github.com/Chanzhaoyu/chatgpt-web/raw/main/docs/c1.png)
![cover2](https://github.com/Chanzhaoyu/chatgpt-web/raw/main/docs/c2.png)
- [使用介绍](#使用介绍)
- [原始相关](#原始相关)
- [ChatGPT Web](#chatgpt-web)
- [介绍](#介绍)
- [待实现路线](#待实现路线)
@ -34,6 +26,7 @@
- [Docker 参数示例](#docker-参数示例)
- [Docker build \& Run](#docker-build--run)
- [Docker compose](#docker-compose)
- [防止爬虫抓取](#防止爬虫抓取)
- [使用 Railway 部署](#使用-railway-部署)
- [Railway 环境变量](#railway-环境变量)
- [手动打包](#手动打包)
@ -60,7 +53,7 @@
1. 你应该首先使用 `API` 方式
2. 使用 `API` 时,如果网络不通,那是国内被墙了,你需要自建代理,绝对不要使用别人的公开代理,那是危险的。
3. 使用 `accessToken` 方式时反向代理将向第三方暴露您的访问令牌,这样做应该不会产生任何不良影响,但在使用这种方法之前请考虑风险。
4. 使用 `accessToken` 时,不管你是国内还是国外的机器,都会使用代理。默认代理为 [acheong08](https://github.com/acheong08) 大佬的 `https://bypass.churchless.tech/api/conversation`,这不是后门也不是监听,除非你有能力自己翻过 `CF` 验证,用前请知悉。[社区代理](https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy)(注意:只有这两个是推荐,其他第三方来源,请自行甄别)
4. 使用 `accessToken` 时,不管你是国内还是国外的机器,都会使用代理。默认代理为 [pengzhile](https://github.com/pengzhile) 大佬的 `https://ai.fakeopen.com/api/conversation`,这不是后门也不是监听,除非你有能力自己翻过 `CF` 验证,用前请知悉。[社区代理](https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy)(注意:只有这两个是推荐,其他第三方来源,请自行甄别)
5. 把项目发布到公共网络时,你应该设置 `AUTH_SECRET_KEY` 变量添加你的密码访问权限,你也应该修改 `index.html` 中的 `title`,防止被关键词搜索到。
切换方式:
@ -170,7 +163,7 @@ pnpm dev
`ACCESS_TOKEN` 可用:
- `OPENAI_ACCESS_TOKEN``OPENAI_API_KEY` 二选一,同时存在时,`OPENAI_API_KEY` 优先
- `API_REVERSE_PROXY` 设置反向代理,可选,默认:`https://bypass.churchless.tech/api/conversation`[社区](https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy)(注意:只有这两个是推荐,其他第三方来源,请自行甄别)
- `API_REVERSE_PROXY` 设置反向代理,可选,默认:`https://ai.fakeopen.com/api/conversation`[社区](https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy)(注意:只有这两个是推荐,其他第三方来源,请自行甄别)
通用:
@ -188,7 +181,7 @@ pnpm dev
#### Docker 参数示例
![docker](./docs/docker.png)
![docker](https://github.com/Chanzhaoyu/chatgpt-web/raw/main/docs/docker.png)
#### Docker build & Run
@ -225,7 +218,7 @@ services:
# API接口地址可选设置 OPENAI_API_KEY 时可用
OPENAI_API_BASE_URL: xxx
# API模型可选设置 OPENAI_API_KEY 时可用https://platform.openai.com/docs/models
# 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
# gpt-4, gpt-4-0314, gpt-4-0613, gpt-4-32k, gpt-4-32k-0314, gpt-4-32k-0613, gpt-3.5-turbo-16k, gpt-3.5-turbo-16k-0613, gpt-3.5-turbo, gpt-3.5-turbo-0301, gpt-3.5-turbo-0613, text-davinci-003, text-davinci-002, code-davinci-002
OPENAI_API_MODEL: xxx
# 反向代理,可选
API_REVERSE_PROXY: xxx
@ -244,6 +237,21 @@ services:
```
- `OPENAI_API_BASE_URL` 可选,设置 `OPENAI_API_KEY` 时可用
- `OPENAI_API_MODEL` 可选,设置 `OPENAI_API_KEY` 时可用
#### 防止爬虫抓取
**nginx**
将下面配置填入nginx配置文件中可以参考 `docker-compose/nginx/nginx.conf` 文件中添加反爬虫的方法
```
# 防止爬虫抓取
if ($http_user_agent ~* "360Spider|JikeSpider|Spider|spider|bot|Bot|2345Explorer|curl|wget|webZIP|qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot|NSPlayer|bingbot")
{
return 403;
}
```
### 使用 Railway 部署
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/yytmgc)
@ -304,7 +312,7 @@ pnpm build
## 常见问题
Q: 为什么 `Git` 提交总是报错?
A: 因为有提交信息验证,请遵循 [Commit 指南](./CONTRIBUTING.md)
A: 因为有提交信息验证,请遵循 [Commit 指南](https://github.com/Chanzhaoyu/chatgpt-web/blob/main/CONTRIBUTING.md)
Q: 如果只使用前端页面,在哪里改请求接口?
@ -320,7 +328,7 @@ A: 一种可能原因是经过 Nginx 反向代理,开启了 buffer则 Nginx
## 参与贡献
贡献之前请先阅读 [贡献指南](./CONTRIBUTING.md)
贡献之前请先阅读 [贡献指南](https://github.com/Chanzhaoyu/chatgpt-web/blob/main/CONTRIBUTING.md)
感谢所有做过贡献的人!
@ -334,15 +342,14 @@ A: 一种可能原因是经过 Nginx 反向代理,开启了 buffer则 Nginx
<div style="display: flex; gap: 20px;">
<div style="text-align: center">
<img style="max-width: 100%" src="./docs/wechat.png" alt="微信" />
<img style="max-width: 100%" src="https://github.com/Chanzhaoyu/chatgpt-web/raw/main/docs/wechat.png" alt="微信" />
<p>WeChat Pay</p>
</div>
<div style="text-align: center">
<img style="max-width: 100%" src="./docs/alipay.png" alt="支付宝" />
<img style="max-width: 100%" src="https://github.com/Chanzhaoyu/chatgpt-web/raw/main/docs/alipay.png" alt="支付宝" />
<p>Alipay</p>
</div>
</div>
## License
MIT © [ChenZhaoYu](./license)
MIT © [ChenZhaoYu](https://github.com/Chanzhaoyu/chatgpt-web/blob/main/license)

View File

@ -1,4 +1,4 @@
name: chatgpt-web
name: ChatGPT Web
tags:
- 工具
title: 使用express和vue3搭建的支持ChatGPT双模型演示网页
@ -6,7 +6,7 @@ type: 工具
description: 使用express和vue3搭建的支持ChatGPT双模型演示网页
additionalProperties:
key: chatgpt-web
name: chatgpt-web
name: ChatGPT Web
tags:
- Tool
shortDescZh: 使用express和vue3搭建的支持ChatGPT双模型演示网页

View File

@ -11,8 +11,8 @@ additionalProperties:
- default: ''
edit: true
envKey: ACCESS_TOKEN
labelEn: OPENAI ACCESS TOKEN (fill in at least one with OPENAI API KEY)
labelZh: OPENAI ACCESS TOKEN(与OPENAI API KEY至少填一个)
labelEn: OPENAI ACCESS TOKEN (fill in at least one with OPENAI API KEY)(https://chat.openai.com/api/auth/session)
labelZh: OPENAI ACCESS TOKEN(与OPENAI API KEY至少填一个)(https://chat.openai.com/api/auth/session)
required: false
type: text
- default: https://bypass.duti.tech/api/conversation

View File

@ -0,0 +1,7 @@
CONTAINER_NAME=rustdesk
NAT_TEST_PORT=21115
HBBS_PORT=21116
HBBR_PORT=21117
WEB_CLIENT_PORT1=21118
WEB_CLIENT_PORT2=21119
HOST_ADDRESS=172.17.0.1

View File

@ -0,0 +1,50 @@
additionalProperties:
formFields:
- default: 21115
edit: true
envKey: NAT_TEST_PORT
labelEn: NAT type test port
labelZh: NAT类型测试端口
required: true
rule: paramPort
type: number
- default: 21116
edit: true
envKey: HBBS_PORT
labelEn: hbbs port (used with IP/domain)
labelZh: hbbs端口(配合IP/域名使用)
required: true
rule: paramPort
type: number
- default: 21117
edit: true
envKey: HBBR_PORT
labelEn: hbbr port (client relay server port)
labelZh: hbbr端口(客户端中继服务器端口)
required: true
rule: paramPort
type: number
- default: 21118
edit: true
envKey: WEB_CLIENT_PORT1
labelEn: Web Client Support Port 1
labelZh: 网页客户端支持端口1
required: true
rule: paramPort
type: number
- default: 21119
edit: true
envKey: WEB_CLIENT_PORT2
labelEn: Web Client Support Port 2
labelZh: 网页客户端支持端口2
required: true
rule: paramPort
type: number
- default: 172.17.0.1
edit: true
envKey: HOST_ADDRESS
labelEn: IP address or domain name (must change item)
labelZh: IP地址或域名(必改项)
required: true
rule: paramCommon
type: text

View File

@ -0,0 +1,26 @@
version: '3'
services:
rustdesk-server:
container_name: ${CONTAINER_NAME}
restart: always
networks:
- 1panel-network
ports:
- "${NAT_TEST_PORT}:21115" #NAT类型测试
- "${HBBS_PORT}:21116" # 自定义 hbbs 映射端口
- "${HBBS_PORT}:21116/udp" #自定义 hbbs 映射端口
- "${HBBR_PORT}:21117" # 自定义 hbbr 映射端口
- "${WEB_CLIENT_PORT1}:21118" #网页客户端支持端口
- "${WEB_CLIENT_PORT2}:21119" #网页客户端支持端口
volumes:
- "./data/hbbs:/data" # 自定义挂载目录
environment:
- "RELAY=${HOST_ADDRESS}:${HBBR_PORT}"
- "ENCRYPTED_ONLY=1"
image: rustdesk/rustdesk-server-s6:latest
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true