![]() |
Summary | Discourse ActivityPub allows you to publish Discourse posts via ActivityPub so they can be read on services that support ActivityPub such as Mastodon. |
![]() |
Repository Link | GitHub - discourse/discourse-activity-pub: Adds ActivityPub support to Discourse. |
![]() |
Install Guide | How to install plugins in Discourse |
Features
Discourse ActivityPub currently allows you to establish a Discourse category as an ActivityPub “Actor”. This means that any other “Person” in the ActivityPub network (such as a Mastodon user) can “Follow” the category on their ActivityPub service.
Currently, the plugin will publish a “Note” from the first post of a new topic in a category where ActivityPub is enabled. Currently, replies to the post on Discourse are not published, and replies to the “Note” on other ActivityPub services are not imported into Discourse.
The current limitations on the plugin’s support of the full ActivityPub specification are there to reduce the complexity of building, testing and using the first version of the plugin. They may be progressively lifted depending on the real-world experience with the first version of the plugin.
Configuration
First, select a category you wish to publish ActivityPub content from, such as an “Announcements” category. Go to the category “Settings” and scroll down until you see the “ActivityPub” section. Fill out the username and name settings according to their instructions.
Note that once you select a username for the Category it can’t be changed. However, you can change the “name”, which is used as a display name on services like Mastodon, as much as you like.
Next, check the “Enable ActivityPub in this category” setting and click on “Save”. You will notice the ActivityPub status label next to the “ActivityPub” settings title change once you save. It should look like this (if you mouse over it you’ll see the tooltip giving you more details)
The ActivityPub status label is there to let you know if new posts in the category will be published. If you disable ActivityPub in the category, disable the plugin, or take your site private, the status label will turn red indicating that new posts in the category will not be published via ActivityPub (and the text in the status label tooltip will tell you why). For example
Or, for example, if you enable the login required
site setting the label will indicate ActivityPub is no longer active, even if you have it enabled in that category
You can display the same ActivityPub status label in the composer for an ActivityPub category to act as a signal to those posting in the category that a Note from their post will be published via ActivityPub. Enable the “Show an ActivityPub status label in this category’s composer.” setting and you’ll see it (only when composing in an ActivityPub category).
You can also add an ActivityPub dropdown in the topic list for the ActivityPub category to let users know that the category has ActivityPub enabled and what its handle is by enabling the “Show an ActivityPub handle in this category’s topic list.” setting.
How to use it
Once ActivityPub is enabled in a category a Note from the first post of each new topic in that category will be published via ActivityPub. A Note is not necessarily the entire post.
Posting
When you compose a new topic in an ActivityPub category you can explicitly indicate which text you want to form the ActivityPub Note by wrapping it in [note][/note]
tags
If you don’t use [note][/note]
tags the first 500 characters of the post will become the note (you can configure that limit, see below).
Once the post is posted the ActivityPub note will be published 5 minutes later (you can configure the time, see below). If you’re staff you can see exactly when it will be published by hovering your mouse over the ActivityPub icon in the top right corner of the post. Currently, only staff (admins or moderators) can see this icon.
You can edit the part of the post that will become the Note before it is published by editing the post. If you delete the post, or move the post outside of the ActivityPub category, the Note won’t be published.
Once the Note is published the ActivityPub icon in the top right corner of the post will turn green and the tooltip will let you know exactly when it was published.
Editing
Once an ActivityPub Note is published you can’t edit the content of the Note, for example
However you can still edit any other content in the post that’s not part of the Note, for example
Deleting
If you delete a post with a published Note the published Note will also be deleted. This will be indicated in the ActivityPub post status icon:
This means that the Note will be deleted on the ActivityPub services it’s been published to. Currently, restoring the post will not restore the ActivityPub note. The ActivityPub post status icon will indicate this by remaining in its deleted state on the restored post.
Settings
You can configure the plugin using the plugin’s site settings. There are three settings in particular you may wish to change:
activity pub note excerpt maxlength
This sets the maximum length of the Note extracted from a post published via ActivityPub.
activity pub note link to forum
This enables or disables a link back to your forum at the end of the ActivityPub note. The text of this link is configurable in Admin > Customize > Text using the key discourse_activity_pub.object.note.link_to_forum
activity pub delivery delay minutes
This sets the delay, in minutes, between when you post in an ActivityPub category and when the Note from the post is published.
The other ActivityPub plugin site settings should be left as-is unless you understand what they do and why you want to change them.
Credits
This plugin is being developed with funding from Discourse and in close coordination with the Discourse team. (It’s not an official plugin yet, but interested hosted clients looking to test it out can reach out via email.)