# Working with the ActivityPub Plugin

**URL:** https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437
**Category:** Development
**Tags:** activitypub
**Created:** [July 30, 2023, 12:43pm UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437 "2023-07-30T12:43:05Z")
**Posts on this page:** 11
**Page:** 1

<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: [July 30, 2023, 12:43pm UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/1 "2023-07-30T12:43:05Z")

</div>

> [@ActivityPub Plugin](https://meta.discourse.org/t/activitypub-plugin/266794/46):
>
> Nice! I wouldn’t necessarily advise it as a regular practice on all un-merged PRs as it does contain some risk and I can’t provide support for issues that crop up on umerged PRs (the PR review process plays an important role), but if you did find an issue that would be useful, so I’m not going to tell you to stop if you’re ok with that risk, e.g. you’re deploying them on a development or staging site. I wouldn’t advise you deploy them in production.

OK, I think that this is due to my testing leaving me with a broken database, and I should blow away my test site and start over.

[edit: useless detail removed to clean the thread]

My assumption is that this is something that would take a database migration to fix, that it’s due to me running pre-merged code for testing, and therefore I should blow away my test site and start over.

---

<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: [July 30, 2023, 1:15pm UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/2 "2023-07-30T13:15:39Z")

</div>

> [@mcdanlj](#):
>
> that it’s due to me running pre-merged code for testing, and therefore I should blow away my test site and start over.

Yes, that’s what I’d advise.

---

<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: [July 30, 2023, 8:30pm UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/3 "2023-07-30T20:30:46Z")

</div>

As I prepare to do this, I have a question.

On mastodon, there’s a [self-destruct](https://docs.joinmastodon.org/admin/tootctl/#self-destruct) command for a clean exit to avoid problems from server keys being remembered, that is recommended not only if you are closing down a server, but also if you are resetting an instance to the point where you are regenerating new keys. I don’t know whether you have run into this in your testing so far. It looks like Mastodon does a Delete Actor for each local Actor. I don’t see functionality to do this in the plugin, but I recognize that I might be missing it.

For the mastodon server I run, I think that `tootctl domains purge` should be enough, but I’ve also been testing with a vanilla mastodon “alt” where I don’t have admin. ☺

…I did the restore, and as it happens, event `tootctl domains purge` isn’t enough for me to be able to successfully follow after the restore. The posts just don’t show up on Mastodon at all. I have enabled verbose ActivityPub logs so that I can debug more, ~~but I haven’t found where to look to _find_ them.~~ and I have now found them in the rails logs, so I should be back to being able to investigate on my own.

---

<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: [July 31, 2023, 7:48am UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/4 "2023-07-31T07:48:22Z")

</div>

Hey @mcdanlj 🙂

> [@ActivityPub Plugin](https://meta.discourse.org/t/activitypub-plugin/266794/46):
>
> I wouldn’t necessarily advise it as a regular practice on all un-merged PRs as it does contain some risk and I can’t provide support for issues that crop up on umerged PRs

I should amend that to, I can’t provide support _in this topic_. If you’re having issues with Mastodon or Discourse development I can help you out in the right places (e.g. #Development), but I don’t want to clutter up this topic.

---

<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: [July 31, 2023, 12:21pm UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/5 "2023-07-31T12:21:48Z")

</div>

I’m sorry, I was thinking of the questions about self-destruct and where the verbose logs setting logged to as of general relevance. Trying to avoid asking for support here. 😬 Don’t mind if what looks like clutter is moved out of this topic.

---

<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: [July 31, 2023, 10:20pm UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/6 "2023-07-31T22:20:43Z")

</div>

Sorry for the noise. I installed the official plugin on my test site, then restored a backup of my production site that has never seen any form of the activitypub plugin, then set up activitypub, so it _should_ be pristine to the best of my knowledge.

In the future, if I’m testing a branch, I’ll:

- start with a clean released plugin, with all actors already created that I’m going to use
- take a backup
- install the branch
- test posts
- erase all the test posts
- revert to the clean released plugin
- restore the backup
- report any problems I found with the branch in the PR and not in this thread

That should keep a clean database and a clean thread.

* * *

Not showing my site icon was _not_ due to testing a branch of the plugin, nor was it a bug in the plugin. The logo doesn’t show in Mastodon for my posts because my `large_icon_url` is to an SVG and Mastodon apparently doesn’t handle SVG for actor icons. Unless there is some normal trivial path to downgrade to png for ActivityPub, probably nothing to do here.

---

<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: [July 29, 2023, 6:59pm UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/7 "2023-07-29T18:59:44Z")

</div>

I’m curious about what the intent is for the formatting and presentation for Note and Article.

## Note

For Note, when I post from Mastodon Glitch to vanilla Mastodon with markdown, it is displayed in Glitch as rich text, and in vanilla Mastodon as plain text with markdown stripped.

Writing this in Mastodon Glitch with Markdown enabled:

 ![Screenshot from 2023-07-29 14-42-25](https://global.discourse-cdn.com/meta/original/4X/1/9/2/19240b237a539593a650b260396011156556e763.png)

…shows this on Mastodon Glitch:

 ![Screenshot from 2023-07-29 14-43-30](https://global.discourse-cdn.com/meta/original/4X/7/6/a/76a61e14a618e6b561f6afd3b4bbe3ea4d71e5ff.png)

…and shows this on vanilla Mastodon:

 ![Screenshot from 2023-07-29 14-43-01](https://global.discourse-cdn.com/meta/original/4X/b/b/f/bbfa55aa2a1bed575ea90c6681bc264467b6fd77.png)

However, if I author rich text in Discourse with a Note:

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/3/a/33a6824fc4eb9192cc1d96ca8c6936513784288f.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/a/d/bad89fb9efa8857f951529340ad5ef2750e7edba.png)

…I get this in Mastodon Glitch:

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/5/d/75d5ca2ded36742864943998de57c9ace7db027b.png)

…and this in vanilla Mastodon:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/0/e/60e35e05102571b9588e9a1ea73ee0f35d5e5c2d.png)

…which looks just about the same.

When I use the [https://elk.zone](https://elk.zone) web client for that same post, it does include some newlines, but still has markdown font formatting wiped out:

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/f/e/9fe5fb3061a7ba38164bc59fab150ddb1d9ff7d0.png)

Most of the fediverse actually can handle markdown, so it would be good for it to carry across.

Also, I note that hashtags do not come across in Mastodon as hashtags.

## Article

For posting an Article, what do you expect to be displayed in Mastodon?

What I’m seeing on PR 21 is just the URL and a small onebox with not much text.

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/2/e/32eb9f0bd02e73bb996eda246766423486cc24e0.png)

I don’t know how much of that is on the Mastodon side; I haven’t set up, for example, a Firefish instance to compare.

---

<div class="post-metadata">

### Author: ![eisammy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eisammy/32/528804_2.png) [@eisammy](https://meta.discourse.org/u/eisammy)
#### Post date: [June 16, 2024, 7:09am UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/8 "2024-06-16T07:09:12Z")

</div>

This is weird to me I wish to that mastodon show to me my topic body its a thing to introduce?

---

<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: [June 17, 2024, 8:59am UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/9 "2024-06-17T08:59:57Z")

</div>

Hey guys, apologies for not following up here. There will be some dedicated #activitypub documentation coming soon.

> [@mcdanlj](#):
>
> I’m curious about what the intent is for the formatting and presentation for Note and Article.

For more detail on this please see

> **[Content formatting when federating out](https://socialhub.activitypub.rocks/t/content-formatting-when-federating-out/4150)**
>
> I’ve mentioned this to you privately before but it wasn’t particularly important at this time. … but it is now! 😅 When Discourse federates content out, it saves some simplified plaintext-first into content. Things like formatting and images are...

The plugin currently supports the following HTML tags (and their Discourse markdown equivalents), and will be adding `pre` support soon.

```plaintext
p a h1 h2 h3 h4 h5 ul ol li code blockquote em strong

```

> [@eisammy](#):
>
> This is weird to me I wish to that mastodon show to me my topic body its a thing to introduce?

What I think you’re referring to (but please correct me if I’m wrong) is that Mastodon currently does not display the `content` of and `Article`, but just a link to the original article. This is an issue with Mastodon which is the matter of some debate, see further:

> **[Article vs. Note (redux!) — summary of current implementations](https://socialhub.activitypub.rocks/t/article-vs-note-redux-summary-of-current-implementations/4242)**
>
> At the last ForumWG meeting, we discussed at length about Article vs. Note, and whether there was a desire to expand usage of as:Article. You can review those minutes here. One of the action items that came out was to collate the state of current...

Currently, if you want full content to be displayed in Mastodon, you have to have `Note` set as the Post object type on your actor.

 ![Screenshot 2024-06-17 at 10.59.32](https://global.discourse-cdn.com/meta/original/4X/e/a/2/ea261b5f7f063e4008028954543e931f2012af35.png)

---

<div class="post-metadata">

### Author: ![eisammy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eisammy/32/528804_2.png) [@eisammy](https://meta.discourse.org/u/eisammy)
#### Post date: [June 17, 2024, 6:17pm UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/10 "2024-06-17T18:17:01Z")

</div>

I’v using this way but let me show that

When an user create a post another instance with images for example I’m not receiving this body with images just txt and when I reply this topic in my own instance there are not image too

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/c/e/9ce641e5dcc103ebf0dc336d41a59731cd66a2af.png)  
 ![fa6503aa6e61a4b8873ea500743c5daa3f2e6cdc](https://global.discourse-cdn.com/meta/original/4X/d/d/f/ddfb36ad1dfdb051c211859a3905bbd2408dae21.jpeg)

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/2/4/e2460cee76aea2e0f77eea7e00c48e05e7f2037c.png)  
 ![1771e75e612b39adba9eef1f21c84b2d2d82912b](https://global.discourse-cdn.com/meta/original/4X/5/9/c/59c1e898a324ae163c1e096afe48a4109ef9abcd.jpeg)

---

<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: [June 20, 2024, 9:13am UTC](https://meta.discourse.org/t/working-with-the-activitypub-plugin/273437/11 "2024-06-20T09:13:34Z")

</div>

Can you please remove the sexist imagery?
