Skip to content
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 服务端,使用域名模式部署,为什么部署完成后访问 auth-ui 页面,一直被重定向对话 #4892

Open
SarcomTDG opened this issue Dec 5, 2024 · 21 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@SarcomTDG
Copy link

SarcomTDG commented Dec 5, 2024

📦 部署环境

Docker

📌 软件版本

last

💻 系统环境

Ubuntu

🌐 浏览器

Chrome

🐛 问题描述

Docker Compose 部署 LobeChat 服务端,使用域名模式部署,为什么部署完成后访问auth-ui页面,一直被重定向缺失对话
image
image

📷 复现步骤

No response

🚦 期望结果

登录LobeChat webui平台

📝 补充信息

No response

@SarcomTDG SarcomTDG added the 🐛 Bug Something isn't working | 缺陷 label Dec 5, 2024
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Dec 5, 2024
@lobehubbot
Copy link
Member

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


📦 Deployment environment

Docker

📌 Software version

last

💻 System environment

Ubuntu

🌐 Browser

Chrome

🐛 Problem description

Docker Compose deploys the LobeChat server and deploys it using the domain name mode. Why is it that after the deployment is completed, the auth-ui page is redirected and the dialogue is missing?
image
image

📷 Steps to reproduce

No response

🚦 Expected results

No response

📝 Supplementary information

No response

@lobehubbot
Copy link
Member

👀 @SarcomTDG

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@SarcomTDG
Copy link
Author

登录鉴权使用默认 Logto ,通过ip+端口访问也有相同问题

Copy link

dosubot bot commented Dec 5, 2024

@SarcomTDG 你好!我是Dosu,一个可以帮助你解决软件问题、回答疑问并成为贡献者的机器人。我会在等待人类维护者的过程中帮助你。

I found a similar open issue related to Docker Compose deployment of LobeChat, where users experienced redirection errors or "unknown-session" errors. The suggested solutions include:

  1. Verify that all necessary environment variables are correctly set in your .env file, including NEXT_AUTH_SECRET, AUTH_CASDOOR_ID, AUTH_CASDOOR_SECRET, and AUTH_CASDOOR_ISSUER.
  2. Double-check the Casdoor application settings to ensure the callback URL is correctly set.
  3. Ensure that CORS settings are correctly configured for MinIO and Casdoor, allowing requests from your LobeChat instance URL.
  4. Review the logs for each Docker service to identify any specific errors or warnings.
  5. Restart the Docker services after making configuration changes using docker-compose down followed by docker-compose up -d.
  6. Ensure that your Docker network settings are correctly configured and that there are no firewall rules blocking communication between the services [1].

These steps might help resolve the issue you're encountering with the "404 Page Not Found" error and redirection problems.

To continue talking to Dosu, mention @dosu.

@lobehubbot
Copy link
Member

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


The default Logto is used for login authentication, and access through ip+port also has the same problem.

@SpeedupMaster
Copy link
Contributor

域名是解析在Cloudflare上吗?

@lobehubbot
Copy link
Member

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


Is the domain name resolved on Cloudflare?

@SarcomTDG
Copy link
Author

域名是解析在Cloudflare上吗?

不是,我是放到阿里云上面,域名指向服务器ip,通过nginx转发到内网里面另外一台服务器上,再通过这台服务器nginx转发到指定端口。

@lobehubbot
Copy link
Member

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


Is the domain name resolved on Cloudflare?

No, I put it on Alibaba Cloud, the domain name points to the server IP, forwards it to another server in the intranet through nginx, and then forwards it to the specified port through nginx of this server.

@SpeedupMaster
Copy link
Contributor

域名是解析在Cloudflare上吗?

不是,我是放到阿里云上面,域名指向服务器ip,通过nginx转发到内网里面另外一台服务器上,再通过这台服务器nginx转发到指定端口。

不然试试casdoor吧,Logto部署好像一堆问题。

@lobehubbot
Copy link
Member

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


Is the domain name resolved on Cloudflare?

No, I put it on Alibaba Cloud, the domain name points to the server IP, forwards it to another server in the intranet through nginx, and then forwards it to the specified port through nginx of this server.

Otherwise, try casdoor. Logto deployment seems to have a lot of problems.

@SarcomTDG
Copy link
Author

域名是解析在Cloudflare上吗?

不是,我是放到阿里云上面,域名指向服务器ip,通过nginx转发到内网里面另外一台服务器上,再通过这台服务器nginx转发到指定端口。

或者试试casdoor吧,Logto部署了很多问题。

通过域名发布 casdoor有相关参考文档和docker-compose.yml吗?

