-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] docker-compose部署LobeChat 服务端数据库版本provider logto is not supported #3963
Comments
📦 EnvironmentDocker 📌 Versionlatest 💻 Operating SystemOther Linux 🌐 BrowserChrome 🐛 Bug DescriptionUse docker-compose to deploy the LobeChat server database version. When you open the main page xxxx:3210, the page displays 500 Check the log and the error is as follows The relevant configuration is as follows # NextAuth authentication service provider part, taking Logto as an example
# For other environment variables required by authentication service providers, please refer to: https://lobehub.com/zh/docs/self-hosting/environment-variables/auth
LOGTO_CLIENT_ID=pstvtqe4x0yeduik0ndxx
LOGTO_CLIENT_SECRET=gex9RqyLLtzwb7cGdukYmiWI7VnO3cH5
LOGTO_ISSUER=http://82.157.65.83:3001/oidc docker-compose.yml logto:
image: svhd/logto
container_name: lobe-logto
ports:
- '3001:3001'
- '3002:3002'
depends_on:
postgresql:
condition: service_healthy
environment:
- 'TRUST_PROXY_HEADER=1'
- 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/logto'
- 'ENDPOINT=http://82.157.65.83:3001/'
- 'ADMIN_ENDPOINT=http://82.157.65.83:3002'
entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
How to solve this situation? 📷 Recurrence StepsNo response 🚦 Expected BehaviorNo response 📝 Additional InformationNo response |
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
@chenchengzi 你好! 我是 Dosu,我是一个可以帮助解决bug,回答问题,并成为贡献者的机器人。我在这里帮助你,等待人类维护者。 To resolve the error "[NextAuth] provider logto is not supported" when deploying LobeChat using docker-compose, ensure that you have correctly set the environment variables, particularly environment:
- NEXT_AUTH_SECRET=your_generated_secret
- NEXT_AUTH_SSO_PROVIDERS=logto
- LOGTO_CLIENT_ID=your_logto_client_id
- LOGTO_CLIENT_SECRET=your_logto_client_secret
- LOGTO_ISSUER=http://82.157.65.83:3001/oidc
- NEXTAUTH_URL=http://82.157.65.83:3210/api/auth Make sure that environment:
- APP_URL=http://82.157.65.83:3210/ This configuration should help resolve the error and enable the Logto provider for authentication in your LobeChat deployment [1][2]. |
.env中已配置 # 必填,LobeChat 域名,用于 tRPC 调用
# 请保证此域名在你的 NextAuth 鉴权服务提供商、S3 服务商的 CORS 白名单中
APP_URL=http://82.157.65.83:3210
# NEXT_AUTH 相关,也即鉴权服务必需的环境变量
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
# 必填,指定鉴权服务提供商,这里以 Logto 为例
NEXT_AUTH_SSO_PROVIDERS=logto
NEXTAUTH_URL=http://82.157.65.83:9000/api/auth
LOGTO_CLIENT_ID=pstvtqe4x0yeduik
LOGTO_CLIENT_SECRET=gex9RqyLLtzwb7cGdukYmiW
LOGTO_ISSUER=http://82.157.65.83:3001/oidc
|
Configured in .env # Required, LobeChat domain name, used for tRPC calls
# Please ensure that this domain name is in the CORS whitelist of your NextAuth authentication service provider and S3 service provider
APP_URL=http://82.157.65.83:3210
# NEXT_AUTH related, that is, the environment variable necessary for the authentication service
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
# Required, specify the authentication service provider, take Logto as an example here
NEXT_AUTH_SSO_PROVIDERS=logto
NEXTAUTH_URL=http://82.157.65.83:9000/api/auth
LOGTO_CLIENT_ID=pstvtqe4x0yeduik
LOGTO_CLIENT_SECRET=gex9RqyLLtzwb7cGdukYmiW
LOGTO_ISSUER=http://82.157.65.83:3001/oidc
|
|
|
|
看下docker compose和.enn文件里的其他配置有没有问题 |
Check if there are any problems with other configurations in docker compose and .enn files. |
详细配置如下 services:
postgresql:
image: pgvector/pgvector:pg16
container_name: lobe-postgres
ports:
- '5432:5432'
volumes:
- './data:/var/lib/postgresql/data'
environment:
- 'POSTGRES_DB=lobe'
- 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5
restart: always
minio:
image: minio/minio
container_name: lobe-minio
ports:
- '9000:9000'
- '9001:9001'
volumes:
- './s3_data:/etc/minio/data'
environment:
- 'MINIO_ROOT_USER=cz'
- 'MINIO_ROOT_PASSWORD=cz111111'
- 'MINIO_DOMAIN=http://82.157.65.83:9000'
- 'MINIO_API_CORS_ALLOW_ORIGIN=http://82.157.65.83:3210' # Your LobeChat's domain name.
restart: always
command: >
server /etc/minio/data --address ":9000" --console-address ":9001"
logto:
image: svhd/logto
container_name: lobe-logto
ports:
- '3001:3001'
- '3002:3002'
depends_on:
postgresql:
condition: service_healthy
environment:
- 'TRUST_PROXY_HEADER=1'
- 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/logto'
- 'ENDPOINT=http://82.157.65.83:3001/'
- 'ADMIN_ENDPOINT=http://82.157.65.83:3002'
entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
lobe:
image: lobehub/lobe-chat-database
container_name: lobe-database
ports:
- '3210:3210'
depends_on:
- postgresql
- minio
- logto
env_file:
- .env
restart: always
volumes:
data:
driver: local
s3_data:
driver: local
.env # 必填,LobeChat 域名,用于 tRPC 调用
# 请保证此域名在你的 NextAuth 鉴权服务提供商、S3 服务商的 CORS 白名单中
APP_URL=http://82.157.65.83:3210
# Postgres 相关,也即 DB 必需的环境变量
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
# NEXT_AUTH 相关,也即鉴权服务必需的环境变量
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
NEXT_AUTH_SSO_PROVIDERS=logto
NEXTAUTH_URL=http://82.157.65.83:3210/api/auth
# NextAuth 鉴权服务提供商部分,以 Logto 为例
LOGTO_CLIENT_ID=pstvtqe4x0yeduik0ndxx
LOGTO_CLIENT_SECRET=gex9RqyLLtzwb7cGdukYmiWI7VnO3cH5
LOGTO_ISSUER=http://82.157.65.83:3001/oidc
# 代理相关,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
# HTTP_PROXY=http://localhost:7890
# HTTPS_PROXY=http://localhost:7890
# S3 相关,也即非结构化数据(文件、图片等)存储必需的环境变量
# 这里以 MinIO 为例
S3_ACCESS_KEY_ID=9VXsvLu592YIc3ORCRdA
S3_SECRET_ACCESS_KEY=AzZD7gMCmDqNYGlO3B6L0Dbzbwwg9T65j8FBeYL8
# 必填,S3 的 Endpoint,用于服务端/客户端连接到 S3 API
S3_ENDPOINT=http://82.157.65.83:9000
S3_BUCKET=lobe
S3_PUBLIC_DOMAIN=http://82.157.65.83:9000
S3_ENABLE_PATH_STYLE=1
NEXT_PUBLIC_S3_DOMAIN=http://82.157.65.83:9000
# 其他基础环境变量,视需求而定。注意不要有 ACCESS_CODE
# 请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/basic
# 请注意,对于服务端版本,其 API 必须支持嵌入(OpenAI text-embedding-3-small)模型,否则无法对上传文件进行处理,但你无需在 OPENAI_MODEL_LIST 中指定此模型
# OPENAI_API_KEY=sk-xxxx
# OPENAI_PROXY_URL=https://api.openai.com/v1
# OPENAI_MODEL_LIST=..
|
Detailed configuration is as follows services:
postgresql:
image: pgvector/pgvector:pg16
container_name: lobe-postgres
ports:
- '5432:5432'
volumes:
- './data:/var/lib/postgresql/data'
environment:
- 'POSTGRES_DB=lobe'
- 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5
restart: always
minio:
image: minio/minio
container_name: lobe-minio
ports:
- '9000:9000'
- '9001:9001'
volumes:
- './s3_data:/etc/minio/data'
environment:
- 'MINIO_ROOT_USER=cz'
- 'MINIO_ROOT_PASSWORD=cz111111'
- 'MINIO_DOMAIN=http://82.157.65.83:9000'
- 'MINIO_API_CORS_ALLOW_ORIGIN=http://82.157.65.83:3210' # Your LobeChat's domain name.
restart: always
command: >
server /etc/minio/data --address ":9000" --console-address ":9001"
logto:
image: svhd/logto
container_name: lobe-logto
ports:
- '3001:3001'
- '3002:3002'
depends_on:
postgresql:
condition: service_healthy
environment:
- 'TRUST_PROXY_HEADER=1'
- 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/logto'
- 'ENDPOINT=http://82.157.65.83:3001/'
- 'ADMIN_ENDPOINT=http://82.157.65.83:3002'
entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
lobe:
image: lobehub/lobe-chat-database
container_name: lobe-database
ports:
- '3210:3210'
depends_on:
-postgresql
- minio
-logto
env_file:
- .env
restart: always
volumes:
data:
driver:local
s3_data:
driver: local
.env # Required, LobeChat domain name, used for tRPC calls
# Please ensure that this domain name is in the CORS whitelist of your NextAuth authentication service provider and S3 service provider
APP_URL=http://82.157.65.83:3210
# Postgres related, that is, DB necessary environment variables
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
# NEXT_AUTH related, that is, the environment variable necessary for the authentication service
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
NEXT_AUTH_SSO_PROVIDERS=logto
NEXTAUTH_URL=http://82.157.65.83:3210/api/auth
# NextAuth authentication service provider part, taking Logto as an example
LOGTO_CLIENT_ID=pstvtqe4x0yeduik0ndxx
LOGTO_CLIENT_SECRET=gex9RqyLLtzwb7cGdukYmiWI7VnO3cH5
LOGTO_ISSUER=http://82.157.65.83:3001/oidc
# Proxy related, if you need it (for example, if you use GitHub as the authentication service provider)
# HTTP_PROXY=http://localhost:7890
# HTTPS_PROXY=http://localhost:7890
# S3 related, that is, environment variables necessary for storing unstructured data (files, pictures, etc.)
# Here we take MinIO as an example
S3_ACCESS_KEY_ID=9VXsvLu592YIc3ORCRdA
S3_SECRET_ACCESS_KEY=AzZD7gMCmDqNYGlO3B6L0Dbzbwwg9T65j8FBeYL8
# Required, S3 Endpoint, used for server/client to connect to S3 API
S3_ENDPOINT=http://82.157.65.83:9000
S3_BUCKET=lobe
S3_PUBLIC_DOMAIN=http://82.157.65.83:9000
S3_ENABLE_PATH_STYLE=1
NEXT_PUBLIC_S3_DOMAIN=http://82.157.65.83:9000
# Other basic environment variables, depending on needs. Be careful not to have ACCESS_CODE
# Please refer to: https://lobehub.com/zh/docs/self-hosting/environment-variables/basic
# Please note that for the server version, its API must support the embedding (OpenAI text-embedding-3-small) model, otherwise the uploaded file cannot be processed, but you do not need to specify this model in OPENAI_MODEL_LIST
# OPENAI_API_KEY=sk-xxxx
# OPENAI_PROXY_URL=https://api.openai.com/v1
# OPENAI_MODEL_LIST=..
|
你成功了吗,你这样配法是不是nginx都不需要了 |
Have you succeeded? If you configure it this way, nginx doesn’t even need it. |
强制更新下 lobe-chat-database 这个镜像 |
Forced update of the lobe-chat-database image |
我是最新的兄弟
发自我的iPhone
…------------------ 原始邮件 ------------------
发件人: Yao Cai ***@***.***>
发送时间: 2024年9月17日 11:34
收件人: lobehub/lobe-chat ***@***.***>
抄送: zhangleijun111 ***@***.***>, Comment ***@***.***>
主题: Re: [lobehub/lobe-chat] [Bug] docker-compose部署LobeChat 服务端数据库版本provider logto is not supported (Issue #3963)
强制更新下 lobe-chat-database 这个镜像
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
其他未发现报错,不配置NEXT_PUBLIC_S3_DOMAIN=http://82.157.65.83:9000的话会报下面这个错误,不清楚什么原因,docker-compose拉取的都是最新版镜像 |
Same issue here. +1 |
@zhangleijun111 看一下你的 docker 镜像的 hash ,tag 在 https://hub.docker.com/r/lobehub/lobe-chat-database/tags |
@zhangleijun111 Take a look at the hash of your docker image. The tag is at https://hub.docker.com/r/lobehub/lobe-chat-database/tags |
Mine: sha256:e495a07763f8120081ee010f30be290aeec7c8c15eb0ecad7344b9941abe7493 . Which is different from the one at Docker Hub. I pulled it no more than 24 hours ago. I'll pull it again. |
NEXT_PUBLIC_S3_DOMAIN这个现在改成S3_PUBLIC_DOMAIN了,应该是不再需要了。 |
NEXT_PUBLIC_S3_DOMAIN has now been changed to S3_PUBLIC_DOMAIN, which should no longer be needed. |
|
I used the IP address to deploy and now when I click to log in, I get this problem |
我用了谷歌绕过
我用了谷歌烧过https的那个设置,这是我报错的日志 |
fetch failed 是网络问题,服务器可能与auth endpoint不互通 |
您回答的是我这个问题嘛,另外和logto有关的配置全部使用http而不是https是吧 |
You are answering my question. In addition, all configurations related to logto use http instead of https, right? |
我现在点击登录报这个错误 |
先用 AUTH_URL ,另外 logto 只支持https。 |
Use AUTH_URL first, and logto only supports https. |
我知道不是说--ignore加谷歌浏览器绕过他嘛,我现在logto倒是登陆配置好了,但是进lobechat点登陆不行了,这是啥问题呀??? |
I know it's not about using --ignore and adding Google Chrome to bypass it. Now I have logged in and configured logto, but I can't log in at lobechat. What's the problem? ? ? |
新版文档已上线,推荐使用 Casdoor。 https://lobehub.com/zh/docs/self-hosting/server-database/docker-compose |
This issue is closed, If you have any questions, you can comment and reply. |
A new version of the documentation is now online, and it is recommended to use Casdoor. https://lobehub.com/en/docs/self-hosting/server-database/docker-compose |
📦 Environment
Docker
📌 Version
latest
💻 Operating System
Other Linux
🌐 Browser
Chrome
🐛 Bug Description
采用docker-compose部署LobeChat 服务端数据库版本,打开主页面xxxx:3210时页面显示500
查看日志报错如下
lobe-database |
lobe-database | Error: [NextAuth] provider logto is not supported
lobe-database | at /app/.next/server/src/middleware.js:400:60330
lobe-database | at Array.map ()
lobe-database | at 9353 (/app/.next/server/src/middleware.js:400:60266)
lobe-database | at t (/app/.next/server/edge-runtime-webpack.js:1:143)
lobe-database | at /app/.next/server/src/middleware.js:423:8108
lobe-database | at r (/app/.next/server/edge-runtime-webpack.js:1:1539)
lobe-database | at /app/.next/server/src/middleware.js:1:51
lobe-database | at Script.runInContext (node:vm:148:12)
lobe-database | at runInContext (node:vm:300:6)
lobe-database | at evaluateInContext (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/web/sandbox/context.js:403:38)
相关配置如下
.env
docker-compose.yml
logto: image: svhd/logto container_name: lobe-logto ports: - '3001:3001' - '3002:3002' depends_on: postgresql: condition: service_healthy environment: - 'TRUST_PROXY_HEADER=1' - 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/logto' - 'ENDPOINT=http://82.157.65.83:3001/' - 'ADMIN_ENDPOINT=http://82.157.65.83:3002' entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
请问这种情况如何解决
📷 Recurrence Steps
No response
🚦 Expected Behavior
No response
📝 Additional Information
No response
The text was updated successfully, but these errors were encountered: