💬
Discourse
A Discourse plugin to enable Sign-In with Ethereum as an authentication method.

Overview

Discourse is an open-source discussion platform used for most crypto governances and projects to discuss proposals, updates, and research. The following is a quick guide on how to add Sign-In with Ethereum to your existing Discourse.
Note
This guide is currently compatible with Discourse's official distribution. The discussion about this issues with other builds can be followed here.
The Sign-In with Ethereum plugin still requires users to enter an email to associate with their accounts after authenticating for the first time. If the user owns an ENS address, it will be the default selected username. Once an email address is associated, users can then sign in using the SIWE option at any time.

Enabling the Plugin

GitHub - spruceid/discourse-siwe-auth: Discourse plugin for SIWE authentication
GitHub
To install and enable the plugin on your self-hosted Discourse use the following method:
  • Access your container’s app.yml file (present in /var/discourse/containers/)
1
cd /var/discourse
2
nano containers/app.yml
Copied!
  • Add the plugin’s repository URL to your container’s app.yml file:
app.yml
1
hooks:
2
after_code:
3
- exec:
4
cd: $home/plugins
5
cmd:
6
- sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git
7
- sudo -E -u discourse git clone https://github.com/spruceid/discourse-siwe-auth.git
Copied!
  • Follow the existing format of the docker_manager.git line; if it does not contain sudo -E -u discourse then insert - git clone https://github.com/spruceid/discourse-siwe-auth.git.
  • Rebuild the container:
1
cd /var/discourse
2
./launcher rebuild app
Copied!
To disable it either remove the plugin or uncheck discourse siwe enabled at (Admin Settings -> Plugins -> discourse-siwe -> discourse siwe enabled ).
Accessing plugin settings.
Enable plugin at settings.

Enable WalletConnect

WalletConnect support can be provided via Infura. First, you need to create a new Infura project in order to receive a new Infura project ID. Then go to the settings (same section as before) and paste the ID in the specified location and click on the checkmark.
Field to insert the Infura ID.

Custom JSON RPC Endpoints

As an alternative, you can configure the WalletConnect instance with a custom JSON RPC endpoint, as shown below:
Doing so will supersede the Infura ID configuration option for WalletConnect. Other uses of Infura won't be affected.

Edit the message statement

By default a statement is added to the signing message: Sign-in to Discourse via Ethereum. To edit this statement, access the settings (same as before) and update it.
Field related to the message statement.