mirror of
https://github.com/svemagie/indiekit-endpoint-microsub.git
synced 2026-04-02 15:35:00 +02:00
feat: add ActivityPub integration - actor profiles, follow/unfollow, timeline items
- Add actor profile page with outbox fetcher for viewing AP actor posts - Add follow/unfollow buttons on actor profile (delegates to AP plugin) - Add AP actor link on item cards for posts from ActivityPub sources - Add ensureActivityPubChannel() for auto-creating Fediverse channel - Add AP-aware item storage with dedup, attachments, and categories - Add CSS styles for actor profile cards and AP-specific UI elements - Bump version to 1.0.31
This commit is contained in:
12
index.js
12
index.js
@@ -8,6 +8,7 @@ import { opmlController } from "./lib/controllers/opml.js";
|
||||
import { readerController } from "./lib/controllers/reader.js";
|
||||
import { handleMediaProxy } from "./lib/media/proxy.js";
|
||||
import { startScheduler, stopScheduler } from "./lib/polling/scheduler.js";
|
||||
import { ensureActivityPubChannel } from "./lib/storage/channels.js";
|
||||
import { cleanupAllReadItems, createIndexes } from "./lib/storage/items.js";
|
||||
import { webmentionReceiver } from "./lib/webmention/receiver.js";
|
||||
import { websubHandler } from "./lib/websub/handler.js";
|
||||
@@ -126,6 +127,9 @@ export default class MicrosubEndpoint {
|
||||
readerRouter.get("/search", readerController.searchPage);
|
||||
readerRouter.post("/search", readerController.searchFeeds);
|
||||
readerRouter.post("/subscribe", readerController.subscribe);
|
||||
readerRouter.get("/actor", readerController.actorProfile);
|
||||
readerRouter.post("/actor/follow", readerController.followActorAction);
|
||||
readerRouter.post("/actor/unfollow", readerController.unfollowActorAction);
|
||||
readerRouter.post("/api/mark-read", readerController.markAllRead);
|
||||
readerRouter.get("/opml", opmlController.exportOpml);
|
||||
router.use("/reader", readerRouter);
|
||||
@@ -184,6 +188,14 @@ export default class MicrosubEndpoint {
|
||||
console.info("[Microsub] Database available, starting scheduler");
|
||||
startScheduler(indiekit);
|
||||
|
||||
// Ensure system channels exist
|
||||
ensureActivityPubChannel(indiekit).catch((error) => {
|
||||
console.warn(
|
||||
"[Microsub] ActivityPub channel creation failed:",
|
||||
error.message,
|
||||
);
|
||||
});
|
||||
|
||||
// Create indexes for optimal performance (runs in background)
|
||||
createIndexes(indiekit).catch((error) => {
|
||||
console.warn("[Microsub] Index creation failed:", error.message);
|
||||
|
||||
Reference in New Issue
Block a user