Feature: uploadMedia endpoint + attachments on direct notes
The actor has been advertising endpoints.uploadMedia without a route
behind it; this implements it. A bearer scoped to the site POSTs one
image/audio/video (multipart field "file", the AP C2S convention) into
the reply-media store and gets { url, mediaType, name } back. Direct
notes (private mentions) now carry attachments through the same
deliverReply-style validation (own /media/ uploads only, max 4), so
the help-buoy capture rides a DM to the guardians while the note stays
direct: recipients only, empty cc, unboostable.
Changed files:
src/routes/activitypub.js
- POST /ap/users/:slug/uploadMedia (bearer-gated, multer, 32MB)
src/services/ActivityPubService.js
- ingest passes AS2 attachments into the direct path (absolute
own-base URLs normalized to relative)
- deliverDirectNote validates + stores attachments
New file: (none)
test/c2s-direct.test.js
- direct note renders its attachment, addressing stays direct
-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>