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
44.28k stars 9.92k forks source link

Can Lobe chat self-hosting be deployed using Cloudflare Advanced Deployment options? #3893

Closed LiveWithCodeAnkit closed 3 weeks ago

LiveWithCodeAnkit commented 1 month ago

📝 Reference

https://github.com/lobehub/lobe-chat/tree/main/docs/self-hosting/server-database.mdx

I am trying to deploy on Cloudflare. I followed all the steps, including integrating my Git repository and adding all the necessary environment variables according to the Cloudflare documentation. I also updated the wrangler.toml file in the root directory. However, I am facing some errors. image_2024_09_11T05_22_21_571Z

Can you help me resolve these issues?

lobehubbot commented 1 month ago

👀 @LiveWithCodeAnkit

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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

dosubot[bot] commented 1 month ago

Hey @LiveWithCodeAnkit! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve this!

Yes, Lobe chat self-hosting can be deployed using Cloudflare Advanced Deployment options, specifically by configuring Cloudflare Zero Trust Authentication Service for Single Sign-On (SSO).

Supporting evidence and steps from the document:

  1. Creating an Application in Cloudflare Zero Trust:

    • Navigate to https://one.dash.cloudflare.com/ and go to Access - Applications.
    • Click Add an application and select SaaS.
    • Enter the application name (e.g., LobeChat SSO), select OIDC, and add the application.
    • Enter the redirect URL: https://chat.example.com/api/auth/callback/cloudflare-zero-trust (replace chat.example.com with your instance's address).
    • Record the Client secret, Client ID, and Issuer.
  2. Configure Environment Variables:

    • Set the following environment variables when deploying LobeChat:
      NEXT_AUTH_SECRET=<generated_secret>
      NEXT_AUTH_SSO_PROVIDERS=cloudflare-zero-trust
      CLOUDFLARE_ZERO_TRUST_CLIENT_ID=<client_id>
      CLOUDFLARE_ZERO_TRUST_CLIENT_SECRET=<client_secret>
      CLOUDFLARE_ZERO_TRUST_ISSUER=<issuer>
      NEXTAUTH_URL=https://example.com/api/auth

After configuring these settings, users will be able to authenticate with LobeChat using Cloudflare Zero Trust [1].

To continue talking to Dosu, mention @dosu.

arvinxx commented 3 weeks ago

Cloudflare don't support nodejs runtime. So it's impossible to deploy LobeChat on CF now.

lobehubbot commented 3 weeks ago

✅ @LiveWithCodeAnkit

This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。