Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • funkwhale funkwhale
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 393
    • Issues 393
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • funkwhale
  • funkwhalefunkwhale
  • Merge requests
  • !1806

Allowing to follow entire instances / domains

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open petitminion requested to merge petitminion/funkwhale-petitminion:762-domain_follow into develop May 27, 2022
  • Overview 10
  • Commits 13
  • Pipelines 26
  • Changes 30

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.

closes #762 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)
  • 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 from Domain to Library

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.
Edited Jul 26, 2022 by petitminion
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: 762-domain_follow