Plume是如何实现Federate的

A summary of the standards Plume uses to federate, how they are implemented, and which parts of these standards are available or not in Plume.

To federate with other Fediverse software (and itself), Plume uses various protocols:

Currently, the following aspects are federated:

And these parts are not federated, but may be in the future:

WebFinger

WebFinger用于发现远程配置文件。 当您打开一个未知的 用户页面(/@/username@instance.tld), Plume将向另一个实例的标准/.well known/webfinger 入口发送一个 WebFinger 请求。 Plume将忽略 /.well-known/host-meta端点(通常可用于定义另一个WebFinger端点),并始终使用标准URL。

Plume使用webfinger crate来提供WebFinger服务。

HTTP 签名

Plume checks that each incoming Activity has been signed with the actor‘s keypair.

To achieve that, it uses the Signature HTTP header. For more details on how this header is generated, please refer to the HTTP Signatures Specification.

The Digest header should be present too, and used to generate the signature, so that we can verify the body of the request too.

NodeInfo

Plume exposes instance metadata with NodeInfo on the /nodeinfo URL.

Example output

{
  "version": "2.0",
  "software": {
    "name": "Plume",
    "version": "0.2.0"
  },
  "protocols": ["activitypub"],
  "services": {
    "inbound": [],
    "outbound": []
  },
  "openRegistrations": true,
  "usage": {
    "users": {
      "total": 42
    },
    "localPosts": 7878,
    "localComments": 1312
  },
  "metadata": {}
}

ActivityPub

Each user has a personal inbox at /@/username/inbox, and each instance has a shared inbox at /inbox.

If available, Plume will use the shared inbox to deliver activities.

Object representation

Supported Activities

Plume 0.2.0 supports the following activity types.

Accept

Accepts a follow request.

It will be ignored when received, as Plume considers follow requests to be immediatly approved in all cases (however, this will change in the future).

When a Follow activity is received, Plume will respond with this activity.

Announce

Reshares an article (not available for other objects).

Makes an user (actor) reshare a post (object).

Create

Creates a new article or comment.

If object is an Article:

If object is a Note:

删除

Deletes an object that was first created with a Create activity.

object is a Tombstone, and object.id the ID of the object to delete (either an Article ID, or a Note ID).

Follow

When received, the actor is added to the follower list of the target.

These activities are immediatly accepted (see Accept) by Plume.

For blogs, they won’t actually do anything else than sending back an Accept activity: following a blog is not yet implemented.

Like

Can be used to add a like to an article.

更新

Updates an article.

Undo

Cancels a previous action (either a like, reshare or follow).