@rmdes/indiekit-endpoint-activitypub 0.1.2 → 0.1.4
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 +4 -4
- 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/locales/en.json +20 -18
- package/package.json +1 -1
- package/views/{dashboard.njk → activitypub-dashboard.njk} +1 -1
- /package/views/{activities.njk → activitypub-activities.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,8 +15,8 @@ import {
|
|
|
15
15
|
export function migrateGetController(mountPath) {
|
|
16
16
|
return async (request, response, next) => {
|
|
17
17
|
try {
|
|
18
|
-
response.render("migrate", {
|
|
19
|
-
title: response.locals.__("activitypub.migrate"),
|
|
18
|
+
response.render("activitypub-migrate", {
|
|
19
|
+
title: response.locals.__("activitypub.migrate.title"),
|
|
20
20
|
mountPath,
|
|
21
21
|
result: null,
|
|
22
22
|
});
|
|
@@ -91,8 +91,8 @@ export function migratePostController(mountPath, pluginOptions) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
response.render("migrate", {
|
|
95
|
-
title: response.locals.__("activitypub.migrate"),
|
|
94
|
+
response.render("activitypub-migrate", {
|
|
95
|
+
title: response.locals.__("activitypub.migrate.title"),
|
|
96
96
|
mountPath,
|
|
97
97
|
result,
|
|
98
98
|
});
|
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/locales/en.json
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
"followers": "Followers",
|
|
5
5
|
"following": "Following",
|
|
6
6
|
"activities": "Activity log",
|
|
7
|
-
"migrate": "Mastodon migration",
|
|
8
7
|
"recentActivity": "Recent activity",
|
|
9
8
|
"noActivity": "No activity yet. Once your actor is federated, interactions will appear here.",
|
|
10
9
|
"noFollowers": "No followers yet.",
|
|
@@ -20,22 +19,25 @@
|
|
|
20
19
|
"direction": "Direction",
|
|
21
20
|
"directionInbound": "Received",
|
|
22
21
|
"directionOutbound": "Sent",
|
|
23
|
-
"migrate
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
"migrate": {
|
|
23
|
+
"title": "Mastodon migration",
|
|
24
|
+
"step1Title": "Step 1 — Configure actor alias",
|
|
25
|
+
"step1Desc": "Link your old Mastodon account to this actor so the fediverse knows they are the same person.",
|
|
26
|
+
"aliasLabel": "Your old Mastodon account URL",
|
|
27
|
+
"aliasHint": "e.g. https://mstdn.social/users/rmdes — sets alsoKnownAs on your actor",
|
|
28
|
+
"aliasSave": "Save alias",
|
|
29
|
+
"step2Title": "Step 2 — Import followers/following",
|
|
30
|
+
"step2Desc": "Upload your Mastodon data export CSV to import your social graph.",
|
|
31
|
+
"importLabel": "Import followers and following",
|
|
32
|
+
"fileLabel": "Mastodon export CSV",
|
|
33
|
+
"fileHint": "Upload following_accounts.csv from your Mastodon data export",
|
|
34
|
+
"importButton": "Import",
|
|
35
|
+
"importFollowing": "Import following list",
|
|
36
|
+
"importFollowers": "Import followers list (pending until they re-follow after Move)",
|
|
37
|
+
"step3Title": "Step 3 — Trigger Move on Mastodon",
|
|
38
|
+
"step3Desc": "Go to your Mastodon instance → Preferences → Account → Move to a different account. Enter your new handle and confirm. After the Move, followers will automatically re-follow you here.",
|
|
39
|
+
"success": "Imported %d following, %d followers (%d failed).",
|
|
40
|
+
"aliasSuccess": "Actor alias updated."
|
|
41
|
+
}
|
|
40
42
|
}
|
|
41
43
|
}
|
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.4",
|
|
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
|