≡ 📚 Agora location [[federation]] ☆
📜 federation.md (contribution by @flancian) ☆ 📎 ️🔗 ✍️ ≡
Federation
-
an [[idea]].
- #pull [[fediverse]] [[commons]]
-
a [[subset]] of the [[internet]].
- The part that is willing to [[federate]].
- The part that works for its [[users]].
- The set of all [[open platforms]]; those who follow [[open protocols]] and try to build [[commons]].
- [[go]] https://fediverse.party/en/portal/servers
-
The [[agora]] is part of the [[federation]].
- It tries to run projects of [[public utility]].
📜 federation.md (contribution by @neil) ☆ 📎 ️🔗 ✍️ ≡
federation
📜 FEDERATION.md (contribution by @agora-server) ☆ 📎 ≡
Agora Federation
The Agora supports a basic level of ActivityPub federation, allowing users from other federated platforms (like Mastodon, Pleroma, etc.) to follow and receive updates from users within the Agora.
This document outlines the current implementation.
Key Endpoints
WebFinger
- Endpoint:
/.well-known/webfinger?resource=acct:<user>@<domain> - Purpose: Allows users on other servers to discover Agora users. When a remote user searches for
@<user>@<your.agora.domain>, their server queries this endpoint. - Implementation: The Agora checks if the requested user exists. If they do, it returns a JSON response containing a link to the user’s ActivityPub profile (
actor) URL.
Actor Profile
- Endpoint:
/users/<username>(also aliased to/u/<username>) - Purpose: Provides the ActivityPub actor profile for an Agora user. This is a machine-readable JSON object that describes the user.
-
Implementation: The profile includes:
- The user’s unique
id. - Their
preferredUsername. - Links to their
inboxandoutbox. - A link to their human-readable Agora profile page (
/u/<user>). - A public key (
publicKeyPem) for verifying signed requests.
- The user’s unique
Inbox
- Endpoint:
/u/<user>/inbox(POST) - Purpose: Receives activities from other servers.
-
Implementation:
- Handles
Follow,Like,Create(Reply), andAnnounce(Boost) activities. - Incoming requests are verified using HTTP Signatures.
- Follow: Adds the follower to the database and sends an
Acceptactivity back. - Reactions: Stores Likes, Replies, and Boosts in the
reactionstable in SQLite.
- Handles
Outbox
- Endpoint:
/u/<user>/outbox(GET) - Purpose: Shows a collection of the user’s recent public activities.
-
Implementation:
- It returns an
OrderedCollectionof the user’s 20 most recent subnodes, formatted asCreateactivities wrapping aNoteobject. - Each
Noteobject has a stable, unique ID (/u/<user>/note/<path>) that returns the ActivityPub JSON representation, ensuring compatibility with Mastodon and other platforms.
- It returns an
Federation Logic
Following a User
- A user on a remote server follows an Agora user.
- The remote server sends a
Followactivity to the Agora user’s inbox. - The Agora validates the activity (HTTP Signature) and adds the follower to its database.
- The Agora sends an
Acceptactivity back to the remote server. - Immediately after sending the
Accept, the Agora sends the new follower the 5 most recent subnodes from the followed user. This is to populate the new follower’s timeline with some initial content.
Sending Posts (Federating)
- Initial Posts: As described above, the 5 most recent posts are sent to new followers.
- Worker Process: To automatically push new content to existing followers, you must run the Federation Worker.
- Tracking: The Agora tracks which subnodes have been federated in a dedicated SQLite table (
federated_subnodes). This prevents sending the same subnode to the same follower multiple times.
Running the Federation Worker
The federation worker is a separate process that polls the Git repositories for new commits and broadcasts them to followers.
Manual Run (Single Pass):
uv run python3 scripts/federation_worker.py --once
Continuous Loop (Default Interval: 5 minutes):
uv run python3 scripts/federation_worker.py
Systemd Service:
It is recommended to run this as a systemd service (e.g., agora-federation.service) to ensure it runs continuously in the background.
Security
- Keys: The Agora automatically generates a
private.pemandpublic.pemkey pair on first run if they don’t exist. - Signed Requests: All outgoing activities (like
AcceptandCreate) are signed with the user’s private key. Remote servers can fetch the public key from the actor profile to verify that the requests are legitimate. - Incoming Verification: The Inbox strictly validates HTTP Signatures on incoming requests to prevent spoofing.
📜 federation.md (contribution by @agora@botsin.space) ☆ 📎 ≡
- [[flancian]] https://social.coop/@flancian/107542654808110563
- [[coopcloud@social.coop]] https://social.coop/@coopcloud/108950300391144857
- [[youronlyone@c.im]] https://c.im/@youronlyone/110066291428862570
- [[youronlyone@c.im]] https://c.im/@youronlyone/110127804564078858
- [[rmdes@mstdn.social]] https://mstdn.social/@rmdes/110543301691291958
📜 FEDERATION.md (contribution by @agora@botsin.space) ☆ 📎 ≡
📜 Federation.md (contribution by @agora@botsin.space) ☆ 📎 ≡
📜 federation.md (contribution by @an_agora@twitter.com) ☆ 📎 ≡
- [[flancian]] https://twitter.com/flancian/status/1472628360446681099
- [[flancian]] https://twitter.com/flancian/status/1476964637509926916
- [[flancian]] https://twitter.com/flancian/status/1494745798264954887
- [[flancian]] https://twitter.com/flancian/status/1515040468618424321
- [[flancian]] https://twitter.com/flancian/status/1520779834254897152
- [[2022-11-28 16:24:09+00:00]] @[[flancian]]: https://twitter.com/flancian/status/1597265096530571264
📜 Federation.md (contribution by @an_agora@twitter.com) ☆ 📎 ≡
📜 federation.md (contribution by @anagora.bsky.social) ☆ 📎 ≡
📜 federation.md (contribution by @anagora@matrix.org) ☆ 📎 ≡
-
[[2022-03-23 22:01:20]] [[@charismatic_shell:matrix.org]] (link):
- [[federation]]? [[praying mantis]]?
📜 Federation.md (contribution by @flancian@social.coop) ☆ 📎 ≡
-
[[2022-11-26 15:42:35+00:00]] @[[flancian@social.coop]] https://social.coop/@flancian/109410867949239650:
-
A #Flancian believes it is through a [[re evolution]] ~ #reevolution of the #base and [[super structure]] that we will unlock the true potential of humanity and our allies in the #Commons and its #Federation.
-
-
[[2023-02-03 20:00:42+00:00]] @[[flancian@social.coop]] https://social.coop/@flancian/109802582357575302:
-
I think @elonmusk is trying to enclose or disrupt the [[Commons]] with the Twitter API changes, maybe unconsciously. But I also believe if he knew the long term implications of what he’s doing he would stop doing it: he would change his mind and embrace the #Federation.
-
📜 federation.md (contribution by @flancian@twitter.com) ☆ 📎 ≡
- [[2022-11-28 16:24:09+00:00]] @[[flancian]]: https://twitter.com/flancian/status/1597265096530571264
RT @dakkar@s.thenautilus.net CW: meta, #federation explanation
Aha! Finally found a clear and complete diagram of activity dissemination in #ActivityPub! It uses Mastodon-specific terms, but the logic works and matches both the code and the behaviour I’ve seen. From (1/2)
📜 Federation.md (contribution by @flancian@twitter.com) ☆ 📎 ≡
- [[2022-11-26 15:53:06+00:00]] @[[flancian]]: https://twitter.com/flancian/status/1596532508828499970
A #Flancian believes it is through a [[re evolution]] ~ #reevolution of the #base and [[super structure]] that we will unlock the true potential of humanity and our allies in the #Commons and its #Federation.
- [[2022-12-18 23:15:05+00:00]] @[[flancian]]: https://twitter.com/flancian/status/1604616268643966976
@elonmusk btw you worry about Mastodon when you should be embracing the overall [[Federation]], have you considered skating where the buck is going
📜 app/federation.py (contribution by @agora-server) ☆ 📎 ≡
(Python code, output might appear as a push if this Agora supports it.)
✨ AI Synthesis Mistral Gemini ChatGPT Claude
Expanding this section will automatically generate an AI synthesis of the contributions in this node.