@rmdes/indiekit-endpoint-activitypub 1.0.7 → 1.0.9
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/lib/federation-setup.js +18 -1
- package/package.json +1 -1
package/lib/federation-setup.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* and inbox.js with Fedify's battle-tested implementations.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
9
10
|
import { Temporal } from "@js-temporal/polyfill";
|
|
10
11
|
import {
|
|
11
12
|
Endpoints,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
createFederation,
|
|
17
18
|
importSpki,
|
|
18
19
|
} from "@fedify/fedify";
|
|
19
|
-
import { configure, getConsoleSink
|
|
20
|
+
import { configure, getConsoleSink } from "@logtape/logtape";
|
|
20
21
|
import { MongoKvStore } from "./kv-store.js";
|
|
21
22
|
import { registerInboxListeners } from "./inbox-listeners.js";
|
|
22
23
|
|
|
@@ -45,6 +46,7 @@ export function setupFederation(options) {
|
|
|
45
46
|
if (!_logtapeConfigured) {
|
|
46
47
|
_logtapeConfigured = true;
|
|
47
48
|
configure({
|
|
49
|
+
contextLocalStorage: new AsyncLocalStorage(),
|
|
48
50
|
sinks: {
|
|
49
51
|
console: getConsoleSink(),
|
|
50
52
|
},
|
|
@@ -162,6 +164,13 @@ export function setupFederation(options) {
|
|
|
162
164
|
storeRawActivities,
|
|
163
165
|
});
|
|
164
166
|
|
|
167
|
+
// Enable authenticated fetches for the shared inbox.
|
|
168
|
+
// Without this, Fedify can't verify incoming HTTP Signatures from servers
|
|
169
|
+
// that require authorized fetch (e.g. hachyderm.io returns 401 on unsigned GETs).
|
|
170
|
+
// This tells Fedify to use our actor's key pair when fetching remote actor
|
|
171
|
+
// documents during signature verification on the shared inbox.
|
|
172
|
+
inboxChain.setSharedKeyDispatcher((_ctx) => ({ identifier: handle }));
|
|
173
|
+
|
|
165
174
|
// --- Collection dispatchers ---
|
|
166
175
|
setupFollowers(federation, mountPath, handle, collections);
|
|
167
176
|
setupFollowing(federation, mountPath, handle, collections);
|
|
@@ -187,6 +196,14 @@ export function setupFederation(options) {
|
|
|
187
196
|
};
|
|
188
197
|
});
|
|
189
198
|
|
|
199
|
+
// Start the message queue for outbound activity delivery.
|
|
200
|
+
// Without this, ctx.sendActivity() enqueues delivery tasks but the
|
|
201
|
+
// InProcessMessageQueue never processes them — activities are never
|
|
202
|
+
// actually POSTed to follower inboxes.
|
|
203
|
+
federation.startQueue().catch((error) => {
|
|
204
|
+
console.error("[ActivityPub] Failed to start delivery queue:", error.message);
|
|
205
|
+
});
|
|
206
|
+
|
|
190
207
|
return { federation };
|
|
191
208
|
}
|
|
192
209
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
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",
|