Public-release prep: ELv2 license, README/CLA/NOTICE, SSRF safeFetch, identifier genericization, export tooling

This commit is contained in:
Jannis Braun
2026-06-22 16:04:03 +02:00
parent c0a6477059
commit 8dd76f3435
44 changed files with 1272 additions and 267 deletions
@@ -52,11 +52,11 @@ beforeEach(() => {
testDb = drizzle(sqlite, { schema });
applyMigrations(sqlite);
sentToUserCalls.length = 0;
// Local user (youruser) and replicated stub (pbtest3) — they're friends.
// Local user (erin) and replicated stub (pbtest3) — they're friends.
testDb.insert(schema.users).values([
{
id: 'local-youruser', username: 'youruser', passwordHash: 'x', status: 'online', isAdmin: 0,
homeUserId: 'local-youruser', createdAt: Date.now(),
id: 'local-erin', username: 'erin', passwordHash: 'x', status: 'online', isAdmin: 0,
homeUserId: 'local-erin', createdAt: Date.now(),
},
{
id: 'stub-pbtest3', username: 'pbtest3@orbit.ddns.net', displayName: 'pbtest3',
@@ -65,7 +65,7 @@ beforeEach(() => {
},
]).run();
testDb.insert(schema.friends).values({
userId: 'local-youruser', friendId: 'stub-pbtest3', createdAt: Date.now(),
userId: 'local-erin', friendId: 'stub-pbtest3', createdAt: Date.now(),
}).run();
});
@@ -94,7 +94,7 @@ describe('processPresenceUpdateEvent', () => {
const row = testDb.select().from(schema.users).where(eq(schema.users.id, 'stub-pbtest3')).get();
expect(row!.status).toBe('online');
const broadcast = sentToUserCalls.find((c) => c.userId === 'local-youruser');
const broadcast = sentToUserCalls.find((c) => c.userId === 'local-erin');
expect(broadcast).toBeDefined();
expect(broadcast!.payload.type).toBe('presence_update');
expect(broadcast!.payload.userId).toBe('stub-pbtest3');
@@ -160,7 +160,7 @@ describe('processPresenceUpdateEvent', () => {
},
};
fed.processPresenceUpdateEvent(event, 'orbit.ddns.net', testDb, [], []);
const broadcast = sentToUserCalls.find((c) => c.userId === 'local-youruser');
const broadcast = sentToUserCalls.find((c) => c.userId === 'local-erin');
expect(broadcast!.payload.activities).toEqual([{ type: 'playing', name: 'Test' }]);
});
});
+2 -2
View File
@@ -2566,7 +2566,7 @@ export async function federationRoutes(app: FastifyInstance): Promise<void> {
// 4. Query mutation log for the relevant channels
// Return mutations for ALL locally-created messages (source_instance IS NULL).
// This includes messages by replicated users (e.g., Jannis browsing orbit)
// This includes messages by replicated users (e.g., Heidi browsing orbit)
// because they were created on THIS instance and need to be synced to the peer.
if (effectiveChannelFilter) {
// Validate that the requested channel is actually shared with this peer
@@ -3111,7 +3111,7 @@ export function extractDomain(homeInstance: string): string {
* Two valid cases:
* 1. **Direct**: author is from the source instance (standard S2S — peer sends events for its own users).
* 2. **Homeward relay**: author is from the *receiving* instance. This happens when a client-federation
* user (e.g., youruser@nova logged into orbit) sends a message on a remote server, and the
* user (e.g., erin@nova logged into orbit) sends a message on a remote server, and the
* S2S relay forwards it back to the author's home instance. The trusted peer is just the messenger.
*
* Both sides are normalized to bare domain before comparison.