@lobehubbot
Copy link
Member

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


Is the domain name resolved on Cloudflare?

No, I put it on Alibaba Cloud, the domain name points to the server IP, forwards it to another server in the intranet through nginx, and then forwards it to the specified port through nginx of this server.

Or try casdoor, Logto deployment has many problems.

Publish via domain name Does casdoor have relevant reference documents and docker-compose.yml?

@SarcomTDG SarcomTDG changed the title [Bug] [Bug] Docker Compose 部署 LobeChat 服务端,使用域名模式部署,为什么部署完成后访问 auth-ui 页面,一直被重定向对话 Dec 6, 2024
@SpeedupMaster
Copy link
Contributor

域名是解析在Cloudflare上吗?

不是,我是放到阿里云上面,域名指向服务器ip,通过nginx转发到内网里面另外一台服务器上,再通过这台服务器nginx转发到指定端口。

或者试试casdoor吧,Logto部署了很多问题。

通过域名发布 casdoor有相关参考文档和docker-compose.yml吗?

  casdoor:
    image: casbin/casdoor:latest
    container_name: lobe-casdoor
    ports:
      - 8000:8000
    depends_on:
      postgresql:
        condition: service_healthy
    environment:
      - RUNNING_IN_DOCKER=true
      - driverName=postgres
      - dataSourceName=postgres://postgres:b750e83ac80f7261513axxxxxxxxx@postgresql:5432/casdoor?sslmode=disable
    volumes:
      - ./files:/files
    entrypoint:
      - /bin/sh
      - -c
      - ./server --createDatabase=true

环境变量

NEXT_AUTH_SSO_PROVIDERS=casdoor
AUTH_CASDOOR_ID=
AUTH_CASDOOR_SECRET=
AUTH_CASDOOR_ISSUER=
CASDOOR_WEBHOOK_SECRET=

记得要在casdoor里设置callback
http://lobe.example.com/api/auth/callback/casdoor
可以参考教程发布到IP那部分

@lobehubbot
Copy link
Member

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


Is the domain name resolved on Cloudflare?

No, I put it on Alibaba Cloud, the domain name points to the server IP, forwards it to another server in the intranet through nginx, and then forwards it to the specified port through nginx of this server.

Or try casdoor, Logto deployment has many problems.

Publish via domain name Does casdoor have relevant reference documents and docker-compose.yml?

  casdoor:
    image: casbin/casdoor:latest
    container_name: lobe-casdoor
    ports:
      - 8000:8000
    depends_on:
      postgresql:
        condition: service_healthy
    environment:
      - RUNNING_IN_DOCKER=true
      - driverName=postgres
      - dataSourceName=postgres://postgres:b750e83ac80f7261513axxxxxxxxx@postgresql:5432/casdoor?sslmode=disable
    volumes:
      - ./files:/files
    entrypoint:
      -/bin/sh
      - -c
      - ./server --createDatabase=true

environment variables

NEXT_AUTH_SSO_PROVIDERS=casdoor
AUTH_CASDOOR_ID=
AUTH_CASDOOR_SECRET=
AUTH_CASDOOR_ISSUER=
CASDOOR_WEBHOOK_SECRET=

Remember to set callback in casdoor
http://lobe.example.com/api/auth/callback/casdoor
You can refer to the tutorial to publish to IP.

@cy948
Copy link
Contributor

cy948 commented Dec 7, 2024

logto部署成功后要先访问它的 adminui 进行管理员注册,已有相关 issue ,你可以搜搜。

@lobehubbot
Copy link
Member

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


After logto is successfully deployed, you must first access its adminui to register as an administrator. There are related issues, you can search them.

@SarcomTDG
Copy link
Author

logto部署成功后要先访问它的 adminui 进行管理员注册,已有相关 issue ,你可以搜搜。

使用 docker deploy logto v1.6 将始终重定向到 /unknown-session看了下有点头大,感觉默认教程用这个说明有点不明确

@lobehubbot
Copy link
Member

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


After logto is successfully deployed, you must first access its adminui to register as an administrator. There are related issues, you can search them.

Using docker deploy logto v1.6 will always redirect to /unknown-session It’s a bit confusing after reading it. I feel that the default tutorial uses this description. a bit unclear

@cy948
Copy link
Contributor

cy948 commented Dec 10, 2024

那就用casdoor或logto saas版代替咯

@lobehubbot
Copy link
Member

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


Then use casdoor or logto saas version instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷
Projects
Status: Roadmap - Chat 1.x
Development

No branches or pull requests

4 participants