Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

GitHub

了解如何配置 LibreChat 以使用 GitHub 进行用户身份验证。

创建 GitHub 应用程序

image

GitHub 应用程序配置

  • 为其指定一个 GitHub App name 并设置您的 Homepage URL
    • localhost 示例:http://localhost:3080
    • 域名示例:https://example.com

image

  • 添加一个有效的 Callback URL
    • localhost 示例:http://localhost:3080/oauth/github/callback
    • 域名示例:https://example.com/oauth/github/callback

image

  • 取消勾选 Webhook 部分中标记为 Active 的复选框

image

  • 向下滚动至 Account permissions,并将 Email addresses 设置为 Access: Read-only

image

image

  • 点击 Create GitHub App

image

.env 配置

  • 点击 Generate a new client secret

image

  • Client IDClient Secret 复制到 .env 文件中

image

DOMAIN_CLIENT=https://your-domain.com # use http://localhost:3080 if not using a custom domain
DOMAIN_SERVER=https://your-domain.com # use http://localhost:3080 if not using a custom domain
 
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret
GITHUB_CALLBACK_URL=/oauth/github/callback
 
# GitHub Enterprise (optional)
# Uncomment and configure the following if you are using GitHub Enterprise for authentication
# GITHUB_ENTERPRISE_BASE_URL=https://your-ghe-instance.com
# GITHUB_ENTERPRISE_USER_AGENT=YourEnterpriseAppName
  • 保存 .env 文件

注意: 如果使用 Docker,请运行 docker compose up -d 以应用 .env 配置更改

这篇指南怎么样?