@rmdes/indiekit-endpoint-activitypub 2.0.0 → 2.0.2
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/README.md +18 -1
- package/lib/controllers/compose.js +9 -0
- package/lib/federation-bridge.js +20 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @rmdes/indiekit-endpoint-activitypub
|
|
2
2
|
|
|
3
|
-
ActivityPub federation endpoint for [Indiekit](https://getindiekit.com). Makes your IndieWeb site a full fediverse actor — discoverable, followable, and interactive from Mastodon, Misskey, Pixelfed, and any ActivityPub-compatible platform.
|
|
3
|
+
ActivityPub federation endpoint for [Indiekit](https://getindiekit.com), built on [Fedify](https://fedify.dev) 2.0. Makes your IndieWeb site a full fediverse actor — discoverable, followable, and interactive from Mastodon, Misskey, Pixelfed, and any ActivityPub-compatible platform.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -34,6 +34,17 @@ ActivityPub federation endpoint for [Indiekit](https://getindiekit.com). Makes y
|
|
|
34
34
|
- Batch re-follow processor — gradually sends Follow activities to imported accounts
|
|
35
35
|
- Progress tracking with pause/resume controls
|
|
36
36
|
|
|
37
|
+
**Public Profile**
|
|
38
|
+
- Standalone profile page at the actor URL (HTML fallback for browsers)
|
|
39
|
+
- Shows avatar, bio, profile fields, follower/following/post counts, and follow prompt
|
|
40
|
+
- Dark mode support via system preference
|
|
41
|
+
|
|
42
|
+
**Debug Dashboard**
|
|
43
|
+
- Optional [Fedify Debugger](https://github.com/fedify-dev/debugger) integration
|
|
44
|
+
- Password-protected dashboard at `{mountPath}/__debug__/`
|
|
45
|
+
- OpenTelemetry tracing for federation activity
|
|
46
|
+
- Real-time activity inspection
|
|
47
|
+
|
|
37
48
|
**Admin UI**
|
|
38
49
|
- Dashboard with follower/following counts and recent activity
|
|
39
50
|
- Profile editor (name, bio, avatar, header, profile links with rel="me" verification)
|
|
@@ -45,6 +56,7 @@ ActivityPub federation endpoint for [Indiekit](https://getindiekit.com). Makes y
|
|
|
45
56
|
## Requirements
|
|
46
57
|
|
|
47
58
|
- [Indiekit](https://getindiekit.com) v1.0.0-beta.25+
|
|
59
|
+
- [Fedify](https://fedify.dev) 2.0+ (bundled as dependency)
|
|
48
60
|
- Node.js >= 22
|
|
49
61
|
- MongoDB (used by Indiekit)
|
|
50
62
|
- Redis (recommended for production delivery queue; in-process queue available for development)
|
|
@@ -95,6 +107,9 @@ export default {
|
|
|
95
107
|
| `actorType` | string | `"Person"` | Actor type: `Person`, `Service`, `Organization`, or `Group` |
|
|
96
108
|
| `logLevel` | string | `"warning"` | Fedify log level: `"debug"`, `"info"`, `"warning"`, `"error"`, `"fatal"` |
|
|
97
109
|
| `timelineRetention` | number | `1000` | Maximum timeline items to keep (0 = unlimited) |
|
|
110
|
+
| `notificationRetentionDays` | number | `30` | Days to keep notifications (0 = forever) |
|
|
111
|
+
| `debugDashboard` | boolean | `false` | Enable Fedify debug dashboard at `{mountPath}/__debug__/` |
|
|
112
|
+
| `debugPassword` | string | `""` | Password for the debug dashboard (required if dashboard enabled) |
|
|
98
113
|
|
|
99
114
|
### Redis (Recommended for Production)
|
|
100
115
|
|
|
@@ -216,6 +231,8 @@ All admin pages are behind IndieAuth authentication:
|
|
|
216
231
|
| Pinned Posts | `/activitypub/admin/featured` | Pin/unpin posts to your featured collection |
|
|
217
232
|
| Featured Tags | `/activitypub/admin/tags` | Add/remove featured hashtags |
|
|
218
233
|
| Migration | `/activitypub/admin/migrate` | Mastodon import wizard |
|
|
234
|
+
| Public Profile | `/activitypub/users/{handle}` | Public-facing profile page (no auth) |
|
|
235
|
+
| Debug Dashboard | `/activitypub/__debug__/` | Fedify debugger (password-protected, if enabled) |
|
|
219
236
|
|
|
220
237
|
## MongoDB Collections
|
|
221
238
|
|
|
@@ -301,6 +301,15 @@ export function submitComposeController(mountPath, plugin) {
|
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
+
console.info(
|
|
305
|
+
`[ActivityPub] Compose Micropub submission:`,
|
|
306
|
+
JSON.stringify({
|
|
307
|
+
syndicateTo: syndicateTo || "(none)",
|
|
308
|
+
micropubBody: micropubData.toString(),
|
|
309
|
+
micropubUrl,
|
|
310
|
+
}),
|
|
311
|
+
);
|
|
312
|
+
|
|
304
313
|
const micropubResponse = await fetch(micropubUrl, {
|
|
305
314
|
method: "POST",
|
|
306
315
|
headers: {
|
package/lib/federation-bridge.js
CHANGED
|
@@ -28,14 +28,29 @@ export function fromExpressRequest(req) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
let body;
|
|
32
|
+
if (req.method === "GET" || req.method === "HEAD") {
|
|
33
|
+
body = undefined;
|
|
34
|
+
} else if (!req.readable && req.body) {
|
|
35
|
+
// Express body parser already consumed the stream — reconstruct
|
|
36
|
+
// so downstream handlers (e.g. @fedify/debugger login) can read it.
|
|
37
|
+
const ct = req.headers["content-type"] || "";
|
|
38
|
+
if (ct.includes("application/json")) {
|
|
39
|
+
body = JSON.stringify(req.body);
|
|
40
|
+
} else if (ct.includes("application/x-www-form-urlencoded")) {
|
|
41
|
+
body = new URLSearchParams(req.body).toString();
|
|
42
|
+
} else {
|
|
43
|
+
body = undefined;
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
body = Readable.toWeb(req);
|
|
47
|
+
}
|
|
48
|
+
|
|
31
49
|
return new Request(url, {
|
|
32
50
|
method: req.method,
|
|
33
51
|
headers,
|
|
34
52
|
duplex: "half",
|
|
35
|
-
body
|
|
36
|
-
req.method === "GET" || req.method === "HEAD"
|
|
37
|
-
? undefined
|
|
38
|
-
: Readable.toWeb(req),
|
|
53
|
+
body,
|
|
39
54
|
});
|
|
40
55
|
}
|
|
41
56
|
|
|
@@ -52,7 +67,7 @@ async function sendFedifyResponse(res, response, request) {
|
|
|
52
67
|
res.setHeader(key, value);
|
|
53
68
|
});
|
|
54
69
|
|
|
55
|
-
if (!response.body) {
|
|
70
|
+
if (!response.body || response.bodyUsed) {
|
|
56
71
|
res.end();
|
|
57
72
|
return;
|
|
58
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
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",
|