Gitee Login Plugin

This plugin allows users to log in to your Discourse forum using Gitee OAuth2.

Installation

  • Clone the code into the plugins directory /var/www/discourse/plugins
    docker exec -it discourse-web-1 bash
    cd /var/www/discourse/plugins
    git clone https://github.com/xuxiaowei-com-cn/discourse-gitee-login.git
    
  • Restart the container
    docker restart discourse-web-1
    

Configuration

  1. Create a new OAuth application on Gitee:

    • Visit Gitee OAuth Applications
    • Click “Create Application”
    • Fill in the required fields:
      • Application Name: Your forum name
      • Application Description: Your forum description
      • Application Homepage: Your forum URL
      • Authorized Redirect URI: https://your-forum-url/auth/gitee/callback (Replace your-forum-url with your forum domain)
    • Click “Create Application”
  2. Copy the Client ID and Client Secret from the Gitee application page.

  3. In your Discourse Admin Panel:

    • Go to SettingsPluginsGitee Login
    • Enable the gitee_login_enabled setting
    • Enter the Client ID and Client Secret you copied from Gitee
    • Customize gitee_login_button_title as needed
    • Click “Save Changes”


Usage

Once configured, users will see a “Log in with Gitee” button on the login page. They can click this button to authenticate with their Gitee account and log in to your forum.