|
| 1 | +# ForgeFed Integration |
| 2 | + |
| 3 | +Link.Assistant.Router exposes a small ActivityPub/ForgeFed surface so coding |
| 4 | +problem sources can discover and address the router as a service actor. |
| 5 | + |
| 6 | +## Endpoints |
| 7 | + |
| 8 | +| Endpoint | Method | Purpose | |
| 9 | +|---|---|---| |
| 10 | +| `/actor/code` | `GET` | Public service actor document | |
| 11 | +| `/inbox/code` | `POST` | Inbound ActivityStreams activities | |
| 12 | +| `/outbox/code` | `GET` | Local actor outbox collection | |
| 13 | +| `/actors/code/followers` | `GET` | Local followers collection | |
| 14 | +| `/activities/follow-problemsets-code-001` | `GET` | Follow activity targeting `problemsets.lefine.pro` | |
| 15 | + |
| 16 | +All successful ActivityPub responses use `application/activity+json`. |
| 17 | + |
| 18 | +## Configuration |
| 19 | + |
| 20 | +Set these values when the router is served from a public URL: |
| 21 | + |
| 22 | +| Variable | Description | |
| 23 | +|---|---| |
| 24 | +| `ACTIVITYPUB_ACTOR_BASE_URL` | Public origin used in actor, inbox, outbox, and activity IDs | |
| 25 | +| `ACTIVITYPUB_PUBLIC_KEY_PEM` | PEM public key advertised in the actor document | |
| 26 | + |
| 27 | +Example: |
| 28 | + |
| 29 | +```bash |
| 30 | +export ACTIVITYPUB_ACTOR_BASE_URL=https://router.example.com |
| 31 | +export ACTIVITYPUB_PUBLIC_KEY_PEM="$(cat public.pem)" |
| 32 | +export TOKEN_SECRET="$(openssl rand -hex 32)" |
| 33 | +link-assistant-router serve |
| 34 | +``` |
| 35 | + |
| 36 | +## Discovery Check |
| 37 | + |
| 38 | +After deployment, verify the actor document: |
| 39 | + |
| 40 | +```bash |
| 41 | +curl -H 'Accept: application/activity+json' \ |
| 42 | + https://router.example.com/actor/code | jq . |
| 43 | +``` |
| 44 | + |
| 45 | +The response should include: |
| 46 | + |
| 47 | +- `@context` containing `https://www.w3.org/ns/activitystreams` and |
| 48 | + `https://forgefed.org/ns` |
| 49 | +- `type` set to `Service` |
| 50 | +- `inbox` set to the public `/inbox/code` URL |
| 51 | +- `publicKey.owner` matching the actor ID |
| 52 | + |
| 53 | +## Following Problem Sets |
| 54 | + |
| 55 | +The router publishes a reusable Follow activity for the public problemsets |
| 56 | +actor: |
| 57 | + |
| 58 | +```bash |
| 59 | +curl -H 'Accept: application/activity+json' \ |
| 60 | + https://router.example.com/activities/follow-problemsets-code-001 | jq . |
| 61 | +``` |
| 62 | + |
| 63 | +Submit that activity to a compatible ForgeFed inbox when a remote problem source |
| 64 | +requires an explicit follow request. |
0 commit comments