Overview
The NOX ActivityPub actors and WebFinger discovery
NOX does not only federate accounts: a world, a mod, an avatar, a running instance and the node
itself each have an ActivityPub actor. They all answer the same way, under the /ap prefix.
Federated types
| Entity | Segment | ActivityPub type | Actor | REST resource |
|---|---|---|---|---|
| User | u | Person | /ap/u/hactazia | /api/users/hactazia |
| Instance | i | Group | /ap/i/48 | /api/instances/48 |
| World | w | Group | /ap/w/cozy | /api/worlds/cozy |
| Mod | m | Application | /ap/m/nox.ui | /api/mods/nox.ui |
| Avatar | a | Application | /ap/a/1 | /api/avatars/1 |
| Node | — | Service | /ap/server | — |
The segment is the one of the asset controllers (@AssetController): w, m and a are already
the letters used everywhere in NOX, so the actor is addressable like the rest.
Actors receive nothing: NOX has a single shared inbox (/ap/inbox), published in
endpoints.sharedInbox of every document.
Routes
| Route | Content |
|---|---|
GET /ap/server | The actor of the node itself (Service) |
GET /ap/u/{username} | The actor of a user (Person) |
GET /ap/i/{id} | The actor of an instance (Group) |
GET /ap/{segment}/{id} | The actor of an asset, by its segment and id/slug |
GET /ap/{segment}/{id}/outbox | Empty outbox of an asset actor |
POST /ap/inbox | The shared inbox |
POST /ap/u/{username}/inbox | The inbox of a user |
An unknown target answers 404 — never an empty document.
Mount point
Both surfaces are mounted the same way, each with its own variable, and an empty value serves them at the root of a dedicated host:
| Variable | Default | Effect |
|---|---|---|
HTTP_PREFIX | api | Prefix of the REST API — …/api/users/hactazia |
AP_PREFIX | ap | Prefix of ActivityPub — …/ap/w/cozy |
With AP_PREFIX= and GATEWAY_ACTIVITYPUB=https://ap.example.org/, the same actor answers at
https://ap.example.org/w/cozy. Both settings are read at boot and need a restart.
WebFinger discovery
GET /.well-known/webfinger?resource=<resource>The resource accepts the following forms, on the local hosts (address, web base, ActivityPub base):
| Resource | Target |
|---|---|
acct:hactazia@hactazia.fr | user (bare identifier) |
acct:w:cozy@hactazia.fr | asset, prefixed with its segment |
acct:i:48@hactazia.fr | instance |
acct:server@hactazia.fr | the node |
acct:hactazia.fr@hactazia.fr | the node, by its address (Mastodon's instance-actor form) |
https://nox.hactazia.fr/ap/w/cozy | the actor it addresses |
https://nox.hactazia.fr/u/hactazia | same, through a front route |
Only users answer a bare identifier: a username is unique, while cozy names both a world and
a mod — the other types therefore carry their segment.
The returned JRD document contains the following links:
rel | href |
|---|---|
http://webfinger.net/rel/profile-page | the web page of the entity |
self | the ActivityPub document (actor) |
nox/1.0 | the equivalent REST resource |
http://webfinger.net/rel/avatar | the profile image, when it exists |
The nox/1.0 link (the same relation as in .well-known/nodeinfo) lets a peer that resolved an
actor read the same entity through the API, with the identifier it already holds.
REST payload aliases
Every entity exposes its entrypoints in its alias, so a client never has to build a URL:
| Key | Value |
|---|---|
api | the REST resource |
activitypub | the actor document |
web | the front page |
acct | the Nox identifier (acct:w:cozy@hactazia.fr) |
webfinger | the WebFinger URL that resolves this identifier |
"alias": [
{ "key": "api", "value": "https://nox.hactazia.fr/api/worlds/1" },
{ "key": "activitypub", "value": "https://nox.hactazia.fr/ap/w/cozy" },
{ "key": "web", "value": "https://nox.hactazia.fr/w/cozy" },
{ "key": "acct", "value": "acct:w:cozy@hactazia.fr" },
{ "key": "webfinger", "value": "https://nox.hactazia.fr/.well-known/webfinger?resource=acct:w:cozy@hactazia.fr" }
]