lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
40.91k stars 9.32k forks source link

Server DB Docker Image Feedback | 服务端 Database Docker 镜像问题反馈 #3391

Closed arvinxx closed 4 weeks ago

arvinxx commented 1 month ago

首先非常感谢 @cy948 的努力,完成了 Next Auth 和 LobeChat 现有 Database 系统的集成,使得我们可以构建起 LobeChat 的服务端数据库的 Docker 镜像。

服务端数据库的 docker 镜像已正式可用,镜像名为 lobehub/lobe-chat-database

关于服务端数据库的部署文档,详见: https://lobehub.com/docs/self-hosting/server-database

在此也列出一个简版的部署指南,供大家参考。如有其他问题,欢迎在下方留言。


  1. 创建 pg 实例,需要包含 pgvector 插件(注意:以下命令仅用于演示,因为这个 pg 实例并没有包含持久化部分,请自行构建一个符合你诉求的 生产级 pg 实例)
docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16
  1. 创建一个 lobe-chat.env 文件用于存放环境变量:
#网站域名
APP_URL=http://localhost:3210

# DB 必须
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres

# NEXT_AUTH 相关,可以使用 auth0 等,如有其他接入诉求欢迎提 PR
NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250
NEXT_AUTH_SSO_PROVIDERS=auth0
NEXTAUTH_URL=https://your-prod-domain.com/api/auth
AUTH0_CLIENT_ID=xxxxxx
AUTH0_CLIENT_SECRET=cSX_xxxxx
AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com

# S3 相关
S3_ACCESS_KEY_ID=xxxxxxxxxx
S3_SECRET_ACCESS_KEY=xxxxxxxxxx
S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com
S3_BUCKET=lobechat
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
  1. 启动 lobe-chat-database docker 镜像
docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database

注意事项:确保数据库和 LobeChat DB 镜像在同一网络中

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


First of all, I am very grateful to @cy948 for his efforts in completing the integration of Next Auth and LobeChat’s existing Database system, allowing us to build LobeChat’s server image.

The docker image of the server database is now officially available. The image name is lobehub/lobe-chat-database.

The deployment guide is here: https://lobehub.com/docs/self-hosting/server-database

  1. Create a pg instance (Note: The following commands are for demonstration only, because this pg instance does not include the persistence part)
docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16
  1. Create a lobe-chat.env file to store environment variables:
# DB required
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres

# NEXT_AUTH related
NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250
NEXT_AUTH_SSO_PROVIDERS=auth0
NEXTAUTH_URL=https://your-prod-domain.com/api/auth
AUTH0_CLIENT_ID=xxxxxx
AUTH0_CLIENT_SECRET=cSX_xxxxx
AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com

# S3 related
S3_ACCESS_KEY_ID=xxxxxxxxxx
S3_SECRET_ACCESS_KEY=xxxxxxxxxx
S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com
S3_BUCKET=lobechat
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
  1. Start the lobe-chat-database docker image
docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database
Matinal111 commented 1 month ago

目前看来 S3 存储还存在问题,图片上传后会报错:

Error: fileEnv.NEXT_PUBLIC_S3_DOMAIN is not set while enable server upload

这个错误信息表明在尝试进行服务器上传时,环境变量 NEXT_PUBLIC_S3_DOMAIN 没有被设置。实际上 S3 后台已经上传成功了

arvinxx commented 1 month ago

@Matinal111 这个是前端抛错还是后端抛错?

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Matinal111 Is this an error on the front end or on the back end?

Matinal111 commented 1 month ago

@Matinal111 这个是前端抛错还是后端抛错?

是前端右上角弹窗报错,忘记截图了

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Matinal111 Is this an error on the front end or on the back end?

It’s the pop-up window in the upper right corner of the front end that reports an error. I forgot to take a screenshot.

arvinxx commented 1 month ago

OK,这个我来修下

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


OK, I'll fix this

iparanoid commented 1 month ago

请问S3支持docker部署的Minio吗?

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Does S3 support Minio deployed with docker?

sqkkyzx commented 1 month ago

使用 Authing 身份认证提供者的配置方法

Authing 可以兼容 Auth0,但是是国内的服务,所以可以用微博、微信、QQ登录。

  1. 注册 Authing ,新建一个 ToE 或者 ToC 用户池。
  2. 身份源管理页面增加社会化身份源
  3. 应用-自建应用中,新建一个应用,此时可以看到如下图所示内容,你需要设置和保存认证配置,并根据生成的端点信息来配置 lobehub 的环境变量。
