Add docker publish flow, node blocklist & API updates
Replace docker/metadata GH Action with a docker-publish.sh driven workflow (supports auto-versioning, extra tags, multi-arch builds and optional builder). Update docs and READMEs to use the updater and new publish flow. Add server-side swarm/node blocklist support and admin nodes API. Improve auth endpoints (me, logout, switch, session accounts) and support account switching. Extend bots API to support custom LLM provider and optional endpoint. Enforce node blocklist on chat send/receive, refactor link preview handling into dedicated preview modules, and enhance notifications and posts like/repost handlers to accept both signed actions and regular auth flows. Misc: remove admin update UI details, add helper libs (media previews, node-blocklist, reposts, notifications, etc.), and minor housekeeping (pyc, workflow tweaks).
This commit is contained in:
@@ -11,6 +11,7 @@ import { eq, desc, and, sql } from 'drizzle-orm';
|
||||
import { z } from 'zod';
|
||||
import { verifySwarmRequest } from '@/lib/swarm/signature';
|
||||
import { upsertRemoteUser } from '@/lib/swarm/user-cache';
|
||||
import { buildNotificationTarget } from '@/lib/notifications';
|
||||
|
||||
// Schema for incoming swarm reply
|
||||
const swarmReplySchema = z.object({
|
||||
@@ -145,6 +146,8 @@ export async function POST(request: NextRequest) {
|
||||
|
||||
await syncParentReplyCount(data.postId);
|
||||
|
||||
const parentAuthor = parentPost.author as { isBot?: boolean; botOwnerId?: string; handle?: string; displayName?: string | null; avatarUrl?: string | null } | null;
|
||||
|
||||
if (parentPost.userId !== remoteUser.id) {
|
||||
await db.insert(notifications).values({
|
||||
userId: parentPost.userId,
|
||||
@@ -154,8 +157,23 @@ export async function POST(request: NextRequest) {
|
||||
actorNodeDomain: sourceDomain,
|
||||
postId: data.postId,
|
||||
postContent: data.reply.content.slice(0, 200),
|
||||
...(parentAuthor?.isBot ? buildNotificationTarget(parentAuthor as any) : {}),
|
||||
type: 'reply',
|
||||
});
|
||||
|
||||
if (parentAuthor?.isBot && parentAuthor.botOwnerId) {
|
||||
await db.insert(notifications).values({
|
||||
userId: parentAuthor.botOwnerId,
|
||||
actorHandle: data.reply.author.handle,
|
||||
actorDisplayName: data.reply.author.displayName || data.reply.author.handle,
|
||||
actorAvatarUrl: data.reply.author.avatarUrl || null,
|
||||
actorNodeDomain: sourceDomain,
|
||||
postId: data.postId,
|
||||
postContent: data.reply.content.slice(0, 200),
|
||||
...buildNotificationTarget(parentAuthor as any),
|
||||
type: 'reply',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return NextResponse.json({ success: true, message: 'Reply received' });
|
||||
|
||||
Reference in New Issue
Block a user