Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
weaigc committed Jul 23, 2023
1 parent d887109 commit 81a3444
Show file tree
Hide file tree
Showing 38 changed files with 586 additions and 593 deletions.
35 changes: 35 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM node:18

ARG DEBIAN_FRONTEND=noninteractive

ENV BING_UA Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.0.0
ENV BING_COOKIE ""

# Set up a new user named "user" with user ID 1000
RUN useradd -o -u 1000 user

Expand All @@ -28,6 +31,7 @@ COPY --chown=user . $HOME/app

RUN npm run build

ENV PORT 7860
EXPOSE 7860

CMD [ "npm", "run", "start" ]
CMD npm start -- --port $PORT
44 changes: 35 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
---
title: bingo
emoji: 📉
colorFrom: red
colorTo: red
sdk: docker
pinned: true
license: mit
---

<div align="center">

# Bingo
Expand All @@ -8,8 +18,14 @@ Bingo,一个让你呼吸顺畅 New Bing。

[![MIT License](https://img.shields.io/badge/license-MIT-97c50f)](https://github.com/weaigc/bingo/blob/main/license)


</div>

## 演示站点

https://bing.github1s.tk

[![img](./docs/images/demo.png)](https://bing.github1s.tk)

## 功能和特点

Expand All @@ -19,27 +35,27 @@ Bingo,一个让你呼吸顺畅 New Bing。
## RoadMap

- [x] 支持 wss 转发
- [x] 支持一键部署
- [ ] 优化移动端展示
- [ ] 适配深色模式
- [ ] 支持画图
- [ ] 支持一键部署
- [ ] 支持内置提示词
- [ ] 支持语音输入
- [ ] 增加桌面客户端
- [ ] 支持离线访问

## 一键部署
你也可以一键部署自己的 New Bing AI 到 Vercel 上

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?demo-title=New+Bing+AI&project-name=bingo&repository-name=bingo&repository-url=https%3A%2F%2Fgithub.com%2Fweaigc%2Fbingo&from=templates&skippable-integrations=1&env=BING_COOKIE%2CBING_UA&teamCreateStatus=hidden)
你也可以一键部署自己的 New Bing AI 到 🤗 HuggingFace 上

[![Deploy to HuggingFace](https://img.shields.io/badge/%E7%82%B9%E5%87%BB%E9%83%A8%E7%BD%B2-%F0%9F%A4%97-fff)](https://huggingface.co/login?next=%2Fspaces%2Fhf4all%2Fbingo%3Fduplicate%3Dtrue%26visibility%3Dpublic)

## 环境和依赖

- Node.js >= 18
- Bing AI 的 Cookie (可在 https://chatgpt.com/ 注册获取)
- Bing AI 的 Cookie (前往 https://www.bing.com/ ,登录,然后[找到 bing.com 域名下的一个名叫 _U 的 Cookie 的值](#如何获取-cookie))

## 安装和使用

1. 克隆本项目到本地:
* 使用 Node 启动

```bash
git clone https://github.com/weaigc/bingo.git
Expand All @@ -48,12 +64,22 @@ npm run build
npm run start
```

* 使用 Docker 启动
```bash
git clone https://github.com/weaigc/bingo.git
docker build . -t bingo
docker run --rm -it -e BING_COOKIE=xxxx -p 7860:7860 bingo # BING_COOKIE 为 bing.com 域名下的一个名叫 _U 的 Cookie 的值
```

## 如何获取 Cookie
![Coookie](./docs/images/bing-cookie.png)

## 鸣谢
- 感谢 [EdgeGPT](https://github.com/acheong08/EdgeGPT) 提供的代理 API 的方法。
- 感谢 [Vercel AI](https://github.com/vercel-labs/ai-chatbot) 提供的基础脚手架
- 感谢 [Vercel AI](https://github.com/vercel-labs/ai-chatbot) 提供的基础脚手架和 [ChatHub](https://github.com/chathub-dev/chathub) [go-proxy-bingai](https://github.com/adams549659584/go-proxy-bingai) 提供的部分代码

## License

Apache 2.0 © [LICENSE](https://github.com/weaigc/bingo/blob/main/LICENSE).
MIT © [LICENSE](https://github.com/weaigc/bingo/blob/main/LICENSE).


Binary file added docs/images/bing-cookie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 30 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@
const nextConfig = {
// output: 'export',
// assetPrefix: '.',
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve = {
...config.resolve,
fallback: {
http: false,
https: false,
stream: false,
// fixes proxy-agent dependencies
net: false,
dns: false,
tls: false,
assert: false,
// fixes next-i18next dependencies
path: false,
fs: false,
// fixes mapbox dependencies
events: false,
// fixes sentry dependencies
process: false
}
};
}
config.module.exprContextCritical = false;

return config;
},
}

module.exports = nextConfig
module.exports = (...args) => {
return nextConfig
}
Loading

0 comments on commit 81a3444

Please sign in to comment.