# ActivityPub 插件

**URL:** https://meta.discourse.org/t/activitypub-plugin/266794
**Category:** Plugin
**Tags:** experimental, activitypub
**Created:** [2023年五月31日 17:21 UTC](https://meta.discourse.org/t/activitypub-plugin/266794 "2023-05-31T17:21:52Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [2023年七月14日 12:21 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/45 "2023-07-14T12:21:40Z")

</div>

我刚刚在我的测试站点上部署了您的 `add_update_support_to_first_post_only` 分支，并成功地端到端地完成了功能测试；包括创建、编辑和删除，以及我安装的各种插件。谢谢！🎉

像这样的社区测试有价值吗？

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年七月14日 12:49 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/46 "2023-07-14T12:49:15Z")

</div>

太好了！

> [@mcdanlj](#):
>
> 像这样的社区测试有价值吗？

我不一定建议将此作为所有未合并 PR 的常规做法，因为它存在一些风险，而且我无法为未合并 PR 上出现的任何问题提供支持（PR 审查过程起着重要作用），但如果您发现某个问题确实有用，那么如果您能承受该风险，我不会告诉您停止，例如，您正在开发或暂存站点上部署它们。我不建议您在生产环境中部署它们。

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [2023年七月14日 14:56 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/47 "2023-07-14T14:56:08Z")

</div>

当然可以，如果它坏了_我将保留所有碎片。_ 也称为从主站点的最近备份重新加载我的测试站点的数据库。😁 另外，我明白 PR 会收到强制推送更新等。

如果我的测试分散了注意力，请随时告诉我，我不会介意。我的目标是支持这项工作，而不是阻碍开发。

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [2023年七月20日 07:22 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/48 "2023-07-20T07:22:18Z")

</div>

也许你可以在那个帖子里加上复选框，这样我们就可以跟踪进度了？

路线图看起来很棒，我很高兴这个项目在进行中。向你和 [Pavilion](https://pavilion.tech/) 团队致敬，感谢你们的构建，也感谢 Discourse [@team](https://meta.discourse.org/groups/team) 的委托和使其官方化！

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年七月20日 09:55 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/49 "2023-07-20T09:55:18Z")

</div>

> [@hellekin](#):
>
> 也许你可以在那个帖子里添加复选框，以便我们跟踪进度？

已完成。勾选表示该功能已合并。下一个是

> <https://github.com/discourse/discourse-activity-pub/pull/19>
>
> Adds the following
> \- Category setting to set default audience targeting (public… or private (followers only)) for that category.
> \- Audience selector to AP status badge in composer.
> \- If status badge is not shown posts will always be targeted at category default.
> \- Default for category setting is Public.
> \- Server default for relevant field is Private to accommodate both existing usage and also to take a more conservative approach if for some reason the setting is not filled as expected (i.e. an error). 
> 
> \<img width="728" alt="Screenshot at Jul 20 10-30-45" src="https://github.com/discourse/discourse-activity-pub/assets/5931623/db1242bc-f530-446c-879d-c882ae01f7a8"\>
> 
> In composer
> \<img width="541" alt="Screenshot 2023-07-20 at 10 29 48" src="https://github.com/discourse/discourse-activity-pub/assets/5931623/8f28fb80-13e2-4bef-ac3c-b0dcbb6fd473"\>

> [@hellekin](#):
>
> 向你和 [Pavilion](https://pavilion.tech/) 团队致敬！

我只想强调，这是一个 [Discourse.org](http://Discourse.org) 插件，功劳应该归于他们，因为是他们指定、委托、发布和支持了这个插件。这不是一个 Pavilion 插件。我们只是在构建它。

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [2023年七月20日 22:11 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/50 "2023-07-20T22:11:39Z")

</div>

重读了这些内容，我想再次讨论一下我之前提到的子类别问题。@mattdm，您是否考虑为 Fedora Discussion 启用此功能？我认为，分别关注 Fedora Discussion 中的每个子类别可能会带来糟糕的用户体验？

我的网站有 8 个顶级类别需要联合，外加 21 个_公开_子类别。

我希望用户能够订阅顶级类别并获取_公开_子类别的内容，但不要联合那些有查看限制的子类别（例如，我的网站上“Staff”类别是公开父类别的私有子类别）。

我看到了两种方法：

1. 一个配置选项，说明“也联合子类别”（应用可见性限制）
2. 在类别配置中重新使用 Actor 的能力，这样我就可以将同一个 Actor 应用于父类别和公开子类别

第二个选项看起来是更好的选择；更灵活、更明确，而且如果我理解正确的话，可能与数据模型更匹配。

我想，另一种选择是构建一个（或多个）机器人来自动在我的 Discourse 上提升一组 Actor 的所有帖子。这样我也可以实现一个 `@all@...`。

🤔

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年七月21日 15:17 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/51 "2023-07-21T15:17:30Z")

</div>

再次感谢您提出这个问题。我会查看一下，与内部人员讨论后告知您。

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [2023年七月25日 01:51 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/52 "2023-07-25T01:51:22Z")

</div>

我越想这件事，就越喜欢让 Actor 与类别一一对应，这样用户就可以只关注他们想要的类别，并且还可以创建一个机器人，自动推广由一组 Actor（例如，一个类别及其所有公共子类别，甚至所有公共子类别）发布的帖子。最大的灵活性，无需您额外工作。

在思考这个问题时，我回想起 `@Stark9837@techhub.social` 写了一个机器人 `@3dprinting@techhub.social`，该机器人会自动推广它找到的所有包含 `#3dprinting` 标签的帖子，以创建一个类似群组的东西。我询问了有关该机器人的信息，并得到了以下回复：

> **[Stark (@Stark9837@techhub.social)](https://techhub.social/@Stark9837/110766183439271381)**
>
> @mcdanlj@social.makerforums.info @3dprinting 
> 
> Currently, I am working on it as a package that can be used by other developers or just simply be confugrable with #YAML files.
> 
> Also, I am investigating having multiple bots in 1. Thus, only a single...

因此，当它发布时，它可能正好能做我想要的。

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [2023年七月25日 05:02 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/53 "2023-07-25T05:02:44Z")

</div>

- 添加标签演员会很棒，并且
- 当 #page-publishing 处于活动状态时，关注新发布的页面会很有用。

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年七月25日 15:26 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/54 "2023-07-25T15:26:08Z")

</div>

@mcdanlj 帖子按主题（即论坛内容）分组以分类方式进行联合的方式，正是 Felix 在 [FEP-1b12](https://codeberg.org/fediverse/fep/src/branch/main/fep/1b12/fep-1b12.md) 中概述的那样。我从头开始对规范、架构和当前用法（特别是 Mastodon）进行了自己的审查，得出了与他在那里（以及 Lemmy）得出的相同结论。基本上，类别 Actor 将会向其关注者“宣布”（在 Mastodon 中为“boost”）其类别中的活动。这将是此插件中“完整主题”模式的工作方式。我目前正在处理此项目。

> [@angus](#):
>
> 支持接受回复远程帖子中的 Note 的活动，以及发布回复 Discourse 中制作的 Note 的活动。  
> …  
> 添加一个类别设置，在仅第一帖（当前）和支持回复活动的“完整主题”之间切换。

> [@hellekin](#):
>
> - 标签 Actor 会很棒，并且
> - 当 #page-publishing 激活时，关注新发布的页面会很有用。

这些将不属于第二阶段，但可以在后续阶段添加。

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [2023年七月25日 18:43 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/55 "2023-07-25T18:43:43Z")

</div>

> [@mcdanlj](#):
>
> 重读了这段话，我想看看我之前提到的子类别问题。@mattdm，你打算为 Fedora Discussion 启用这个功能吗？我认为，用户需要单独关注 Fedora Discussion 的每个子类别，这可能会带来糟糕的用户体验？

仔细考虑后，是的。起初，我认为我们只会将其用于公告（结合隐藏的草稿类别中的计划发布功能）。它也可能对我们的社交媒体团队有用，用于起草/协调/安排 Mastodon 帖子。

我认为拥有更广泛的功能会令人兴奋，至少可以关注\_所有内容\_——甚至可能参与其中。但这将是遥远以后的事情了。

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年七月26日 09:32 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/56 "2023-07-26T09:32:07Z")

</div>

> [@mattdm](#):
>
> 仔细想想，是的。起初，我认为我们只会将其用于公告（与隐藏类别中用于草稿的计划发布功能结合使用）。我们的社交媒体团队也可能发现它有助于起草/协调/安排 Mastodon 帖子。

该插件的当前功能集非常适合此用例。

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年七月29日 10:44 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/57 "2023-07-29T10:44:18Z")

</div>

该插件现在支持可见性。您现在可以公开笔记（也称为 Mastodon 状态）。

> <https://github.com/discourse/discourse-activity-pub/pull/19>
>
> Adds the following
> \- Category setting to set default audience targeting (public… or private (followers only)) for that category.
> \- Audience selector to AP status badge in composer.
> \- If status badge is not shown posts will always be targeted at category default.
> \- Default for category setting is Public.
> \- Server default for relevant field is Private to accommodate both existing usage and also to take a more conservative approach if for some reason the setting is not filled as expected (i.e. an error). 
> 
> \<img width="728" alt="Screenshot at Jul 20 10-30-45" src="https://github.com/discourse/discourse-activity-pub/assets/5931623/db1242bc-f530-446c-879d-c882ae01f7a8"\>
> 
> In composer
> \<img width="541" alt="Screenshot 2023-07-20 at 10 29 48" src="https://github.com/discourse/discourse-activity-pub/assets/5931623/8f28fb80-13e2-4bef-ac3c-b0dcbb6fd473"\>

接下来是添加文章支持（用于长篇内容）和改进内容解析。

> <https://github.com/discourse/discourse-activity-pub/pull/21>
>
> @pmusaraj I decided to combine both publishing posts as Articles and the improve…ments to Note parsing into a single PR as they concern similar code, can be considered in isolation, and would create more merge conflicts if separated. So this one concerns both
> 
> \> Improve Note content parsing. Handle special characters (perhaps use a different parser). \[See further\](https://meta.discourse.org/t/activitypub-plugin/266794/6).
> 
> and
> 
> \> Support use of \[Article\](https://www.w3.org/TR/activitystreams-vocabulary/#types) instead of \[Note\](https://www.w3.org/TR/activitystreams-vocabulary/#types) as the Object for a post. Category level setting.
> 
> The next PR will be for Full Topic support (it's a big one). Almost finished that!

之后将是完整主题支持，这几乎已经准备好了。这里有一个小预览

https://www.loom.com/embed/7496bbff6ebe4701a2a4f2be6115391a?sid=520e3351-ac0e-4828-be03-598c1d93d255

（是的，它与 [FEP-1b12](https://codeberg.org/fediverse/fep/src/branch/main/fep/1b12/fep-1b12.md) 兼容）

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年八月1日 05:54 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/58 "2023-08-01T05:54:41Z")

</div>

一个帖子已被合并到现有主题：[使用 ActivityPub 插件](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/7)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年七月30日 03:13 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/59 "2023-07-30T03:13:41Z")

</div>

您问题的简短答案是：

1. 默认且支持最好的 ActivityPub 内容是 HTML（[参见更多](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-content)）。未来我们可能会为 Notes 和 Articles 添加某种形式的 Markdown 支持。

2. 您的示例似乎还有其他问题。此插件发送的是 HTML（当前是，这次更新也是）。您的屏幕截图显示的是未处理的 Markdown。

3. Article 支持在其[提交消息](https://github.com/discourse/discourse-activity-pub/pull/21/commits/61b107bfe39ecdd64171a298d29cd79dd5442b55)中有所说明。

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [2023年七月30日 11:30 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/60 "2023-07-30T11:30:23Z")

</div>

据我所知，Mastodon Glitch 也通过在服务器端将其渲染为 HTML 来支持 markdown。这正是我所希望的。

现在我知道它应该发送 HTML，似乎是另一个插件干扰了我。我会测试一下。谢谢！

---

<div class="post-metadata">

### Author: ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)
#### Post date: [2023年七月30日 12:02 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/61 "2023-07-30T12:02:06Z")

</div>

> [@angus](#):
>
> 我想强调的是，这是一个 [Discourse.org](http://Discourse.org) 插件，应该归功于他们指定、委托、发布和支持它。这不是一个 Pavilion 插件。我们只是在构建它。

只是好奇为什么没有标记为“官方”？

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2023年七月30日 12:16 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/62 "2023-07-30T12:16:35Z")

</div>

也许是因为它默认尚未对托管客户提供

> [@angus](#):
>
> （它还不是一个官方插件，但有兴趣的托管客户如果想试用，可以通过电子邮件联系。）

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2023年七月30日 12:30 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/63 "2023-07-30T12:30:57Z")

</div>

右键，该插件并非官方插件，因为它仍处于相当早期的开发阶段。托管客户可以联系并咨询使用事宜。

CDCK 构建了许多插件，并非所有插件都标有“官方”标识，我们构建的一些插件是实验性的、小众的等。我认为最终我们会将此插件标记为官方。

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年八月1日 05:51 UTC](https://meta.discourse.org/t/activitypub-plugin/266794/64 "2023-08-01T05:51:54Z")

</div>

6 个帖子被拆分为新主题：“[使用 ActivityPub 插件](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437)”

[上一頁](https://meta.discourse.org/t/activitypub-plugin/266794.md?page=2)

[下一頁](https://meta.discourse.org/t/activitypub-plugin/266794.md?page=4)
