From 1d344601cb8b068081ad1777fefd84404e660131 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Mon, 16 Oct 2023 14:39:23 -0700 Subject: Disable discoverability/indexablity for ActivityPub actors Applying the new `indexable` attribute (and the old `discoverable` attribute) to the main ActivityPub actor for a Gathio page as described here: https://github.com/mastodon/mastodon/pull/26485 Setting everything to false since Gathio is private-by-default. Using the `toot` namespace since that seems safe enough. --- src/activitypub.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/activitypub.js b/src/activitypub.js index d92b399..857dce8 100644 --- a/src/activitypub.js +++ b/src/activitypub.js @@ -34,8 +34,14 @@ export function createActivityPubActor( "@context": [ "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", + { + "toot": "http://joinmastodon.org/ns#", + "discoverable": "toot:discoverable", + "indexable": "toot:indexable" + }, ], - + indexable: false, + discoverable: false, id: `https://${domain}/${eventID}`, type: "Person", preferredUsername: `${eventID}`, @@ -45,7 +51,8 @@ export function createActivityPubActor( summary: `

${description}

`, name: name, featured: `https://${domain}/${eventID}/featured`, - + indexable: false, + discoverable: false, publicKey: { id: `https://${domain}/${eventID}#main-key`, owner: `https://${domain}/${eventID}`, @@ -82,7 +89,17 @@ export function createActivityPubEvent( ) { const guid = crypto.randomBytes(16).toString("hex"); let eventObject = { - "@context": "https://www.w3.org/ns/activitystreams", + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "toot": "http://joinmastodon.org/ns#", + "discoverable": "toot:discoverable", + "indexable": "toot:indexable" + }, + ], + indexable: false, + discoverable: false, id: `https://${domain}/${guid}`, name: name, type: "Event", -- cgit v1.2.3