RGJ
(Richard - Communiteq)
2022 年7 月 4 日 17:57
1
|||
-|-|-|
| 摘要 | 在 Discourse 上启用以太坊登录
- | 原始存储库 | GitHub - spruceid/discourse-siwe-auth: Discourse plugin for SIWE authentication
| 工作存储库 | GitHub - communiteq/discourse-siwe-auth: Discourse plugin for SIWE authentication
| 安装指南 | 如何在 Discourse 中安装插件
功能
此插件可在 Discourse 上启用以太坊登录
配置
要求
一个自托管的 Discourse 论坛,或者由允许第三方插件的提供商托管,例如 Communiteq 。
注意
以太坊登录插件仍然要求用户在首次验证后输入电子邮件以关联其账户。如果用户拥有 ENS 地址,它将是默认选定的用户名。一旦关联了电子邮件地址,用户就可以随时使用 SIWE 选项登录。
启用插件
要在自托管的 Discourse 上安装和启用该插件,请使用以下
方法:访问您的容器的 app.yml 文件(位于 /var/discourse/containers/)
cd /var/discourse
nano containers/app.yml
将插件的存储库 URL 添加到您的容器的 app.yml 文件中:
hooks:
before_code: # <-- added
- exec: # <-- added
cmd: # <-- added
- gem install rubyzip # <-- added
after_code:
- exec:
cd: $home/plugins
cmd:
- sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git
- sudo -E -u discourse git clone https://github.com/spruceid/discourse-siwe-auth.git # <-- added
遵循 docker_manager.git 行的现有格式;如果它不包含 sudo -E -u discourse,则插入 - git clone https://github.com/spruceid/discourse-siwe-auth.git。
重建容器:
cd /var/discourse
./launcher rebuild app
要禁用它,可以删除插件,或在 (Admin Settings → Plugins → discourse-siwe → discourse siwe enabled) 中取消选中 discourse siwe enabled。
启用 WalletConnect
WalletConnect 支持可通过 Infura 提供。创建一个新的 Infura 项目以接收新的 Infura 项目 ID。然后转到设置(与之前相同),将 ID 粘贴到该位置,然后单击复选标记。
JSON RPC
或者,您可以使用 JSON RPC 端点配置 WalletConnect 实例,如下所示:
这样做将取代 WalletConnect 的 Infura ID 配置选项,其他 Infura ID 的使用不会受到影响。
编辑消息声明
默认情况下,会向消息添加声明:Sign-in to Discourse via Ethereum。要编辑此声明,请访问设置(与之前相同)并进行更新。
14 个赞
RGJ
(Richard - Communiteq)
2022 年7 月 4 日 17:58
2
MarcP
(MarcP)
2022 年7 月 2 日 23:25
3
在 GitHub 上找到了这个,似乎还在积极开发中。它似乎允许 web3 登录(登录钱包后仍需要电子邮件地址)。
Discourse plugin for SIWE authentication
然而,开发人员遇到了一个问题,该问题阻止了插件的安装和 Discourse 的后续引导。详细信息请参见下面的 issue。也许这是一个非常简单的问题,这里有人可以为开发人员提交一个 PR。
opened 05:01PM - 20 May 22 UTC
closed 03:52PM - 11 Jul 22 UTC
siwe-discourse
Using the latest docker image from Discourse we're seeing the error:
```
I, [… 2022-05-20T16:58:42.288275 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
ERROR: Error installing rbsecp256k1:
ERROR: Failed to build gem native extension.
current directory: /var/www/discourse/plugins/discourse-siwe-auth/gems/2.7.6/gems/rbsecp256k1-5.1.0/ext/rbsecp256k1
/usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/2.7.0 -r ./siteconf20220520-1530-cv5chg.rb extconf.rb
Downloading libsecp256k1.zip (100%)
```
Even after installing the required system-level dependencies of rbsecp256k1 our discourse server will not start. Our app.yml looks like:
```
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/spruceid/discourse-siwe-auth.git
```
Any assistance would be appreciated!
1 个赞
michaeld
(Michael - Communiteq)
2022 年7 月 3 日 19:21
4
让我来试试
解决方案在 Github issue 中。
3 个赞
MarcP
(MarcP)
2022 年7 月 3 日 19:24
5
太棒了,我现在就试试。希望这对开发者也有帮助
编辑:虽然看起来 gem 已经安装成功了,但我遇到了同样的错误:
version 2.3.0.
Successfully installed rubyzip-2.3.2
1 gem installed
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 777 exit 1>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
MarcP
(MarcP)
2022 年7 月 4 日 17:04
7
正在查看日志,发布我认为可能相关的内容。
@moderators 这个可以分一个主题吗?这个插件没有官方主题,我认为开发者也不在 meta 上。
I, [2022-07-04T16:43:46.394301 #1] INFO -- : cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
rake aborted!
Gem::ConflictError: 无法激活 eth-0.5.1,因为 openssl-3.0.0 与 openssl (~> 2.2) 冲突
我目前没有看到其他错误(或者我错过了,日志很长)。
1 个赞
MarcP
(MarcP)
2022 年7 月 4 日 17:26
9
我的建议是从这里拆分:
https://meta.discourse.org/t/web-3-0-features/203321/19?u=marcp
最合适的类别将是 Support 或 #plugins (我不确定……我们如何处理非 Meta 成员开发的插件?也许他会加入 Meta,或者有一天我们可以通过 GitHub 邀请他加入 Meta?)
编辑:
看起来这就是开发者,所以他在 Meta 上?@w4ll3
RGJ
(Richard - Communiteq)
2022 年7 月 4 日 18:01
10
3 个赞
michaeld
(Michael - Communiteq)
2022 年7 月 4 日 19:34
12
5 个赞
虽然在官方论坛上有点晚了,但大家好——我是 Spruce 团队的 Rocco。
再次感谢 @michaeld 提供的修复,问题解决了,我们这边也更新了文档。也感谢你提出这个问题——我们仍在积极开发/维护与 Sign-In with Ethereum 相关的内容。
我还想问一下——有没有可能最终将其变成一个官方支持的插件 ——我们很喜欢 Discourse,并希望弄清楚如何将此功能扩展到非自托管的实例。
2 个赞
michaeld
(Michael - Communiteq)
2022 年7 月 20 日 06:12
14
为了清楚起见,Communiteq 在我们的托管托管计划中确实 支持此插件,它在 Professional 及更高版本中可用。
3 个赞
michaeld
(Michael - Communiteq)
2022 年7 月 20 日 16:30
16
没必要道歉!官方托管还没有(或者说还没有?)。我只是想强调我们对这些 web3 插件的承诺。
3 个赞
很遗憾,这不是官方支持的插件。
但非常感谢 Communiteq 的支持!任何有助于支持 Web3 用户的事情都非常棒。
我们正在努力通过各种方式支持“使用以太坊登录”的普及,而 Discourse 一直是我们列表中的首位,这就是为什么在我们标准化它 EIP-4361 后,我们创建了这个插件。我们一直在考虑的另一件事是还能添加什么功能——自定义 RPC 提供商是其中最早的功能之一。
3 个赞
Ashley87
(Ashley Zimmerman)
2022 年9 月 21 日 13:30
18
此插件对我不起作用,安装时出现问题,有人能分享替代方案或帮助解决这个问题吗?@michaeld @RGJ
Ashley87
(Ashley Zimmerman)
2022 年9 月 22 日 07:58
20
@RGJ 当我尝试安装此插件时,重建因以下错误而失败
您正在 /var/www/discourse/plugins/discourse-siwe-auth/plugin.rb 中指定 gem rbsecp256k1,但它不存在!
查找位置:/var/www/discourse/plugins/discourse-siwe-auth/gems/2.7.6/specifications/rbsecp256k1-5.1.0.gemspec