๐Ÿ“š Agora location [[federation]] โ˜†
Agora locations contain community contributions whose titles or topics match your search. x
๐Ÿ“„ federation.md by @flancian โ˜† raw ๏ธ๐Ÿ”— โœ๏ธ

Federation

๐Ÿ“„ federation.md by @neil โ˜† raw ๏ธ๐Ÿ”— โœ๏ธ

federation

๐Ÿ“„ FEDERATION.md by @agora-server โ˜† raw

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 inbox and outbox.
    • A link to their human-readable Agora profile page (/u/<user>).
    • A public key (publicKeyPem) for verifying signed requests.

Inbox

  • Endpoint: /u/<user>/inbox (POST)
  • Purpose: Receives activities from other servers.
  • Implementation:
    • Handles Follow, Like, Create (Reply), and Announce (Boost) activities.
    • Incoming requests are verified using HTTP Signatures.
    • Follow: Adds the follower to the database and sends an Accept activity back.
    • Reactions: Stores Likes, Replies, and Boosts in the reactions table in SQLite.

Outbox

  • Endpoint: /u/<user>/outbox (GET)
  • Purpose: Shows a collection of the user’s recent public activities.
  • Implementation:
    • It returns an OrderedCollection of the user’s 20 most recent subnodes, formatted as Create activities wrapping a Note object.
    • Each Note object has a stable, unique ID (/u/<user>/note/<path>) that returns the ActivityPub JSON representation, ensuring compatibility with Mastodon and other platforms.

Federation Logic

Following a User

  1. A user on a remote server follows an Agora user.
  2. The remote server sends a Follow activity to the Agora user’s inbox.
  3. The Agora validates the activity (HTTP Signature) and adds the follower to its database.
  4. The Agora sends an Accept activity back to the remote server.
  5. 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.pem and public.pem key pair on first run if they don’t exist.
  • Signed Requests: All outgoing activities (like Accept and Create) 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 by @agora@botsin.space โ˜† raw
๐Ÿ“„ FEDERATION.md by @agora@botsin.space โ˜† raw
๐Ÿ“„ Federation.md by @agora@botsin.space โ˜† raw
๐Ÿ“„ federation.md by @an_agora@twitter.com โ˜† raw
๐Ÿ“„ Federation.md by @an_agora@twitter.com โ˜† raw
๐Ÿ“„ federation.md by @anagora.bsky.social โ˜† raw
๐Ÿ“„ federation.md by @anagora@matrix.org โ˜† raw
๐Ÿ“„ Federation.md by @flancian@social.coop โ˜† raw
๐Ÿ“„ federation.md by @flancian@twitter.com โ˜† raw

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 by @flancian@twitter.com โ˜† raw

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.

๐Ÿ“„ app/federation.py by @agora-server โ˜† raw
(Python code, output might appear as a push if this Agora supports it.)

Loading pushes...

Rendering context...

๐Ÿ“š Agora location [[commons]] (pulled by user)
๐Ÿ“š Agora location [[fediverse]] (pulled by user)