debug log

This commit is contained in:
tamaina 2025-07-06 22:57:49 +09:00
parent 48b3372520
commit 0933aba453
2 changed files with 6 additions and 3 deletions

View File

@ -234,6 +234,7 @@ export class InboxProcessorService implements OnApplicationShutdown {
// アクティビティを処理
try {
this.logger.debug('performing activity', { activityId: activity.id, actorUri: authUser.user.uri, actorId: authUser.user.id, activity });
const result = await this.apInboxService.performActivity(authUser.user, activity);
if (result && !result.startsWith('ok')) {
this.logger.warn(`inbox activity ignored (maybe): id=${activity.id} reason=${result}`);

View File

@ -115,6 +115,7 @@ export class ActivityPubServerService {
@bindThis
private async inbox(request: FastifyRequest, reply: FastifyReply) {
if (this.meta.federation === 'none') {
this.inboxLogger.debug('federation is disabled');
reply.code(403);
return;
}
@ -148,17 +149,18 @@ export class ActivityPubServerService {
delay: 300_000,
},
});
} catch (err) {
this.inboxLogger.warn('signature header parsing failed', { err });
this.inboxLogger.debug('signature header parsed', { signature, body: request.body });
} catch (err) {
if (typeof request.body === 'object' && 'signature' in request.body) {
// LD SignatureがあればOK
this.queueService.inbox(request.body as IActivity, null);
this.inboxLogger.debug('LD Signature found in request body', { err, body: request.body });
reply.code(202);
return;
}
this.inboxLogger.warn('signature header parsing failed and LD signature not found');
this.inboxLogger.warn('signature header parsing failed and LD signature not found', { err });
reply.code(401);
return;
}