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

GitHub

Tìm hiểu cách cấu hình LibreChat để sử dụng GitHub cho xác thực người dùng.

Tạo một GitHub Application

image

Cấu hình ứng dụng GitHub

  • Đặt cho nó một GitHub App name và thiết lập Homepage URL của bạn
    • Ví dụ cho localhost: http://localhost:3080
    • Ví dụ cho một tên miền: https://example.com

image

  • Thêm một Callback URL hợp lệ:
    • Ví dụ cho localhost: http://localhost:3080/oauth/github/callback
    • Ví dụ cho một tên miền: https://example.com/oauth/github/callback

image

  • Bỏ chọn hộp có nhãn Active trong phần Webhook

image

  • Cuộn xuống phần Account permissions và đặt Email addresses thành Access: Read-only

image

image

  • Nhấp vào Create GitHub App

image

Cấu hình .env

  • Nhấp vào Generate a new client secret

image

  • Sao chép Client IDClient Secret vào tệp .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
  • Lưu tệp .env

Lưu ý: Nếu sử dụng Docker, hãy chạy docker compose up -d để áp dụng các thay đổi cấu hình trong .env

Hướng dẫn này thế nào?