Draft: Allowing to follow entire instances / domains
This is ready for review before launching tests on the real internet between devs.
This need API V2
To test :
curl --user y:y -H "Content-Type: application/json" -X POST "https://node1.funkwhale.test/api/v1/federation/follows/domain" -d '{"target":"node2.funkwhale.test"}'
UUID=$(curl --user y:y -H "Content-Type: application/json" "https://node1.funkwhale.test/api/v1/federation/follows/domain" | jq -r '.results[0].uuid')
curl --user y:y -H "Content-Type: application/json" -X DELETE "https://node1.funkwhale.test/api/v1/federation/follows/domain/$UUID"
part of funkwhale&7
close #1809
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) -
add test to check if remote instance has its api open. If not cancel the domain follow request -
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 :
- "Users could choose a new privacy setting for Libraries: "Share on everyone on this instance, and accept to be shared by the Instance"" do we want this from #762
- For now every actor can follow a domain : limit to moderators ?
- implement a domain scan like LibraryScan ? Can be usefull if we do not receive an activity from remote.
Edited by petitminion