fix: multiple federation peering bugs
1. queueOutboxEvent no longer creates pending peer placeholders when autoAcceptPeering is disabled — prevents bypassing the admin's peering control 2. Approval endpoint checks for 202 before response.ok — when the remote also has autoAcceptPeering off, sets peer to awaiting_approval instead of incorrectly activating it 3. awaiting_approval status added to Federation panel UI — status label, colors, filter options so these peers are visible and manageable
This commit is contained in:
@@ -152,12 +152,23 @@ export function queueOutboxEvent(
|
||||
: peers;
|
||||
|
||||
// For targeted origins with no existing peer record, create pending placeholders
|
||||
// (only when autoAcceptPeering is enabled — otherwise the admin controls all peering)
|
||||
if (targetPeerOrigins) {
|
||||
const autoAcceptSettings = db
|
||||
.select({ autoAcceptPeering: schema.instanceSettings.autoAcceptPeering })
|
||||
.from(schema.instanceSettings)
|
||||
.where(eq(schema.instanceSettings.id, 1))
|
||||
.get();
|
||||
const autoAcceptPeering = (autoAcceptSettings?.autoAcceptPeering ?? 1) === 1;
|
||||
|
||||
const matchedOrigins = new Set(matchedPeers.map(p => p.origin));
|
||||
|
||||
for (const origin of targetPeerOrigins) {
|
||||
if (matchedOrigins.has(origin)) continue;
|
||||
|
||||
// Don't auto-create placeholders when autoAcceptPeering is off
|
||||
if (!autoAcceptPeering) continue;
|
||||
|
||||
// Check if there's a rejected/revoked peer we should skip
|
||||
const existingPeer = db
|
||||
.select({ status: schema.federationPeers.status })
|
||||
|
||||
Reference in New Issue
Block a user