@rmdes/indiekit-endpoint-activitypub 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -4
- package/lib/controllers/activities.js +2 -2
- package/lib/controllers/dashboard.js +1 -1
- package/lib/controllers/followers.js +2 -2
- package/lib/controllers/following.js +2 -2
- package/lib/controllers/migrate.js +2 -2
- package/lib/federation.js +1 -1
- package/lib/inbox.js +2 -2
- package/lib/keys.js +1 -1
- package/lib/migration.js +2 -2
- package/package.json +1 -1
- /package/views/{activities.njk → activitypub-activities.njk} +0 -0
- /package/views/{dashboard.njk → activitypub-dashboard.njk} +0 -0
- /package/views/{followers.njk → activitypub-followers.njk} +0 -0
- /package/views/{following.njk → activitypub-following.njk} +0 -0
- /package/views/{migrate.njk → activitypub-migrate.njk} +0 -0
package/index.js
CHANGED
|
@@ -305,10 +305,15 @@ export default class ActivityPubEndpoint {
|
|
|
305
305
|
if (!self._federationHandler) {
|
|
306
306
|
return undefined;
|
|
307
307
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
308
|
+
try {
|
|
309
|
+
return await self._federationHandler.deliverToFollowers(
|
|
310
|
+
properties,
|
|
311
|
+
publication,
|
|
312
|
+
);
|
|
313
|
+
} catch (error) {
|
|
314
|
+
console.error("[ActivityPub] Syndication failed:", error.message);
|
|
315
|
+
return undefined;
|
|
316
|
+
}
|
|
312
317
|
},
|
|
313
318
|
};
|
|
314
319
|
}
|
|
@@ -10,7 +10,7 @@ export function activitiesController(mountPath) {
|
|
|
10
10
|
const collection = application?.collections?.get("ap_activities");
|
|
11
11
|
|
|
12
12
|
if (!collection) {
|
|
13
|
-
return response.render("activities", {
|
|
13
|
+
return response.render("activitypub-activities", {
|
|
14
14
|
title: response.locals.__("activitypub.activities"),
|
|
15
15
|
activities: [],
|
|
16
16
|
mountPath,
|
|
@@ -30,7 +30,7 @@ export function activitiesController(mountPath) {
|
|
|
30
30
|
|
|
31
31
|
const cursor = buildCursor(page, totalPages, mountPath + "/admin/activities");
|
|
32
32
|
|
|
33
|
-
response.render("activities", {
|
|
33
|
+
response.render("activitypub-activities", {
|
|
34
34
|
title: response.locals.__("activitypub.activities"),
|
|
35
35
|
activities,
|
|
36
36
|
mountPath,
|
|
@@ -10,7 +10,7 @@ export function followersController(mountPath) {
|
|
|
10
10
|
const collection = application?.collections?.get("ap_followers");
|
|
11
11
|
|
|
12
12
|
if (!collection) {
|
|
13
|
-
return response.render("followers", {
|
|
13
|
+
return response.render("activitypub-followers", {
|
|
14
14
|
title: response.locals.__("activitypub.followers"),
|
|
15
15
|
followers: [],
|
|
16
16
|
followerCount: 0,
|
|
@@ -31,7 +31,7 @@ export function followersController(mountPath) {
|
|
|
31
31
|
|
|
32
32
|
const cursor = buildCursor(page, totalPages, mountPath + "/admin/followers");
|
|
33
33
|
|
|
34
|
-
response.render("followers", {
|
|
34
|
+
response.render("activitypub-followers", {
|
|
35
35
|
title: response.locals.__("activitypub.followers"),
|
|
36
36
|
followers,
|
|
37
37
|
followerCount: totalCount,
|
|
@@ -10,7 +10,7 @@ export function followingController(mountPath) {
|
|
|
10
10
|
const collection = application?.collections?.get("ap_following");
|
|
11
11
|
|
|
12
12
|
if (!collection) {
|
|
13
|
-
return response.render("following", {
|
|
13
|
+
return response.render("activitypub-following", {
|
|
14
14
|
title: response.locals.__("activitypub.following"),
|
|
15
15
|
following: [],
|
|
16
16
|
followingCount: 0,
|
|
@@ -31,7 +31,7 @@ export function followingController(mountPath) {
|
|
|
31
31
|
|
|
32
32
|
const cursor = buildCursor(page, totalPages, mountPath + "/admin/following");
|
|
33
33
|
|
|
34
|
-
response.render("following", {
|
|
34
|
+
response.render("activitypub-following", {
|
|
35
35
|
title: response.locals.__("activitypub.following"),
|
|
36
36
|
following,
|
|
37
37
|
followingCount: totalCount,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
export function migrateGetController(mountPath) {
|
|
16
16
|
return async (request, response, next) => {
|
|
17
17
|
try {
|
|
18
|
-
response.render("migrate", {
|
|
18
|
+
response.render("activitypub-migrate", {
|
|
19
19
|
title: response.locals.__("activitypub.migrate"),
|
|
20
20
|
mountPath,
|
|
21
21
|
result: null,
|
|
@@ -91,7 +91,7 @@ export function migratePostController(mountPath, pluginOptions) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
response.render("migrate", {
|
|
94
|
+
response.render("activitypub-migrate", {
|
|
95
95
|
title: response.locals.__("activitypub.migrate"),
|
|
96
96
|
mountPath,
|
|
97
97
|
result,
|
package/lib/federation.js
CHANGED
|
@@ -221,7 +221,7 @@ export function createFederationHandler(options) {
|
|
|
221
221
|
actorUrl,
|
|
222
222
|
objectUrl: activity.object?.id || activity.object,
|
|
223
223
|
summary: `Delivered ${activity.type} to ${delivered}/${inboxes.size} inboxes`,
|
|
224
|
-
receivedAt: new Date(),
|
|
224
|
+
receivedAt: new Date().toISOString(),
|
|
225
225
|
...(storeRawActivities ? { raw: activity } : {}),
|
|
226
226
|
});
|
|
227
227
|
|
package/lib/inbox.js
CHANGED
|
@@ -63,7 +63,7 @@ async function handleFollow(activity, collections, context) {
|
|
|
63
63
|
avatar: profile.icon?.url || "",
|
|
64
64
|
inbox: profile.inbox || "",
|
|
65
65
|
sharedInbox: profile.endpoints?.sharedInbox || "",
|
|
66
|
-
followedAt: new Date(),
|
|
66
|
+
followedAt: new Date().toISOString(),
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
{ upsert: true },
|
|
@@ -286,6 +286,6 @@ async function logActivity(collections, context, record) {
|
|
|
286
286
|
await collections.ap_activities.insertOne({
|
|
287
287
|
...rest,
|
|
288
288
|
...(context.storeRawActivities ? { raw } : {}),
|
|
289
|
-
receivedAt: new Date(),
|
|
289
|
+
receivedAt: new Date().toISOString(),
|
|
290
290
|
});
|
|
291
291
|
}
|
package/lib/keys.js
CHANGED
|
@@ -32,7 +32,7 @@ export async function getOrCreateKeyPair(collection, actorUrl) {
|
|
|
32
32
|
actorUrl,
|
|
33
33
|
publicKeyPem: publicKey,
|
|
34
34
|
privateKeyPem: privateKey,
|
|
35
|
-
createdAt: new Date(),
|
|
35
|
+
createdAt: new Date().toISOString(),
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
return { publicKeyPem: publicKey, privateKeyPem: privateKey };
|
package/lib/migration.js
CHANGED
|
@@ -121,7 +121,7 @@ export async function bulkImportFollowing(handles, collection) {
|
|
|
121
121
|
name: resolved.name,
|
|
122
122
|
inbox: resolved.inbox,
|
|
123
123
|
sharedInbox: resolved.sharedInbox,
|
|
124
|
-
followedAt: new Date(),
|
|
124
|
+
followedAt: new Date().toISOString(),
|
|
125
125
|
source: "import",
|
|
126
126
|
},
|
|
127
127
|
},
|
|
@@ -171,7 +171,7 @@ export async function bulkImportFollowers(entries, collection) {
|
|
|
171
171
|
name: actorData.name,
|
|
172
172
|
inbox: actorData.inbox,
|
|
173
173
|
sharedInbox: actorData.sharedInbox,
|
|
174
|
-
followedAt: new Date(),
|
|
174
|
+
followedAt: new Date().toISOString(),
|
|
175
175
|
pending: true, // Will be confirmed when they re-follow after Move
|
|
176
176
|
},
|
|
177
177
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indiekit",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|