Support Person+Group actor #21
Labels
No labels
activitypub
bug
build
duplicate
enhancement
feeds
help wanted
invalid
new feature
question
style
webmentions
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
blacklight/madblog#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Group Actor for Threadiverse Compatibility
Status
Proposed
Context
Madblog currently publishes posts via a single Person actor. Threadiverse
platforms (Lemmy, kbin, Piefed) model communities as Group actors that
Announce (boost) content created by Person actors. When a remote user
follows a Lemmy community, they see
Announce{Create{Article}}activitiesfrom the Group in their timeline — this is the convention that all threadiverse
implementations rely on for content discovery.
Because Madblog publishes
Create{Article}directly from a Person, threadiverseinstances cannot natively follow and display the blog as a "community". Adding
Group actor support would make Madblog blogs interoperable with the threadiverse
ecosystem alongside the existing Mastodon-compatible flow.
Reference: https://activitypub.space/post/1503
Design
Actor model
Introduce an optional Group mode where the blog exposes two actors:
GroupPersonattributedTowhat remote users follow).
required — it exists so remote servers can dereference
attributedTo).Publishing flow
When Group mode is enabled, the publishing pipeline changes:
The inner
Create{Article}is wrapped in anAnnouncefrom the Group, whichis the pattern threadiverse implementations expect.
Endpoints
New endpoints required when Group mode is active:
GET /ap/authorThe existing
/ap/actorendpoint changes itstypefromPersontoGroup.All other endpoints (inbox, outbox, followers, following, webfinger) continue
to operate on the primary (Group) actor.
Configuration
New Madblog config options:
When
activitypub_actor_typeisPerson(or unset), behavior is unchanged.Migration path
Switching an existing blog from Person to Group is a breaking change for
existing followers — remote instances cache the actor type. Options:
Update{Actor}changing the type to Group.Mastodon handles this gracefully (re-fetches the actor), but some
implementations may not. A note in the changelog advising re-follow may
be necessary.
Changes Required
Pubby
Announce activity builder — Add
OutboxProcessor.build_announce_activity()that wraps a
Createactivity in anAnnouncefrom the configured actor.publish_objectsupport for Announce — ExtendActivityPubHandler.publish_object()to acceptactivity_type="Announce"(or a new
publish_announce()method).Secondary actor endpoint — The Flask/FastAPI/Tornado adapters need a way
to register a second read-only actor endpoint (e.g.
/ap/author) thatserves a minimal Person document. This could be a new
bind_secondary_actor()helper, or a list of actor configs inbind_activitypub().Actor document generation —
get_actor_document()already usesself.actor_typefrom config, so settingtype: Groupinactor_configis sufficient for the primary actor. The secondary Person actor needs its
own document builder (minimal:
id,type,preferredUsername,name,icon,url— no inbox/outbox/keys required since it doesn't processactivities).
Madblog
Config — Add
activitypub_actor_typeand author-related fields toConfigandinit_config().Actor setup (
_mixin.py) — Whenactivitypub_actor_type == "Group":type: "Group"in the primaryactor_config.Publishing flow (
_integration.py) — When Group mode is active:attributedToon the Article to the Person actor ID.Create{Article}, wrap it in anAnnouncefrom theGroup and deliver that instead.
Content negotiation (
_mixin.py) — The AP JSON response for/article/...should includeattributedTopointing to the Person actorwhen in Group mode.
Tests — New test class covering Group mode: actor document type,
announce wrapping, author endpoint, webfinger resolution.
Documentation — Update README with the new config options and a note
about threadiverse compatibility.
Open Questions
Should the Person actor have its own inbox? Threadiverse implementations
may attempt to deliver replies to the
attributedToactor. If the Personhas no inbox, those deliveries will fail silently. A lightweight option:
share the Group's inbox and route incoming activities appropriately.
Outbox representation — Should the Group's outbox contain the Announce
activities, the inner Create activities, or both? Lemmy puts Announces in
the community outbox.
Backwards compatibility — Should Madblog support a "hybrid" mode that
sends both
Create(for Mastodon) andAnnounce(for threadiverse)? Thiswould cause duplicate posts on Mastodon. The Announce-only approach is
correct — Mastodon already handles
Announce{Create{...}}from Groupactors properly.
Separate keypair for the Person actor? If the Person actor eventually
needs to sign requests (e.g. for inbox delivery), it would need its own
keypair. For the initial read-only implementation, the Group's key suffices.
References