refactor: Migrate from ActivityPub federation to native Swarm network

- Remove ActivityPub infrastructure (webfinger, nodeinfo, inbox, activities, signatures)
- Implement native peer-to-peer Swarm network with gossip protocol
- Replace federated timeline with Swarm timeline aggregating posts from all nodes
- Migrate direct messaging to end-to-end encrypted Swarm Chat system
- Update user interactions (follow, like, repost) to use Swarm protocol
- Add cryptographic key management for DID-based identity system
- Remove server-bound identity model in favor of portable DID identities
- Update documentation to reflect Swarm architecture and capabilities
- Add debug utilities and chat testing tools for Swarm network
- Refactor database schema to support distributed user directory
- Update bot framework to work with Swarm network interactions
- Simplify API routes to use Swarm protocol instead of ActivityPub
- This transition enables true peer-to-peer communication, instant interactions, and encrypted messaging while maintaining sovereign identity through DIDs
This commit is contained in:
Christomatt
2026-01-27 01:27:15 +01:00
parent 6b8eeb6814
commit eb63194c56
49 changed files with 1173 additions and 3559 deletions
-16
View File
@@ -1,16 +0,0 @@
import { NextResponse } from 'next/server';
export async function GET() {
const nodeDomain = process.env.NEXT_PUBLIC_NODE_DOMAIN || 'localhost:3000';
const nodeName = process.env.NEXT_PUBLIC_NODE_NAME || 'Synapsis Node';
const nodeDescription = process.env.NEXT_PUBLIC_NODE_DESCRIPTION || 'A Synapsis federated social network node';
return NextResponse.json({
links: [
{
rel: 'http://nodeinfo.diaspora.software/ns/schema/2.1',
href: `https://${nodeDomain}/nodeinfo/2.1`,
},
],
});
}
-56
View File
@@ -1,56 +0,0 @@
import { NextResponse } from 'next/server';
import { db, users } from '@/db';
import { eq } from 'drizzle-orm';
import { generateWebFingerResponse, parseWebFingerResource } from '@/lib/activitypub/webfinger';
export async function GET(request: Request) {
const { searchParams } = new URL(request.url);
const resource = searchParams.get('resource');
if (!resource) {
return NextResponse.json(
{ error: 'Missing resource parameter' },
{ status: 400 }
);
}
const parsed = parseWebFingerResource(resource);
if (!parsed) {
return NextResponse.json(
{ error: 'Invalid resource format' },
{ status: 400 }
);
}
const nodeDomain = process.env.NEXT_PUBLIC_NODE_DOMAIN || 'localhost:3000';
// Check if this is our domain
if (parsed.domain !== nodeDomain && parsed.domain !== nodeDomain.replace(/:\d+$/, '')) {
return NextResponse.json(
{ error: 'Resource not found' },
{ status: 404 }
);
}
// Find the user
const user = await db.query.users.findFirst({
where: eq(users.handle, parsed.handle.toLowerCase()),
});
if (!user) {
return NextResponse.json(
{ error: 'User not found' },
{ status: 404 }
);
}
const response = generateWebFingerResponse(user.handle, nodeDomain);
return NextResponse.json(response, {
headers: {
'Content-Type': 'application/jrd+json',
'Access-Control-Allow-Origin': '*',
},
});
}