From 4a553da94e38bcf3cfaea1b188f486d09dac08ac Mon Sep 17 00:00:00 2001 From: Ricardo Date: Sun, 22 Feb 2026 20:51:18 +0100 Subject: [PATCH] fix: use HTTPS activity IDs and add addressing for boost/like Boost (Announce) was missing to/cc addressing so Mastodon silently discarded it. Both boost and like used urn:uuid: IDs which are not dereferenceable. Changed to HTTPS URLs and added Public/followers addressing on Announce. --- lib/controllers/interactions-boost.js | 11 ++++++++++- lib/controllers/interactions-like.js | 4 +++- package.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/controllers/interactions-boost.js b/lib/controllers/interactions-boost.js index 6f62de1..15b5465 100644 --- a/lib/controllers/interactions-boost.js +++ b/lib/controllers/interactions-boost.js @@ -41,13 +41,22 @@ export function boostController(mountPath, plugin) { { handle, publicationUrl: plugin._publicationUrl }, ); - const activityId = `urn:uuid:${crypto.randomUUID()}`; + const uuid = crypto.randomUUID(); + const baseUrl = plugin._publicationUrl.replace(/\/$/, ""); + const activityId = `${baseUrl}/activitypub/boosts/${uuid}`; + + const publicAddress = new URL( + "https://www.w3.org/ns/activitystreams#Public", + ); + const followersUri = ctx.getFollowersUri(handle); // Construct Announce activity const announce = new Announce({ id: new URL(activityId), actor: ctx.getActorUri(handle), object: new URL(url), + to: publicAddress, + cc: followersUri, }); // Send to followers via shared inbox diff --git a/lib/controllers/interactions-like.js b/lib/controllers/interactions-like.js index e7bcd84..942f3cc 100644 --- a/lib/controllers/interactions-like.js +++ b/lib/controllers/interactions-like.js @@ -97,7 +97,9 @@ export function likeController(mountPath, plugin) { } // Generate a unique activity ID - const activityId = `urn:uuid:${crypto.randomUUID()}`; + const uuid = crypto.randomUUID(); + const baseUrl = plugin._publicationUrl.replace(/\/$/, ""); + const activityId = `${baseUrl}/activitypub/likes/${uuid}`; // Construct and send Like activity const like = new Like({ diff --git a/package.json b/package.json index 131fa41..61ad296 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "2.0.5", + "version": "2.0.6", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit",