angus
(Angus McLeod)
2024 年7 月 2 日 08:09
1
本主题涵盖了使用 Discourse ActivityPub 插件在 Discourse 中设置 ActivityPub Actor。如果您不确定这意味着什么,请先前往 Discourse ActivityPub 插件 主题。
下一步
This topic covers following an ActivityPub Actor in Discourse with the Discourse ActivityPub Plugin, and follows on from Setting up an ActivityPub Actor . If you’re not sure what this means, head on over to the Discourse ActivityPub Plugin topic first.
Instructions
To follow an ActivityPub Actor:
Set up an actor for the Category or Tag you want to do the following.
Get the “handle” of the Actor you want to follow (see below).
Go to the “Federation” tab in the topic list view of the Category …
说明
要创建 ActivityPub Actor:
转到 管理员 > 插件 > ActivityPub。
点击“添加 Actor”。
填写“添加 Actor”表单(设置将在下方解释)。
点击“保存 Actor”。
当您保存 Actor 时,来自联邦宇宙的其他 Actor 可以开始关注它。您可以通过切换“编辑 Actor”视图右侧的“启用”开关来禁用 Actor。
Actor 设置
用户名
这是 Actor 的 ActivityPub 句柄的第一部分,例如 announcements@meta.discourse.org 中的 announcements 是用户名。这将是远程 Discourse 实例上 Actor 的用户的基本用户名(如果该实例上的用户名已被占用,则会添加一个整数以确保唯一性)。
此属性对应于 ActivityPub 规范中的 preferredUsername。
目前,一旦设置,此项无法更改。如果 Mastodon 的此 PR 被合并,这将发生更改。
main ← angusmcleod:add_username_change_integration_test
opened 11:31AM - 18 May 24 UTC
See further https://socialhub.activitypub.rocks/t/changeable-usernames/830/13?u=… angus
名称
这是 Actor 的显示名称。它的使用方式将取决于其他服务如何实现它。在 Discourse 中,这将成为 Actor 的用户的“名称”。
可见性
这决定了 Actor 发布的内容是否具有“公共寻址 ”。除非您知道自己在做什么,否则应将其保留为公共。
这与 Mastodon 上的“公开”和“私有”(仅限关注者)帖子之间的区别基本相同。
帖子对象类型
这决定了 Actor 是将帖子发布为 Note 还是 Article。除非您知道自己在做什么,否则应将其保留为 Note。
Mastodon 仅在收到 Article 时发布原始帖子的链接。
发布类型
完整主题
将发布与 Actor关联的主题中的所有帖子,并将联邦宇宙中的所有回复转换为帖子。
第一篇帖子
仅发布与 Actor关联的主题中的第一篇帖子,并且不会将来自联邦宇宙的回复转换为帖子。
3 个赞
LaF0rge
(Harald Welte)
2024 年12 月 18 日 12:48
2
我刚刚将插件添加到了 discourse 3.3.2 安装中。我可以在插件列表、插件首选项等中看到该插件。
但是,在尝试添加参与者时,我只能为标签(我不需要)添加参与者,而不能为类别添加。这看起来像是某种 UI / 浏览器端 JavaScript 问题(我不是 Web 开发人员)。
我在 Debian 上尝试了 Firefox 和 Chromium,它们都显示相同的行为
为标签添加参与者按预期工作
为类别添加参与者是不可能的,因为在“选择模型/类别”选项的右侧从未渲染过用于类别的选择框。
当我选择“选择模型”按钮中的“类别”时,我在开发者控制台中收到以下错误:
runtime.js:912 Uncaught TypeError: Cannot read properties of null (reading 'firstNode')
at ue.firstNode (runtime.js:912:1)
at T (runtime.js:241:1)
at ue.reset (runtime.js:983:1)
at ae.resume (runtime.js:686:1)
at Ut.handleException (runtime.js:4309:1)
at Vt.handleException (runtime.js:4521:1)
at Dt.throw (runtime.js:4260:1)
at $e.evaluate (runtime.js:2088:1)
at Dt._execute (runtime.js:4247:1)
at Dt.execute (runtime.js:4232:1)
at qt.rerender (runtime.js:4547:1)
at hr.render (index.js:4674:1)
at index.js:4934:1
at Nt (runtime.js:4080:1)
at gr._renderRoots (index.js:4916:1)
at gr._renderRootsTransaction (index.js:4960:1)
at gr._revalidate (index.js:4992:1)
at invoke (backburner.js.js:280:1)
at h.flush (backburner.js.js:197:1)
at p.flush (backburner.js.js:358:1)
at B._end (backburner.js.js:798:1)
at B.end (backburner.js.js:589:1)
at B._run (backburner.js.js:842:1)
at B._join (backburner.js.js:819:1)
at B.join (backburner.js.js:629:1)
at l (index.js:81:1)
at u.onHover (index.js:118:1)
at e.handleMouseEnter (select-kit-row.js:83:22)
通常,Meta 只为最新的稳定版或通过测试的版本提供支持——你为什么落后了?值得升级到最新版本并重试。
LaF0rge
(Harald Welte)
2024 年12 月 18 日 15:50
4
这是一个拼写错误,抱歉。我使用的是 3.3.2 版本。
1 个赞
angus
(Angus McLeod)
2024 年12 月 19 日 09:53
5
嘿 @LaF0rge ,此插件目前仅支持最新版本的 Discourse。详情请参阅:
1 个赞
LaF0rge
(Harald Welte)
2024 年12 月 19 日 12:46
6
您好 @angus - 感谢您的回复。遗憾的是,我不愿意将我们的生产环境升级到 beta 版本或当前的 git master。我想我将等到 discourse 发布新的稳定版本/标记。
顺便问一下:是否有任何结构化的信息可以表明插件的最低版本要求?我在该主题的初始帖子中没有看到,在 GitHub - discourse/discourse-activity-pub: Adds ActivityPub support to Discourse. 上也没有看到。
在其他软件项目/产品中,插件通常会指示版本兼容性。
考虑到该插件已经存在一年多了,我想另一个选择是降级到该插件的早期版本,大约在 3.3.2 是当前版本的时候?但是,在提交日志中,我没有立即看到任何关于 discourse 版本的引用。
angus
(Angus McLeod)
2024 年12 月 19 日 13:21
7
除非有特殊原因,否则建议使用 Discourse 的 tests-passed 分支。详情请参阅:
We recommend running tests-passed and updating when beta releases are available. This gives you the flexibility of updating when you want/need to.
Stable isn’t recommended except in select cases… like extensive customization (99% of the sites we host aren’t in this category). There are months between stable releases, and we only backport critical or security related bugs… so if there’s a minor bug in stable you may have to live with it for quite a while.
There’s some more relevant discussion h…
此外,您可以假定带有 experimental 标签的插件或自定义(如 ActivityPub 插件)仅在最新版本的 Discourse 上才能可靠运行。
更具体地说,关于您对版本管理的隐含问题,在 Discourse 插件中,这通过 .discourse-compatibility 文件来处理,您可以在此处阅读相关信息:
Hey everyone , I just merged a new feature that will help plugins and themes pin certain versions when installed on older Discourse instances.
You can now include a .discourse-compatibility file at the root of a plugin or theme repository, that designates what to checkout when installing on older Discourse versions.
Rationale
It sucks to remember which plugins and themes are compatible with which Discourse versions. As an admin, it should be possible to easily scan those changes and fi…
在此处查看 ActivityPub 插件的兼容性文件:
由于 ActivityPub 插件仍处于 experimental 阶段,因此确保向后兼容性并非重点,但我将在下周初调查为此文件添加明确的 3.3.2 支持。
但如上所述,除非您有充分理由不这样做,否则我建议使用 tests-passed。
3 个赞
angus
(Angus McLeod)
2024 年12 月 20 日 12:30
8
@LaF0rge 我刚看了这个。
该插件无需添加明确的 3.3.2 支持,因为它已经在兼容性文件中包含了此支持。
< 3.4.0.beta1-dev: 3a6512d0560211b93f022a27ed7276024d0020dc
如果您使用的是标准的 Discourse 3.3.2 安装,那么您将自动使用该插件的提交 3a6512d0560211b93f022a27ed7276024d0020dc,其中类别下拉菜单可以正常工作。请参阅:
LaF0rge
(Harald Welte)
2025 年1 月 6 日 13:37
9
感谢您提供的其他输入。今天早些时候,我尝试使用插件提交 3a6512d0560211b93f022a27ed7276024d0020dc 配合我已升级到 3.3.3 的 discourse 进行了另一次尝试,但最终进入了一个状态,即所有 HTTP 请求都返回了 Completed 500 Internal Server Error in 42ms (ActiveRecord: 0.0ms | Allocations: 16860),无论 URL 是什么。production.log 中没有任何内容,标准输出/错误中也没有记录任何错误,passenger.3000.log 中也没有。从插件目录中删除插件 + 重启解决了问题。这个问题可以多次重现。
目前我放弃了。尝试使用 ActivityPub 集成是一个不错的想法,但我想它还没有达到可以做任何有用的事情的水平,不像我成功安装过的其他插件。毕竟,它不是一个关键要求,只是一个“锦上添花”的功能。
angus
(Angus McLeod)
2025 年1 月 6 日 14:19
10
如果您手动尝试将任何插件的特定提交与 Discourse 的特定版本进行匹配,那很可能不会有好结果。我建议您考虑使用 Discourse 的标准安装。这样可以减少您的开销,并能够毫无问题地使用此插件和其他插件。
LaF0rge
(Harald Welte)
2025 年1 月 6 日 15:51
11
我明白你的意思——但我不会偏离安装和运行已标记/已发布版本的软件。就 Discourse 而言,据我目前所知,是 3.3.3 版本。
我发现使用非已标记版本运行生产系统非常不舒服和令人不安。你可以说我老派,但我自 20 世纪 90 年代中期以来一直成功地运行(和开发)IT 系统。
我尊重你和/或官方 Discourse 开发者社区有不同的态度/方法。我们意见不合。尽管如此,还是感谢你迄今为止的帮助!
1 个赞