movary icon indicating copy to clipboard operation
movary copied to clipboard

ActivityPub Checklist

Open alifeee opened this issue 7 months ago • 10 comments

I said I'd do it. Here it is. This is a checklist for a "publish-only" ActivityPub client (i.e., an account that you can view, follow, and receive posts from — it cannot receive messages, create threads, or do anything much complicated)

https://github.com/leepeuker/movary/compare/main...add/activitypub

  • GET endpoints
    • [ ] ActivityPub (AP) Actor (e.g., /activitypub/users/) ("should" be pretty HTML or JSON based on Accept header) (e.g., https://ramblingreaders.org/user/alifeee/)
    • .well-known URLs
      • [x] webfinger (/.well-known/webfinger?resource=acct:<user>@<domain>)
        • [ ] add new "link" to user homepage (see mastodon response)
        • [ ] add "aliases" here to link to text/html user homepage (see mastodon response)
      • [x] hostmeta (.well-known/host-meta)
      • [x] nodeinfo meta (.well-known/nodeinfo)
      • [x] nodeinfo (/nodeinfo/2.1)
        • [ ] add "localPosts" (see http://nodeinfo.diaspora.software/ns/schema/2.1)
    • [x] AP Object for Movie (e.g., /activitypub/movies/ or /activitypub/users//movies/)
      • [ ] add attribute in "movie" object linking to "movies collection" see
      • [ ] add attribute in "movie" object linking to "plays collection"
    • [x] AP Activity/Object for Movie Watch (e.g., /activitypub/users//movies//plays/)
      • [ ] add attribute in "play" object linking to "plays collection" see
    • [x] AP Activity/Object for Watchlist Item (e.g., /activitypub/users//
    • [ ] AP following to list followers of this account (e.g., /activitypub/users//followers)
    • [ ] AP following to list following of this account (e.g., /activitypub/users//following) (shouldn't do anything as it's "view-only" at the moment)
    • [x] AP outbox for other servers to see "posts" (e.g., /activitypub/users//outbox)
  • POST endpoints
    • [ ] AP inbox for other servers to post messages (i.e., follow requests) (e.g., /activitypub/users//inbox)
  • database changes
    • [ ] potentially more columns for users (public/private key, "birth" date) movies/watchlist
    • [ ] new "notes" table for notes (reviews/watchlist additions) published about movies (linking to user by id?)
    • [ ] new "followers" table for ActivityPub (linking back to "users" table by ID?)
  • new worker functions
    • [ ] AP send message – POST message to follower inboxes
    • [ ] writer function to create an HTML message from a user, movie, play/watchlist, comment
  • misc
    • [ ] update nginx config to automatically add /activitypub/ if Accept: is application/ld+json or application/activity+json (see https://gitlab.com/edent/activity-bot/-/blob/main/README_nginx.md)
    • [ ] add util to cryptographically sign headers (AP requires this)
    • [ ] add Federation.md file
  • frontend
    • [ ] AP section on user profile (dashboard)
      • [ ] "follow on @@" or similar call-to-action
      • [ ] "N followers"
    • [ ] checkbox on "review" or "add to watchlist" for "post to fediverse?"
  • tests
    • Movary profile is viewable on Mastodon/AP clients
      • [ ] profile information
        • [ ] "posts" (notes)
        • [ ] followers
    • [ ] check endpoint permissions sync with profile permissions
    • [ ] check signed headers

alifeee avatar Sep 03 '25 15:09 alifeee

So to be clear, you'd be able to log, review and so on but not interact with the rest of the ActivityPub? It makes sense, maybe being able to interact with BookWyrm would be nice but not a high priority. This is a huge thing, thank you very much!

gary-host-laptop avatar Sep 03 '25 17:09 gary-host-laptop

So to be clear, you'd be able to log, review and so on but not interact with the rest of the ActivityPub? It makes sense, maybe being able to interact with BookWyrm would be nice but not a high priority. This is a huge thing, thank you very much!

effectively, from a Movary POV, not much will change (you will still just log and watchlist movies). but if the profile is public, it will be viewable and followable from other ActivityPub clients, yeah.

Bookwyrm does have a nice "feed" feature but… I don't use it, so I don't care to implement it (it also seems a lot more complex… — I should probably just look for an AP library anyway)

alifeee avatar Sep 03 '25 23:09 alifeee

see examples of other AP implementations here:

https://github.com/alifeee/activitypub-examples

alifeee avatar Sep 04 '25 00:09 alifeee

added 4 working activitypub routes, see branch https://github.com/leepeuker/movary/tree/add/activitypub

  • .well-known/host-meta
  • .well-known/webfinger
  • .well-known/nodeinfo
  • nodeinfo/2.1

also tried to add a development/activitypub.md file to the documentation, but can't figure out how to "reload" the documentation docker container to make it show. maybe I did something wrong here.

alifeee avatar Sep 04 '25 14:09 alifeee

links to keep:

  • https://github.com/w3c-social/activitystreams-validator
  • https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollection
  • https://socialhub.activitypub.rocks/t/modeling-a-movie-review-in-activitystreams/3822/5

new endpoints:

  • /activitypub/users/<user>
  • /activitypub/users/<user>/movies
  • /activitypub/users/<user>/movies?p=<page>
  • /activitypub/users/<user>/movies/<id>
  • (not properly) /activitypub/users/<user>/plays/<id>/<date>

to-do:

  • add birthdate to Actor object
  • add public key to Actor object
  • rename "movies" to "plays" or similar (maybe they should be separate — play could have an "object" of movie, and "movie" could have collection of plays of some kind)
  • separate out OrderedCollection code to be even more generic, to be usable in several places

alifeee avatar Sep 05 '25 19:09 alifeee

Interoperability with NeoDB?

crse avatar Sep 07 '25 18:09 crse

Interoperability with NeoDB?

hi @crse. there are not really enough words in your question for me to understand it enough to write a decent reply. thanks.

alifeee avatar Sep 08 '25 14:09 alifeee

NeoDB (https://github.com/neodb-social/neodb) is another TV/show tracker that already have support for ActivityPub. It would be cool that Movary interoperable with it :)

crse avatar Sep 08 '25 16:09 crse

Movary already has the ability to perform actions. "Adding ActivityPub (AP)" means that each of these will be turned into a AP note, published to a Movary AP account's followers, and be visible as an AP note on the account, effectively triggering actions A3 and A5 below. These Movary actions are:

  1. tag a film as played
  2. add a film to watchlist

Below, I list the parts of ActivityPub that I am implementing, where these acronyms mean:

  • SS – Server<->Server
  • CS – Client<->Server

A: implementing

  1. (SS) respond to follow request
  2. (SS) respond to request for profile information
  3. (SS) respond to request for list of notes
  4. (SS) respond to request for list of followers
  5. (SS) notify other servers of a new published note

B: not implementing:

  1. (SS) respond to any non-follow-request message (like/repost/reply)
  2. (CS) post new notes
  3. (CS) choose accounts to follow
  4. (CS) read notes from following accounts
  5. (CS) get notifications for follow requests/likes/reposts

In summary, you'll be able to:

  • using Mastodon, follow a Movary account and get updates when new films are played or added to watchlist

You will not be able to:

  • use Movary to follow ActivityPub accounts on other platforms on the Fediverse.

So, you would be able to use Mastodon to follow a Movary account and a NeoDB account… but there's no interoperability past that. Do you have any suggestions @crse ?

alifeee avatar Sep 09 '25 11:09 alifeee

(this last comment would be good for a Federation.md file)

alifeee avatar Sep 10 '25 09:09 alifeee

added a note to the description, but …

I am not working on this. I was happy with just adding Mastodon API access in https://github.com/leepeuker/movary/pull/706

alifeee avatar Nov 27 '25 00:11 alifeee