Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mastodon] Use ActivityPub outbox for Mastodon (et al.) feed #2756

Merged
merged 12 commits into from
Jun 20, 2022

Conversation

austinhuang0131
Copy link
Contributor

@austinhuang0131 austinhuang0131 commented May 27, 2022

Closes #2754.

In theory this supports all ActivityPub-compatible software1. This may warrant renaming the bridge (not included in PR).

Example: https://rssbridge.bus-hit.me/?action=display&bridge=Mastodon&canusername=%40austin%40ieji.de&format=Html

Footnotes

  1. I have tested it on Pleroma and Misskey instances. AFAIK it supports certain Pixelfed instances, but the official one has ActivityPub outbox disabled.

I mean I could rename it to ActivityPub bridge if the maintainer so pleases
@github-actions
Copy link

github-actions bot commented May 27, 2022

Pull request artifacts

file last change
Mastodon-current-context1 2022-06-20, 21:38:51
Mastodon-pr-context1 2022-06-20, 21:38:51

@yamanq
Copy link
Contributor

yamanq commented May 27, 2022

Thanks for this fast work! I will be able to review this in more detail in about a week or two. For now, I noticed a few things:

  • I think it would be fine to rename this to ActivityPubBridge and then have the Mastodon bridge inherit that class with minimal changes (NAME, DESCRIPTION) for compatibility with existing feeds.
  • boosts that fail to getContents are hidden from the feed. Could you instead create an item like this (not sure if I'm using the right terminology):
    title: Shared an unreachable status
    content: link to original status:
  • Could you add a note in the title text of the "Without Boosts" checkbox that this may connect to other federated instances that are boosted by the user?
  • There is this notice in the content: Notice: Undefined index: mediaType in /app/bridges/MastodonBridge.php on line 128

@austinhuang0131
Copy link
Contributor Author

austinhuang0131 commented May 27, 2022

I will wait till there is a consensus on renaming it. But wouldn't inheriting it add two duplicating feeds?

@dvikan
Copy link
Contributor

dvikan commented Jun 4, 2022

I refactored a bit. Don't use catch (Throwable), be more specific. Or check return values. I think it's fine to merge this.
In the future, please create a separate activitypub/webfinger client. I prefer we don't do inheritance.

@austinhuang0131
Copy link
Contributor Author

austinhuang0131 commented Jun 4, 2022

@dvikan To be honest I'd also prefer for it to be a separate bridge. The current client should be stripped of its options. So if we're on the same page on this then I'll rename the files a bit.

@yamanq
Copy link
Contributor

yamanq commented Jun 5, 2022

In that case, What about changing the NAME while keeping the file and class name as MastodonBridge to maintain backwards compatability? I am against changing the class name but I am fine if inheritance is not used.

@dvikan
Copy link
Contributor

dvikan commented Jun 18, 2022

I suggest to follow yamanq's advice.

Copy link
Contributor

@yamanq yamanq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@austinhuang0131
Copy link
Contributor Author

austinhuang0131 commented Jun 19, 2022

I have added a change to support instances with Secure Mode. This requires some setup by the host (which requires another PR to the docs), which can be summarized as:

  1. Get a RSA keypair
  2. Put up a static webfinger page, eg. https://rssbridge.bus-hit.me/.well-known/webfinger
  3. Put up a static actor page with your public key, eg. https://rssbridge.bus-hit.me/actor
  4. Let RSS-Bridge know your private key, and your public key ID, in config

For examples, try @admin@bgme.me or @admin@c.im

See also https://blog.joinmastodon.org/2018/06/how-to-implement-a-basic-activitypub-server/

@austinhuang0131 austinhuang0131 requested a review from yamanq June 19, 2022 21:23
Copy link
Contributor

@yamanq yamanq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please add those instructions to securing a token into the Bridge Specific section of the docs. Also, mention that this bridge can be configured in the DESCRIPTION.

To satisfy the linter, you can just create a newline without closing the string:

 	const DESCRIPTION = 'Returns recent statuses. Supports Mastodon, Pleroma and Misskey, among others.
Some Mastodon instances use Secure Mode which ...';

@yamanq yamanq merged commit e9b8a1f into RSS-Bridge:master Jun 20, 2022
@yamanq
Copy link
Contributor

yamanq commented Jun 20, 2022

Thanks for all your work on this!

senrou added a commit to senrou/rss-bridge that referenced this pull request Jun 21, 2022
[Mastodon] Use ActivityPub outbox for Mastodon (et al.) feed (RSS-Bridge#2756)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mastodon bridge: Show boosts and replies / Parse HTML instead of using official feed
3 participants