1722774948509
  1. 配置要点:
    • NEXT_AUTH_SSO_PROVIDERS 应设置为 auth0
    • NEXTAUTH_URLAuthing认证配置中的登录回调URL并不是相同的。 NEXTAUTH_URL 应配置为 https://{your-prod-domin}/api/auth ,而登录回调URL应配置为 https://{your-prod-domin}/api/auth/callback/auth0
    • AUTH0_ISSUER 应设置为端点信息中的Issuer,不要删除结尾的/oidc
arvinxx commented 1 month ago

请问S3支持docker部署的Minio吗?

@iparanoid 只要 mino 是兼容了 S3 协议就支持。

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Does S3 support Minio deployed with docker?

@iparanoid As long as mino is compatible with the S3 protocol, it is supported.

darkelfzdy commented 1 month ago

使用 Authing 身份认证提供者的配置方法

Authing 可以兼容 Auth0,但是是国内的服务,所以可以用微博、微信、QQ登录。

  1. 注册 Authing ,新建一个 ToE 或者 ToC 用户池。
  2. 身份源管理页面增加社会化身份源
  3. 应用-自建应用中,新建一个应用,此时可以看到如下图所示内容,你需要设置和保存认证配置,并根据生成的端点信息来配置 lobehub 的环境变量。
1722774948509
  1. 配置要点:
  • NEXT_AUTH_SSO_PROVIDERS 应设置为 auth0
  • NEXTAUTH_URLAuthing认证配置中的登录回调URL并不是相同的。 NEXTAUTH_URL 应配置为 https://{your-prod-domin}/api/auth ,而登录回调URL应配置为 https://{your-prod-domin}/api/auth/callback/auth0
  • AUTH0_ISSUER 应设置为端点信息中的Issuer,不要删除结尾的/oidc

Authing是不是要收费?

arvinxx commented 1 month ago

@sqkkyzx 欢迎将其提交为文档,帮助更多 LobeChat 用户

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@sqkkyzx Welcome to submit it as a document to help more LobeChat users

zhangleijun111 commented 1 month ago

首先非常感谢 @cy948 的努力,完成了 Next Auth 和 LobeChat 现有 Database 系统的集成,使得我们可以构建起 LobeChat 的服务端数据库的 Docker 镜像。

服务端数据库的 docker 镜像已正式可用,镜像名为 lobehub/lobe-chat-database

关于服务端数据库的部署文档,详见: https://lobehub.com/docs/self-hosting/server-database

在此也列出一个简版的部署指南,供大家参考。如有其他问题,欢迎在下方留言。

  1. 创建 pg 实例(注意:以下命令仅用于演示,因为这个 pg 实例并没有包含持久化部分,请自行构建一个符合你诉求的 生产级 pg 实例)
docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
  1. 创建一个 lobe-chat.env 文件用于存放环境变量:
# DB 必须
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres

# NEXT_AUTH 相关
NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250
NEXT_AUTH_SSO_PROVIDERS=auth0
NEXTAUTH_URL=https://your-prod-domain.com/api/auth
AUTH0_CLIENT_ID=xxxxxx
AUTH0_CLIENT_SECRET=cSX_xxxxx
AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com

# S3 相关
S3_ACCESS_KEY_ID=xxxxxxxxxx
S3_SECRET_ACCESS_KEY=xxxxxxxxxx
S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com
S3_BUCKET=lobechat
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
  1. 启动 lobe-chat-database docker 镜像
docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database

注意事项:确保数据库和 LobeChat DB 镜像在同一网络中

兄弟你这样部署成功了嘛,我部署失败了,sql和lobechat都打不开

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


First of all, I am very grateful to @cy948 for his efforts in completing the integration of Next Auth and LobeChat’s existing Database system, allowing us to build a Docker image of LobeChat’s server database.

The docker image of the server database is officially available, and the image name is lobehub/lobe-chat-database.

For details on the deployment documentation of the server database, see: https://lobehub.com/docs/self-hosting/server-database

Here is also a simplified version of the deployment guide for your reference. If you have any other questions, please leave a message below.

  1. Create a pg instance (Note: The following commands are for demonstration only, because this pg instance does not include the persistence part, please build a production-grade pg instance that meets your needs)
docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
  1. Create a lobe-chat.env file to store environment variables:

``dotenv

DB required

KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres

NEXT_AUTH related

NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 NEXT_AUTH_SSO_PROVIDERS=auth0 NEXTAUTH_URL=https://your-prod-domain.com/api/auth AUTH0_CLIENT_ID=xxxxxx AUTH0_CLIENT_SECRET=cSX_xxxxx AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com

S3 related

S3_ACCESS_KEY_ID=xxxxxxxxxx S3_SECRET_ACCESS_KEY=xxxxxxxxxx S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com S3_BUCKET=lobechat NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com


3. Start lobe-chat-database docker image

```shell
docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database

Note: Make sure the database and LobeChat DB mirror are in the same network

Brother, did you deploy successfully like this? My deployment failed. Neither sql nor lobechat can be opened.

darkelfzdy commented 1 month ago

我看到文档已经更新使用服务端数据库部署,里面提到NEXT_PUBLIC_SERVICE_MODE和DATABASE_DRIVER这两个变量。 如果我采用vercel+本地Postgres的模式,上述两个变量是否是要如下设置: NEXT_PUBLIC_SERVICE_MODE=client DATABASE_DRIVER=node

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I saw that the document has been updated Using server-side database deployment, which mentions the two variables NEXT_PUBLIC_SERVICE_MODE and DATABASE_DRIVER. If I use vercel+local Postgres mode, the above two variables should be set as follows: NEXT_PUBLIC_SERVICE_MODE=client DATABASE_DRIVER=node

arvinxx commented 1 month ago

@darkelfzdy 需要,你得设置为:

NEXT_PUBLIC_SERVICE_MODE=server
DATABASE_DRIVER=node

但我不太建议使用 vercel + node PG 的模式,大概率会存在通信延迟的问题,导致响应比较慢。如果在同一处的话,可以做到百毫秒的响应,但如果分开来的话,估计得到秒级了

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@darkelfzdy Required, you have to set it to:

NEXT_PUBLIC_SERVICE_MODE=server
DATABASE_DRIVER=node
darkelfzdy commented 1 month ago

@darkelfzdy 需要,你得设置为:

NEXT_PUBLIC_SERVICE_MODE=server
DATABASE_DRIVER=node

但我不太建议使用 vercel + node PG 的模式,大概率会存在通信延迟的问题,导致响应比较慢。如果在同一处的话,可以做到百毫秒的响应,但如果分开来的话,估计得到秒级了

确实,我也有点担心,如果是Vercel + Serverless Postgres模式,vercel的Postgres一个月免费时长好像只有60小时,明显不够。最好的方式看来还是Docker 镜像 + Node Postgres,全部都在本地

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@darkelfzdy required, you have to set it to:

NEXT_PUBLIC_SERVICE_MODE=server
DATABASE_DRIVER=node

But I don’t recommend using the vercel + node PG mode. There is a high probability that there will be communication delay problems, resulting in slower response. If they are in the same place, they can achieve a response of hundreds of milliseconds, but if they are separated, it is estimated to be on the second level.

Indeed, I am also a little worried. If it is Vercel + Serverless Postgres model, Vercel's Postgres free time seems to be only 60 hours a month, which is obviously not enough. The best way seems to be Docker image + Node Postgres, all local

arvinxx commented 1 month ago

@darkelfzdy Serverless 的 PG 实例,建议使用 neon ,这个搭配比较好

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@darkelfzdy Serverless PG instance, it is recommended to use neon, this combination is better

darkelfzdy commented 1 month ago

@darkelfzdy Serverless 的 PG 实例,建议使用 neon ,这个搭配比较好

从来没了解过neon,免费部分够用不?我看好像免费存储0.5GB,其他时长这些比vercel好

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@darkelfzdy Serverless PG instance, it is recommended to use neon, this combination is better

I have never heard of neon, is the free part enough?

iparanoid commented 1 month ago

数据库版本的docker部署完以后, 记得要在设置界面中输入之前配置好的ACCESS_CODE,否则即使认证登录后S3传文件仍然会有报错, 折腾了好久以为没部署正确😂,不清楚大家有遇到过没,发上来记录一下

image
lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


After the database version of docker is deployed, Remember to enter the previously configured ACCESS_CODE in the setting interface, otherwise even after authenticating and logging in, there will still be an error when transferring files through S3. After struggling for a long time, I thought it was not deployed correctly. I’m not sure if anyone has encountered this before. I’ll post it and record it.

image
arvinxx commented 1 month ago

@iparanoid 可以去掉 ACCESS_CODE 了,另外这个算是一个 bug #2938 ,还没来记得修

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@iparanoid You can remove ACCESS_CODE. In addition, this is a bug #2938. Remember to fix it yet.

Sun-drenched commented 1 month ago

数据库版本的docker部署完以后, 记得要在设置界面中输入之前配置好的ACCESS_CODE,否则即使认证登录后S3传文件仍然会有报错, 折腾了好久以为没部署正确😂,不清楚大家有遇到过没,发上来记录一下 image

现阶段S3报错应该是正常的

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


After the database version of docker is deployed, remember to enter the previously configured ACCESS_CODE in the setting interface, otherwise there will still be an error when transferring files to S3 after authentication and login. After struggling for a long time, I thought it was not deployed correctly. I don’t know if anyone has encountered this. Have you passed, please post it for recordimage

It should be normal for S3 to report errors at this stage.

darkelfzdy commented 1 month ago

没有搞明白这个变量:NEXTAUTH_URL=https://your-prod-domain.com/api/auth 这个域名:your-prod-domain.com,是我部署lobechat的域名?可不可以是内网的IP?

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Didn't understand this variable: NEXTAUTH_URL=https://your-prod-domain.com/api/auth This domain name: your-prod-domain.com, is the domain name where I deploy lobechat? Could it be the IP of the intranet?

arvinxx commented 1 month ago

没有搞明白这个变量:NEXTAUTH_URL=https://your-prod-domain.com/api/auth

这个域名:your-prod-domain.com,是我部署lobechat的域名?可不可以是内网的IP?

对。 可以是内网ip

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Didn’t understand this variable: NEXTAUTH_URL=https://your-prod-domain.com/api/auth

This domain name: your-prod-domain.com, is the domain name where I deploy lobechat? Could it be the IP of the intranet?

right. It can be an intranet IP

darkelfzdy commented 1 month ago

成功部署,但无法点击登陆注册账户后出现错误。部署命令如下(用xxxx模糊了敏感信息): docker run -it -d --name lobe-chat-database --restart always -p 3210:3210 \ -e DATABASE_URL=postgresql://root:xxxxx@192.168.xx.xx:5432/mydb \ -e KEY_VAULTS_SECRET=xxxx \ -e NEXT_AUTH_SECRET=xxxxx \ -e NEXT_AUTH_SSO_PROVIDERS=auth0 \ -e AUTH0_CLIENT_ID=xxxxxxxxxxWPWAS0GpxxxxxxxxxxGxxx \ -e AUTH0_CLIENT_SECRET=xxxxxxxxxBUlFzVMxxxxxxxxxxxxxxxxxxxxxxxTkU5Dc6xxxxxxx- \ -e AUTH0_ISSUER=https://dev-oldbiuln0bipyiqh.us.auth0.com \ -e NEXTAUTH_URL=http://192.168.31.33:3210/api/auth/callback/auth0 \ -e S3_ACCESS_KEY_ID=xxxxxx \ -e S3_SECRET_ACCESS_KEY=xxxxx \ -e S3_ENDPOINT=https://xxxxx.r2.cloudflarestorage.com \ -e S3_BUCKET=lobechat \ -e NEXT_PUBLIC_S3_DOMAIN=https://lober2.xxxxx.top \ lobehub/lobe-chat-database:latest 点击登陆注册后,反馈(因为这会儿不方便,没法截图): 页面遇到一点问题,待会儿来试试,或回到已知的世界

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Deployed successfully, but an error occurred after being unable to click to log in and register an account. The deployment command is as follows (sensitive information is blurred with xxxx): docker run -it -d --name lobe-chat-database --restart always -p 3210:3210 \ -e DATABASE_URL=postgresql://root:xxxxx@192.168.xx.xx:5432/mydb \ -e KEY_VAULTS_SECRET=xxxx \ -e NEXT_AUTH_SECRET=xxxxx \ -e NEXT_AUTH_SSO_PROVIDERS=auth0 \ -e AUTH0_CLIENT_ID=xxxxxxxxxxWPWAS0GpxxxxxxxxxxGxxx \ -e AUTH0_CLIENT_SECRET=xxxxxxxxxBUlFzVMxxxxxxxxxxxxxxxxxxxxxxxTkU5Dc6xxxxxxx- \ -e AUTH0_ISSUER=https://dev-oldbiuln0bipyiqh.us.auth0.com \ -e NEXTAUTH_URL=http://192.168.31.33:3210/api/auth/callback/auth0 \ -e S3_ACCESS_KEY_ID=xxxxxx \ -e S3_SECRET_ACCESS_KEY=xxxxx \ -e S3_ENDPOINT=https://xxxxx.r2.cloudflarestorage.com \ -e S3_BUCKET=lobechat \ -e NEXT_PUBLIC_S3_DOMAIN=https://lober2.xxxxx.top \ lobehub/lobe-chat-database:latest After clicking to log in and register, feedback (because it is inconvenient at the moment, I can’t take a screenshot): The page encountered a problem. Please try it later or return to the known world.

sqkkyzx commented 1 month ago

成功部署,但无法点击登陆注册账户后出现错误。部署命令如下(用xxxx模糊了敏感信息): docker run -it -d --name lobe-chat-database --restart always -p 3210:3210 -e DATABASE_URL=postgresql://root:xxxxx@192.168.xx.xx:5432/mydb -e KEY_VAULTS_SECRET=xxxx -e NEXT_AUTH_SECRET=xxxxx -e NEXT_AUTH_SSO_PROVIDERS=auth0 -e AUTH0_CLIENT_ID=xxxxxxxxxxWPWAS0GpxxxxxxxxxxGxxx -e AUTH0_CLIENT_SECRET=xxxxxxxxxBUlFzVMxxxxxxxxxxxxxxxxxxxxxxxTkU5Dc6xxxxxxx- -e AUTH0_ISSUER=https://dev-oldbiuln0bipyiqh.us.auth0.com -e NEXTAUTH_URL=http://192.168.31.33:3210/api/auth/callback/auth0 -e S3_ACCESS_KEY_ID=xxxxxx -e S3_SECRET_ACCESS_KEY=xxxxx -e S3_ENDPOINT=https://xxxxx.r2.cloudflarestorage.com -e S3_BUCKET=lobechat -e NEXT_PUBLIC_S3_DOMAIN=https://lober2.xxxxx.top lobehub/lobe-chat-database:latest 点击登陆注册后,反馈(因为这会儿不方便,没法截图): 页面遇到一点问题,待会儿来试试,或回到已知的世界

NEXTAUTH_URL 配置为 http://192.168.31.33:3210/api/auth 试试

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Deployed successfully, but an error occurred after being unable to click login to register an account. The deployment command is as follows (sensitive information is blurred with xxxx): docker run -it -d --name lobe-chat-database --restart always -p 3210:3210 -e DATABASE_URL=postgresql://root:xxxxx@192.168. xx.xx:5432/mydb -e KEY_VAULTS_SECRET=xxxx -e NEXT_AUTH_SECRET=xxxxx -e NEXT_AUTH_SSO_PROVIDERS=auth0 -e AUTH0_CLIENT_ID=xxxxxxxxxxWPWAS0GpxxxxxxxxxxGxxx -e AUTH0_CLIENT_SECRET =xxxxxxxxxBUlFzVMxxxxxxxxxxxxxxxxxxxxxxxTkU5Dc6xxxxxxx- -e AUTH0_ISSUER=https ://dev-oldbiuln0bipyiqh.us.auth0.com -e NEXTAUTH_URL=http://192.168.31.33:3210/api/auth/callback/auth0 -e S3_ACCESS_KEY_ID=xxxxxx -e S3_SECRET_ACCESS_KEY=xxxxx -e S3_ENDPOINT=https:/ /xxxxx.r2.cloudflarestorage.com -e S3_BUCKET=lobechat -e NEXT_PUBLIC_S3_DOMAIN=https://lober2.xxxxx.top lobehub/lobe-chat-database:latest After clicking login to register, give feedback (because it is inconvenient at this time, no French screenshot): The page encountered a problem, try it later, or return to the known world.

NEXTAUTH_URL is configured as http://192.168.31.33:3210/api/auth try

darkelfzdy commented 1 month ago

成功部署,但无法点击登陆注册账户后出现错误。部署命令如下(用xxxx模糊了敏感信息): docker run -it -d --name lobe-chat-database --restart always -p 3210:3210 -e DATABASE_URL=postgresql://root:xxxxx@192.168.xx.xx:5432/mydb -e KEY_VAULTS_SECRET=xxxx -e NEXT_AUTH_SECRET=xxxxx -e NEXT_AUTH_SSO_PROVIDERS=auth0 -e AUTH0_CLIENT_ID=xxxxxxxxxxWPWAS0GpxxxxxxxxxxGxxx -e AUTH0_CLIENT_SECRET=xxxxxxxxxBUlFzVMxxxxxxxxxxxxxxxxxxxxxxxTkU5Dc6xxxxxxx- -e AUTH0_ISSUER=https://dev-oldbiuln0bipyiqh.us.auth0.com -e NEXTAUTH_URL=http://192.168.31.33:3210/api/auth/callback/auth0 -e S3_ACCESS_KEY_ID=xxxxxx -e S3_SECRET_ACCESS_KEY=xxxxx -e S3_ENDPOINT=https://xxxxx.r2.cloudflarestorage.com -e S3_BUCKET=lobechat -e NEXT_PUBLIC_S3_DOMAIN=https://lober2.xxxxx.top lobehub/lobe-chat-database:latest 点击登陆注册后,反馈(因为这会儿不方便,没法截图): 页面遇到一点问题,待会儿来试试,或回到已知的世界

NEXTAUTH_URL 配置为 http://192.168.31.33:3210/api/auth 试试

不再提示页面遇到问题。但无论是否挂梯子,都还是不行,进入一个新的页面,提示: dev-oldbiuln0bipyiqh Oops!, something went wrong Callback URL mismatch. The provided redirect_uri is not in the list of allowed callback URLs. Please go to the Application Settings page and make sure you are sending a valid callback url from your application.

wxy-skye commented 1 month ago

{"level":30,"time":1722936377436,"pid":1,"hostname":"1d3c7d96218a","msg":"Error in tRPC handler (lambda) on path: user.getUserState, type: query"} lobe-chat-database | {"level":30,"time":1722936381595,"pid":1,"hostname":"1d3c7d96218a","msg":"Error in tRPC handler (lambda) on path: session.getSessionConfig, type: query"}

我用clerk登陆,一直这个报错。也找不到什么原因

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


{"level":30,"time":1722936377436,"pid":1,"hostname":"1d3c7d96218a","msg":"Error in tRPC handler (lambda) on path: user.getUserState, type: query" } lobe-chat-database | {"level":30,"time":1722936381595,"pid":1,"hostname":"1d3c7d96218a","msg":"Error in tRPC handler (lambda) on path: session. getSessionConfig, type: query"}

I log in using clerk and I keep getting this error. I can't find any reason

iparanoid commented 1 month ago

数据库版本的docker配置完成以后,记得要在设置界面中输入配置好的ACCESS_CODE,不然即使认证登录后S3传文件仍然会报错,折腾了好久还以为没配置正确😂,大象大家都遇到过没,发上来记录一下图像

现在阶段S3报错应该是正常的

恩 UI界面里输入ACCESS_CODE以后,虽然上传还是报错,但是桶里已经能看到文件了,没输入的话桶里没文件的

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


After the docker configuration of the database version is completed, remember to enter the configured ACCESS_CODE in the setting interface, otherwise an error will still be reported even if the S3 file is uploaded after authentication and login. After struggling for a long time, I thought it was not configured correctly. Everyone has encountered this elephant. Have you passed, please post it for recordimage

It should be normal for S3 to report errors at this stage.

Well, after entering ACCESS_CODE in the interface, although an error is still reported, the file can already be seen in the bucket. If it is not entered, there will be no file in the bucket.

iparanoid commented 1 month ago

成功部署,但无法点击登陆注册账户后出现错误。部署命令如下(用xxxx模糊了敏感信息): docker run -it -d --name lobe-chat-database --restart always -p 3210:3210 -e DATABASE_URL=postgresql://root:xxxxx@192.168.xx.xx:5432/mydb -e KEY_VAULTS_SECRET=xxxx -e NEXT_AUTH_SECRET=xxxxx -e NEXT_AUTH_SSO_PROVIDERS=auth0 -e AUTH0_CLIENT_ID=xxxxxxxxxxWPWAS0GpxxxxxxxxxxGxxx -e AUTH0_CLIENT_SECRET=xxxxxxxxxBUlFzVMxxxxxxxxxxxxxxxxxxxxxxxTkU5Dc6xxxxxxx- -e AUTH0_ISSUER=https://dev-oldbiuln0bipyiqh.us.auth0.com -e NEXTAUTH_URL=http://192.168.31.33:3210/api/auth/callback/auth0 -e S3_ACCESS_KEY_ID=xxxxxx -e S3_SECRET_ACCESS_KEY=xxxxx -e S3_ENDPOINT=https://xxxxx.r2.cloudflarestorage.com -e S3_BUCKET=lobechat -e NEXT_PUBLIC_S3_DOMAIN=https://lober2.xxxxx.top lobehub/lobe-chat-database:latest 点击登陆注册后,反馈(因为这会儿不方便,没法截图): 页面遇到一点问题,待会儿来试试,或回到已知的世界

NEXTAUTH_URL 配置为 http://192.168.31.33:3210/api/auth 试试

不再提示页面遇到问题。但无论是否挂梯子,都还是不行,进入一个新的页面,提示: dev-oldbiuln0bipyiqh Oops!, something went wrong Callback URL mismatch. The provided redirect_uri is not in the list of allowed callback URLs. Please go to the Application Settings page and make sure you are sending a valid callback url from your application.

image

看看AUTH0里面的设置?

darkelfzdy commented 1 month ago

成功部署,但无法点击登陆注册账户后出现错误。部署命令如下(用xxxx模糊了敏感信息): docker run -it -d --name lobe-chat-database --restart always -p 3210:3210 -e DATABASE_URL=postgresql://root:xxxxx@192.168.xx.xx:5432/mydb -e KEY_VAULTS_SECRET=xxxx -e NEXT_AUTH_SECRET=xxxxx -e NEXT_AUTH_SSO_PROVIDERS=auth0 -e AUTH0_CLIENT_ID=xxxxxxxxxxWPWAS0GpxxxxxxxxxxGxxx -e AUTH0_CLIENT_SECRET=xxxxxxxxxBUlFzVMxxxxxxxxxxxxxxxxxxxxxxxTkU5Dc6xxxxxxx- -e AUTH0_ISSUER=https://dev-oldbiuln0bipyiqh.us.auth0.com -e NEXTAUTH_URL=http://192.168.31.33:3210/api/auth/callback/auth0 -e S3_ACCESS_KEY_ID=xxxxxx -e S3_SECRET_ACCESS_KEY=xxxxx -e S3_ENDPOINT=https://xxxxx.r2.cloudflarestorage.com -e S3_BUCKET=lobechat -e NEXT_PUBLIC_S3_DOMAIN=https://lober2.xxxxx.top lobehub/lobe-chat-database:latest 点击登陆注册后,反馈(因为这会儿不方便,没法截图): 页面遇到一点问题,待会儿来试试,或回到已知的世界

NEXTAUTH_URL 配置为 http://192.168.31.33:3210/api/auth 试试

不再提示页面遇到问题。但无论是否挂梯子,都还是不行,进入一个新的页面,提示: dev-oldbiuln0bipyiqh Oops!, something went wrong Callback URL mismatch. The provided redirect_uri is not in the list of allowed callback URLs. Please go to the Application Settings page and make sure you are sending a valid callback url from your application.

image 看看AUTH0里面的设置?

没有问题,我看了AUTH0和NEXTAUTH_URL如果都是http://192.168.31.33:3210/api/auth/callback/auth0,就提示页面遇到一点问题,待会儿来试试,或回到已知的世界,如果AUTH0和NEXTAUTH_URL是http://192.168.31.33:3210/api/auth,就转到新页面提示dev-oldbiuln0bipyiqh Oops!, something went wrong Callback URL mismatch. The provided redirect_uri is not in the list of allowed callback URLs. Please go to the Application Settings page and make sure you are sending a valid callback url from your application.

darkelfzdy commented 1 month ago

最后又换成authing,成功登陆了。不过在导入之前的全局设置和所有助手数据的时候,又提示: 导入失败 出错原因: Upload Error 顺便说一句,我今天采用vercel+neon数据库方式部署的时候,也是成功登陆,但到了导入的时候也提示相同的错误