summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors/InboxProcessorService.ts (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix type errors with JsonLdService and remove unused factory patternHazelnoot2025-06-091-9/+6
|
* more use of identifiable errors, improvements to inner error rendering, and ↵Hazelnoot2025-06-061-1/+1
| | | | more heuristics for is-retryable-error
* add renderInlineError to serialize errors in a consistent wayHazelnoot2025-06-061-17/+2
|
* recognize more retryable errors when resolving actor for signature verificationHazelnoot2025-06-061-5/+4
|
* ensure that permanent errors always terminate the inbox jobHazelnoot2025-06-061-0/+9
|
* verify type of activity.actor before processing activityHazelnoot2025-06-031-8/+16
|
* lint and type fixesHazelnoot2025-04-011-3/+0
|
* merge upstreamHazelnoot2025-03-251-2/+2
|\
| * tweak error logsyuilo2025-02-171-2/+2
| |
| * Merge commit from forkJulia2024-11-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * enhance: Add a few validation fixes from Sharkey See the original MR on the GitLab instance: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/484 Co-Authored-By: Dakkar <dakkar@thenautilus.net> * fix: primitive 2: acceptance of cross-origin alternate Co-Authored-By: Laura Hausmann <laura@hausmann.dev> * fix: primitive 3: validation of non-final url * fix: primitive 4: missing same-origin identifier validation of collection-wrapped activities * fix: primitives 5 & 8: reject activities with non string identifiers Co-Authored-By: Laura Hausmann <laura@hausmann.dev> * fix: primitive 6: reject anonymous objects that were fetched by their id * fix: primitives 9, 10 & 11: http signature validation doesn't enforce required headers or specify auth header name Co-Authored-By: Laura Hausmann <laura@hausmann.dev> * fix: primitive 14: improper validation of outbox, followers, following & shared inbox collections * fix: code style for primitive 14 * fix: primitive 15: improper same-origin validation for note uri and url Co-Authored-By: Laura Hausmann <laura@hausmann.dev> * fix: primitive 16: improper same-origin validation for user uri and url * fix: primitive 17: note same-origin identifier validation can be bypassed by wrapping the id in an array * fix: code style for primitive 17 * fix: check attribution against actor in notes While this isn't strictly required to fix the exploits at hand, this mirrors the fix in `ApQuestionService` for GHSA-5h8r-gq97-xv69, as a preemptive countermeasure. * fix: primitive 18: `ap/get` bypasses access checks One might argue that we could make this one actually preform access checks against the returned activity object, but I feel like that's a lot more work than just restricting it to administrators, since, to me at least, it seems more like a debugging tool than anything else. * fix: primitive 19 & 20: respect blocks and hide more Ideally, the user property should also be hidden (as leaving it in leaks information slightly), but given the schema of the note endpoint, I don't think that would be possible without introducing some kind of "ghost" user, who is attributed for posts by users who have you blocked. * fix: primitives 21, 22, and 23: reuse resolver This also increases the default `recursionLimit` for `Resolver`, as it theoretically will go higher that it previously would and could possibly fail on non-malicious collection activities. * fix: primitives 25-33: proper local instance checks * revert: fix: primitive 19 & 20 This reverts commit 465a9fe6591de90f78bd3d084e3c01e65dc3cf3c. --------- Co-authored-by: Dakkar <dakkar@thenautilus.net> Co-authored-by: Laura Hausmann <laura@hausmann.dev> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
* | fix startup crash caused by circular reference (SWC is not compatible with ↵Hazelnoot2025-03-211-10/+8
| | | | | | | | forwardRef)
* | support Announce(Activity) activitiesHazelnoot2025-03-211-2/+4
| |
* | fix typo in activity signature mismatch errorHazelnoot2025-03-211-1/+1
| |
* | don't log slow activities, as this is known to happen under regular ↵Hazelnoot2025-02-161-8/+1
| | | | | | | | circumstances
* | implement AP fetch logsHazelnoot2025-02-161-72/+10
| |
* | rename activity_log and activity_context to ap_inbox_log and ap_contextHazelnoot2025-02-161-15/+15
| |
* | fix activity duration calculationHazelnoot2025-02-161-10/+17
| | | | | | | | | | * Ensure that timing is recorded even if an exception is thrown. * Round to the correct decimal place.
* | print warning when activity processing exceeds 10 seondsHazelnoot2025-02-161-0/+3
| |
* | log inbound activity durationHazelnoot2025-02-161-2/+8
| |
* | add inbound activity logger for debuggingHazelnoot2025-02-161-0/+102
| |
* | add IdentifiableError.isRetryable to ensure that Identifiable Errors can ↵Hazelnoot2025-02-031-0/+8
| | | | | | | | still terminate a batch process
* | rethrow everything but non-retryable HTTP errorsdakkar2024-12-221-11/+2
| | | | | | | | | | every job that ends without an exception will be considered "completed" and not retried
* | Merge branch 'develop' into feature/2024.10dakkar2024-11-291-1/+5
|\ \
| * \ merge: Clear jobs from blocked domains (resolves #773) (!720)Hazelnoot2024-11-291-1/+5
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/720 Closes #773 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
| | * | clarify logging when an inbox job is skipped or failsHazelnoot2024-11-261-1/+5
| | | |
* | | | Merge branch 'develop' into feature/2024.10dakkar2024-11-281-1/+2
|\| | |
| * | | allow anonymous activities (resolves #819)Hazelnoot2024-11-261-1/+2
| |/ /
* | | Merge branch 'develop' into feature/2024.10dakkar2024-11-231-0/+14
|\| |
| * | reduce inbox log spam when fetching blocked / unavailable notesHazelnoot2024-11-221-0/+14
| | |
* | | Merge branch 'develop' into feature/2024.10dakkar2024-11-221-0/+2
|\| |
| * | Fix style errorJulia Johannesen2024-11-201-2/+1
| | |
| * | fix: primitives 5 & 8: reject activities with non-string identifiersLaura Hausmann2024-11-201-0/+3
| | |
* | | Merge tag '2024.10.1' into feature/2024.10dakkar2024-11-081-8/+14
|\ \ \ | |/ / |/| / | |/
| * feat: ↵syuilo2024-10-131-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | リモートサーバーのサーバー情報を収集しないオプション (#14634) * wip * wip * Update FetchInstanceMetadataService.ts * Update FetchInstanceMetadataService.ts * Update types.ts
| * fix(backend/test): #14558 ↵かっこかり2024-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | 以降e2eテストがたまに失敗する問題を修正 (#14709) * fix(backend/test): MisskeyIO#727 以降e2eテストがたまに失敗する問題を修正 (MisskeyIO#735) * :v: --------- Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
* | normalize re-fetch logic between InboxProcessorService and ↵Hazelnoot2024-10-261-0/+1
| | | | | | | | ActivityPubServerService
* | fix public key re-fetch logicHazelnoot2024-10-261-11/+7
| |
* | Merge remote-tracking branch 'misskey/master' into feature/2024.9.0dakkar2024-10-091-14/+53
|\|
| * wip (#14643)syuilo2024-09-281-4/+2
| |
| * perf(backend): Defer instance metadata update (#14558)KOBA7892024-09-261-8/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Defer instance metadata update * Fix last new line * Fix typo * Add license notice * Fix syntax * Perform deferred jobs on shutdown * Fix missing async/await * Fix typo :) * Update collapsed-queue.ts --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
| * refactor/perf(backend): provide metadata statically (#14601)syuilo2024-09-221-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * wip * Update ReactionService.ts * Update ApiCallService.ts * Update timeline.ts * Update GlobalModule.ts * Update GlobalModule.ts * Update NoteEntityService.ts * wip * wip * wip * Update ApPersonService.ts * wip * Update GlobalModule.ts * Update mock-resolver.ts * Update RoleService.ts * Update activitypub.ts * Update activitypub.ts * Update activitypub.ts * Update activitypub.ts * Update activitypub.ts * clean up * Update utils.ts * Update UtilityService.ts * Revert "Update utils.ts" This reverts commit a27d4be764b78c1b5a9eac685e261fee49331d89. * Revert "Update UtilityService.ts" This reverts commit e5fd9e004c482cf099252201c0c1aa888e001430. * vuwa- * Revert "vuwa-" This reverts commit 0c3bd12472b4b9938cdff2d6f131e6800bc3724c. * Update entry.ts * Update entry.ts * Update entry.ts * Update entry.ts * Update jest.setup.ts
| * revert 5f88d56d96syuilo2024-07-201-74/+56
| | | | | | | | バグがある(かつすぐに修正できそうにない) & まだレビュー途中で意図せずマージされたため
| * perf(federation): Ed25519署名に対応する (#13464)tamaina2024-07-181-56/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 1. ed25519キーペアを発行・Personとして公開鍵を送受信 * validate additionalPublicKeys * getAuthUserFromApIdはmainを選ぶ * :v: * fix * signatureAlgorithm * set publicKeyCache lifetime * refresh * httpMessageSignatureAcceptable * ED25519_SIGNED_ALGORITHM * ED25519_PUBLIC_KEY_SIGNATURE_ALGORITHM * remove sign additionalPublicKeys signature requirements * httpMessageSignaturesSupported * httpMessageSignaturesImplementationLevel * httpMessageSignaturesImplementationLevel: '01' * perf(federation): Use hint for getAuthUserFromApId (#13470) * Hint for getAuthUserFromApId * とどのつまりこれでいいのか? * use @misskey-dev/node-http-message-signatures * fix * signedPost, signedGet * ap-request.tsを復活させる * remove digest prerender * fix test? * fix test * add httpMessageSignaturesImplementationLevel to FederationInstance * ManyToOne * fetchPersonWithRenewal * exactKey * :v: * use const * use gen-key-pair fn. from '@misskey-dev/node-http-message-signatures' * update node-http-message-signatures * fix * @misskey-dev/node-http-message-signatures@0.0.0-alpha.11 * getAuthUserFromApIdでupdatePersonの頻度を増やす * cacheRaw.date * use requiredInputs https://github.com/misskey-dev/misskey/pull/13464#discussion_r1509964359 * update @misskey-dev/node-http-message-signatures * clean up * err msg * fix(backend): fetchInstanceMetadataのLockが永遠に解除されない問題を修正 Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com> * fix httpMessageSignaturesImplementationLevel validation * fix test * fix * comment * comment * improve test * fix * use Promise.all in genRSAAndEd25519KeyPair * refreshAndprepareEd25519KeyPair * refreshAndfindKey * commetn * refactor public keys add * digestプリレンダを復活させる RFC実装時にどうするか考える * fix, async * fix * !== true * use save * Deliver update person when new key generated (not tested) https://github.com/misskey-dev/misskey/pull/13464#issuecomment-1977049061 * 循環参照で落ちるのを解消? * fix? * Revert "fix?" This reverts commit 0082f6f8e8c5d5febd14933ba9a1ac643f70ca92. * a * logger * log * change logger * 秘密鍵の変更は、フラグではなく鍵を引き回すようにする * addAllKnowingSharedInboxRecipe * nanka meccha kaeta * delivre * キャッシュ有効チェックはロック取得前に行う * @misskey-dev/node-http-message-signatures@0.0.3 * PrivateKeyPem * getLocalUserPrivateKey * fix test * if * fix ap-request * update node-http-message-signatures * fix type error * update package * fix type * update package * retry no key * @misskey-dev/node-http-message-signatures@0.0.8 * fix type error * log keyid * logger * db-resolver * JSON.stringify * HTTP Signatureがなかったり使えなかったりしそうな場合にLD Signatureを活用するように * inbox-delayed use actor if no signature * ユーザーとキーの同一性チェックはhostの一致にする * log signature parse err * save array * とりあえずtryで囲っておく * fetchPersonWithRenewalでエラーが起きたら古いデータを返す * use transactionalEntityManager * fix spdx * @misskey-dev/node-http-message-signatures@0.0.10 * add comment * fix * publicKeyに配列が入ってもいいようにする https://github.com/misskey-dev/misskey/pull/13950 * define additionalPublicKeys * fix * merge fix * refreshAndprepareEd25519KeyPair → refreshAndPrepareEd25519KeyPair * remove gen-key-pair.ts * defaultMaxListeners = 512 * Revert "defaultMaxListeners = 512" This reverts commit f2c412c18057a9300540794ccbe4dfbf6d259ed6. * genRSAAndEd25519KeyPairではキーを直列に生成する? * maxConcurrency: 8 * maxConcurrency: 16 * maxConcurrency: 8 * Revert "genRSAAndEd25519KeyPairではキーを直列に生成する?" This reverts commit d0aada55c1ed5aa98f18731ec82f3ac5eb5a6c16. * maxWorkers: '90%' * Revert "maxWorkers: '90%'" This reverts commit 9e0a93f110456320d6485a871f014f7cdab29b33. * e2e/timelines.tsで個々のテストに対するtimeoutを削除, maxConcurrency: 32 * better error handling of this.userPublickeysRepository.delete * better comment * set result to keypairEntityCache * deliverJobConcurrency: 16, deliverJobPerSec: 1024, inboxJobConcurrency: 4 * inboxJobPerSec: 64 * delete request.headers['host']; * fix * // node-fetch will generate this for us. if we keep 'Host', it won't change with redirects! * move delete host * modify comment * modify comment * fix correct → collect * refreshAndfindKey → refreshAndFindKey * modify comment * modify attachLdSignature * getApId, InboxProcessorService * TODO * [skip ci] add CHANGELOG --------- Co-authored-by: MeiMei <30769358+mei23@users.noreply.github.com> Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
* | Merge remote-tracking branch 'misskey/release/2024.5.0' into futuredakkar2024-05-311-2/+13
|\|
| * fix(federation): InboxにきたCreate, AnnounceのobjectがBearcaps ↵tamaina2024-05-281-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | urlだった際はスキップするように (#13610) * fix(federation): AnnounceのobjectがLike出なかったらキューにためない Fix https://github.com/misskey-dev/misskey/issues/13552 * revert * better reason handlings * result * improve announce handling * skip bearcaps * also announce
| * feat: suspend instance improvements (#13861)anatawa122024-05-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat(backend): dead instance detection * feat(backend): suspend type detection * feat(frontend): show suspend reason on frontend * feat(backend): resume federation automatically if the server is automatically suspended * docs(changelog): 配信停止まわりの改善 * lint: fix lint errors * Update packages/frontend/src/pages/instance-info.vue * lint: fix lint error * chore: suspendedState => suspensionState --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
* | Merge remote-tracking branch 'misskey/release/2024.5.0' into ↵dakkar2024-05-111-13/+15
|\| | | | | | | future-2024-04-25-post
| * Merge pull request from GHSA-2vxv-pv3m-3wvjDaiki Mizukami2024-05-011-12/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | * fix: normalize incoming signed activities * Tweak style * Update CHANGELOG.md * Log compacted activity as well --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
| * enhance: 禁止ワードチェック強化 (#27)tamaina2024-03-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * enhance: 禁止ワードチェック強化 * リモートの禁止ワードチェックを添付ファイルとユーザーを登録する前に行うなど Resolve https://github.com/misskey-dev/misskey/issues/13374 * 禁止ワートの対象の見直し * performActivityで特定のエラーが出た際にDelayedに追加しないように * use IdentifiableError * NoteCreateService.checkProhibitedWords * https://github.com/misskey-dev/misskey-private/pull/27/files#r1507416135 * remove comment
* | Compact LD-signed activities against well-known contextdakkar2024-04-301-1/+13
| | | | | | | | | | | | | | | | | | | | | | This should defend against some spoofing attacks, see also https://nvd.nist.gov/vuln/detail/CVE-2022-24307 for Mastodon, https://iceshrimp.dev/iceshrimp/iceshrimp/commit/febb499fcb5fe3d56ca79025e4b5851464660c38 from Iceshrimp and https://firefish.dev/firefish/firefish/-/commit/e790d6be90dfd5dc6471b650a54520761bb9d745 for Firefish Thanks to @tesaguri@fedibird.com for reporting and providing the patch.