Changeset bbce8da in Klonkt
- Timestamp:
- 06/26/2026 12:50:25 PM (2 months ago)
- Branches:
- main
- Children:
- c7c7f02
- Parents:
- 4c47eff
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r4c47eff rbbce8da 569 569 const act = req.body || {}; 570 570 const type = act.type; 571 // Real client IP (behind the proxy via `trust proxy`) — logged on dropped/rejected/ 572 // ignored inbox hits so an operator can see who is probing their fediverse inbox. 573 const ip = req.ip || (req.connection && req.connection.remoteAddress) || '?'; 571 574 const base = (process.env.PUBLIC_BASE_URL || `${req.protocol}://${req.get('host')}`).replace(/\/+$/, ''); 572 575 const verified = await verifyRequest(req).catch(() => null); … … 577 580 const claimedActor = typeof act.actor === 'string' ? act.actor : (act.actor && act.actor.id); 578 581 // Blocked actor/domain → silently drop (202, don't reveal the block). 579 if (claimedActor && isBlockedAny(claimedActor)) { console.log('[AP] inbox dropped (blocked)', claimedActor ); return 202; }582 if (claimedActor && isBlockedAny(claimedActor)) { console.log('[AP] inbox dropped (blocked)', claimedActor, 'from', ip); return 202; } 580 583 const GATED = ['Create', 'Like', 'Announce', 'Follow', 'Delete', 'Undo', 'Accept', 'Reject', 'Add', 'Remove', 'Update']; 581 584 if (GATED.includes(type)) { 582 585 if (!verified || !claimedActor || verified.id !== claimedActor) { 583 console.warn('[AP] inbox REJECTED (signature)', type, claimedActor || '?', verified ? '(signer mismatch)' : '(unsigned/invalid)');586 console.warn('[AP] inbox REJECTED (signature)', type, claimedActor || '?', 'from', ip, verified ? '(signer mismatch)' : '(unsigned/invalid)'); 584 587 return 401; 585 588 } … … 708 711 } 709 712 710 console.log('[AP] inbox', type || 'unknown', '→', slugParam || 'shared', ' (ignored)');713 console.log('[AP] inbox', type || 'unknown', '→', slugParam || 'shared', 'from', ip, '(ignored)'); 711 714 return 202; 712 715 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)