# Activities for Federation Application?

**URL:** <https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002>\
**Category:** Server to Server\
**Created:** [August 22, 2021, 10:16pm UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002 "2021-08-22T22:16:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nutomic](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/nutomic/32/1055_2.png) [@nutomic](https://socialhub.activitypub.rocks/u/nutomic)\
**Post date:** [August 22, 2021, 10:16pm UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/1 "2021-08-22T22:16:16Z")

</div>

Most Lemmy instances currently use an allowlist based federation, so federation with unknown instances is denied. That is good for security, but makes it hard for instances and users to connect. So I want to implement a functionality where server A can send an activity to server B, asking “do you want to federate with me”, and B responds yes or no.

These two issues explain it in more detail:

> <https://github.com/LemmyNet/lemmy/issues/862>
>
> A common moderation problem on Mastodon is that there's always a reaction to bad… servers after federation has been ongoing for a while, potentially unnoticed. A way to solve this issue could be to implement a sort of "asking permission to federate" system, where a given server can request to federate with another, and that server's admins or moderators can accept or reject the federation request.
> 
> Before federation is accepted or rejected, the only content allowed could be a "Federate Server" message to the shared inbox, and after a "reject federate server" message is sent in reply, no further messages will be accepted. If an "accept federate server" is sent in reply, that could mean that any additional message may be exchanged between servers.
> 
> This could be further extended with "Undo Reject Federate Server" and "Undo Accept Federate Server" to bring federation between servers to the initial state.

> <https://github.com/LemmyNet/lemmy/issues/1487>
>
> Federating with a new instance is currently quite complicated if it uses an allo…wlist. It requires getting in contact with the admin through an external method (like Mastodon or Matrix), or making a new account on the Lemmy instance, and asking to federate. Then both admins need to edit their instance config and add the new instance to the allowlist. As Lemmy grows and more instances are created, this will result in more and more work for the admins of big instances. I am proposing a way to automate the majority of this process, and handle it directly in Lemmy.
> 
> The following example uses \`lemmy.ml\` for simplicity, but it would work identically with any instance.
> 
> \- There is an admin option "federate with new instance (eg lemmy.ml)"
> - Could display a list of suggested instances from join.lemmy.ml
> \- After entering instance, fetches and shows info text about the instance (but doesnt federate anything else)
> \- Button "apply to federate", after clicking shows instructions and message input, eg:
> - Have certain rules/CoC
> - Include a contact method (eg Matrix, Mastodon, Email, etc)
> - Write a short description of their instance
> \- Submitting the federation application sends an ActivityPub message to lemmy.ml
> \- Admins accept or deny the application
> \- If accepted, admins can initiate federation by fetching first user visible items (users, communities, posts, comments) are federated
> \- Admin posts announcement about federation
> - Currently this would have to be posted by lemmy.ml, so other instances don't block it
> - Maybe we should change allowlist behaviour, so that all posts/comments to allowed instance are allowed (currently we block everything 
> \- Other instance admins see the announcement, and follow the same steps to start federating
> 
> This issue replaces #862.
> 
> \<bountysource-plugin\>
> 
> \---
> Want to back this issue? \*\*\[Post a bounty on it!\](https://www.bountysource.com/issues/97091741-removed?utm\_campaign=plugin&utm\_content=tracker%2F126011972&utm\_medium=issues&utm\_source=github)\*\* We accept bounties via \[Bountysource\](https://www.bountysource.com/?utm\_campaign=plugin&utm\_content=tracker%2F126011972&utm\_medium=issues&utm\_source=github).
> \</bountysource-plugin\>

Now I’m wondering which activities would make sense to implement this, and if any other projects have similar functionality. I believe Peertube does, but their docs dont specify how it is federated. Maybe `Offer` and `Accept`/`Reject` would work, but I dont know what the `object` of the `Offer` should be.

---

<div class="post-metadata">

**Author:** ![aschrijver](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/aschrijver/32/278_2.png) [@aschrijver](https://socialhub.activitypub.rocks/u/aschrijver)\
**Post date:** [August 23, 2021, 5:14am UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/2 "2021-08-23T05:14:06Z")

</div>

Note: This topic is related to the slightly larger domain of Federated Moderation I wrote about earlier in: [Federated Moderation: Towards Delegated Moderation?](https://socialhub.activitypub.rocks/t/federated-moderation-towards-delegated-moderation/1580) (It is also [posted to the Fediverse Futures](https://lemmy.ml/post/60475) brainstorming space on Lemmy, which I updated with a link to this).

**Update** : I added a comment to the open issue, and on the Federated Moderation topic.

---

<div class="post-metadata">

**Author:** ![tcit](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/tcit/32/49_2.png) [@tcit](https://socialhub.activitypub.rocks/u/tcit)\
**Post date:** [August 23, 2021, 9:27am UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/3 "2021-08-23T09:27:33Z")

</div>

PeerTube and Mobilizon both have an _instance actor_ (named `root` for PeerTube, `relay` in Mobilizon). Following instances is simply done by following this actor.

The involved activities are simply `Follow`/`Accept`/`Reject`.

---

<div class="post-metadata">

**Author:** ![nutomic](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/nutomic/32/1055_2.png) [@nutomic](https://socialhub.activitypub.rocks/u/nutomic)\
**Post date:** [August 23, 2021, 9:40am UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/4 "2021-08-23T09:40:07Z")

</div>

Thanks, I guess that makes sense. Out of curiosity, is the follow relationship between instances used for anything else, or just for the federation request?

---

<div class="post-metadata">

**Author:** ![macgirvin](https://socialhub.activitypub.rocks/letter_avatar_proxy/v4/letter/m/82dd89/32.png) [@macgirvin](https://socialhub.activitypub.rocks/u/macgirvin)\
**Post date:** [August 23, 2021, 10:38pm UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/5 "2021-08-23T22:38:18Z")

</div>

We provide instance actors as well, however these aren’t always easily discoverable. A concept we’ve used in the Zot/Nomad sector of the fediverse is for queries to the domain root to return information about the site. We use this to obtain keys for providing additional transport encryption.

I’ve had every intention of providing a similar interface to ActivityPub. In this case an ActivityPub/ActivityStreams fetch of the domain root would return an actor of type Service. Don’t look, because it isn’t there at this moment. Having worked with instance actors for several years it turned out to be a logical and intuitive progression to place it at the domain root. This could be useful in a number of scenarios such as notifications/reports/blocks to a site admin or admin team; who likewise aren’t always easily discoverable and could be implemented as an alias for the existing instance actor on projects that already use this concept. The point being that for accept-only sites this Service actor could also be followed which would provide an easily discoverable way to connect sites. And a “manuallyApprovesFollowers” field in that record with a value of ‘true’ could potentially indicate whether or not the site itself was open or closed to the rest of the fediverse by default.

I’ll just throw this idea out there in case anybody else sees value in it. If not, no big deal.

---

<div class="post-metadata">

**Author:** ![aschrijver](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/aschrijver/32/278_2.png) [@aschrijver](https://socialhub.activitypub.rocks/u/aschrijver)\
**Post date:** [August 24, 2021, 5:14am UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/6 "2021-08-24T05:14:33Z")

</div>

Service actors for this purpose seem great to me, and they could be used for a host of other scenario’s where you want to interact at instance level.

---

<div class="post-metadata">

**Author:** ![macgirvin](https://socialhub.activitypub.rocks/letter_avatar_proxy/v4/letter/m/82dd89/32.png) [@macgirvin](https://socialhub.activitypub.rocks/u/macgirvin)\
**Post date:** [August 24, 2021, 6:22am UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/7 "2021-08-24T06:22:23Z")

</div>

It wasn’t so much the concept of service actors I was recommending - in fact a fair number of projects have them already and use them internally. In my view what actually gives them added value is to put them on the domain root so that they are easily discoverable; and we could use that “actor” record to provide site profiles rather than requiring us to query platform specific APIs to discover stuff about remote sites. We’re “trying” a fair number of these platform specific APIs at the moment and I know Friendica hits some sites with about 10-15 discovery fetches just to determine what they are and how they communicate. This seems wasteful; but it’s necessary because there’s no standard site discovery mechanism.

This could take sites to a whole new level. Especially if it opens the possibility of relationships and eases reporting content and notifying admins of issues across platforms – which are unable to support/implement the Mastodon API because their internal architecture is radically different.

---

<div class="post-metadata">

**Author:** ![nutomic](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/nutomic/32/1055_2.png) [@nutomic](https://socialhub.activitypub.rocks/u/nutomic)\
**Post date:** [August 24, 2021, 10:30pm UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/8 "2021-08-24T22:30:45Z")

</div>

> [@macgirvin](#):
>
> I’ve had every intention of providing a similar interface to ActivityPub. In this case an ActivityPub/ActivityStreams fetch of the domain root would return an actor of type Service.

I really like this idea. In fact I was wondering where to put the instance actor, but doing something like `lemmy.ml/lemmy` seems slightly awkward. Putting it at the root makes a lot of sense, and I dont see any argument against it.

> [@macgirvin](#):
>
> This could take sites to a whole new level. Especially if it opens the possibility of relationships and eases reporting content and notifying admins of issues across platforms – which are unable to support/implement the Mastodon API because their internal architecture is radically different.

Good point, I think this could be a really elegant way for us to federate reports.

---

<div class="post-metadata">

**Author:** ![silverpill](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/silverpill/32/1770_2.png) [@silverpill](https://socialhub.activitypub.rocks/u/silverpill)\
**Post date:** [November 16, 2021, 10:06pm UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/9 "2021-11-16T22:06:39Z")

</div>

> [@macgirvin](#):
>
> and we could use that “actor” record to provide site profiles rather than requiring us to query platform specific APIs to discover stuff about remote sites. We’re “trying” a fair number of these platform specific APIs at the moment and I know Friendica hits some sites with about 10-15 discovery fetches just to determine what they are and how they communicate.

Isn’t this a problem that NodeInfo standard is supposed to solve?

---

<div class="post-metadata">

**Author:** ![macgirvin](https://socialhub.activitypub.rocks/letter_avatar_proxy/v4/letter/m/82dd89/32.png) [@macgirvin](https://socialhub.activitypub.rocks/u/macgirvin)\
**Post date:** [November 16, 2021, 10:23pm UTC](https://socialhub.activitypub.rocks/t/activities-for-federation-application/2002/10 "2021-11-16T22:23:43Z")

</div>

Most of our sites turn off nodeinfo because they are private sites run for family and friends and don’t like handing out usage and malware targeting statistics to strangers.
