This is ready for review before launching tests on the real internet between devs.
This need API V2
I think it would be great to implement this before I start working on enabeling auto-discovery of content in the network.
To test : go to /manage/moderation/domains
add a domain implementing this mr, enter the domain detail page, click the follow button.
Technical description
I added a new DomainFollow model and the associated views. It store a relation to an actor and a domain.
I created activities : when a DomainFollow is created, the actor associated will follow all the public remote libraries. If a DomainFollow is deleted, all the libraryFollow associated with this follow will be deleted. This relation is created thanks to the new context_follow
attribute of the LibraryFollow
model. If it's set to Domain
then the library follow is related to the domaiFollow and its delete with the DomainFollow deletion.
to do :
-
api_serializer.DomainFollowSerializer and federation.DomainFollow -
api_views.DomainFollowViewSet -
bulk follow libraries -
create routes and activities to follow a domain -
create routes and activities to inform followers when a new library is created -
delete DomainFollow -
tests -
dispatch activities for libraries update to the domain followers, without creating libraries follows in remote host -
if library is updated from private to public, activity need to be send to domain follow -
if library is update from public to private, content is still available in remote instance.. (probably not related to this mr) -
Filter discovery and domain follows to funkwhale instance only ! (127 fw instances discovered out of 1030 fediverses instances bang bang o/) -
add test for discover and follow all domain tasks
front ( to do in another mr ? ) :
-
reject / accept domain follow manually ? Actually can be done through mrf policies? Need to be done in the frontend ? post to domainfollow will trigger update_follow. If its not implemented in the front we can delete accpet and reject methods of domainfollow view. -
Check if update_follow is Triggered when the mrf policies change : new test ? -
Check the button Domain follow. I only pasted the libray follow button and changed libray to domain ^^' -
for an actor, if the library is followed after the domain is follow, an error will occur (already folowed) -> Allow the frontend to update the follow to change follow_context
fromDomain
toLibrary
Questions :
- For now every actor can follow a domain : limit to moderators ?
- I do these optimisations in this mr or later ? :
- These optimisations do not follow activity pub standard, maybe we should only apply an exponential back-off strategy to avoid to much requests to remote servers ?
-
bulk dispacth unfollow : {"type": "Undo", "objectSSSSS": {"type": "Follow"}}, context={"follow": follow} -
actors_bulk_follow_library : -
bulk routes.outbox.dispatch( {"type": "Undo", "objectSSSSS": {"type": "Follow"}}, context ={"follow": follow} -
implement a domain scan like LibraryScan ? Can be usefull if we do not receive an activity from remote.