mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 11:03:08 +02:00
configable
This commit is contained in:
parent
76def0032e
commit
60fd848182
3 changed files with 9 additions and 2 deletions
|
@ -186,6 +186,10 @@ id: "aid"
|
|||
# Sign to ActivityPub GET request (default: true)
|
||||
signToActivityPubGet: true
|
||||
|
||||
# Limit of notes to fetch from outbox with remote user first fetched (default: 5)
|
||||
# https://github.com/misskey-dev/misskey/pull/11130
|
||||
outboxNotesFetchLimit: 5
|
||||
|
||||
#allowedPrivateNetworks: [
|
||||
# '127.0.0.1/32'
|
||||
#]
|
||||
|
|
|
@ -96,6 +96,7 @@ export type Source = {
|
|||
videoThumbnailGenerator?: string;
|
||||
|
||||
signToActivityPubGet?: boolean;
|
||||
outboxNotesFetchLimit?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -638,6 +638,8 @@ export class ApPersonService implements OnModuleInit {
|
|||
* This only retrieves the first page for now.
|
||||
*/
|
||||
public async updateOutboxFirstPage(user: RemoteUser, outbox: IActor['outbox'], resolver: Resolver): Promise<void> {
|
||||
if (!this.config.outboxNotesFetchLimit) return;
|
||||
|
||||
// https://www.w3.org/TR/activitypub/#actor-objects
|
||||
// Outbox is a required property for all actors
|
||||
if (!outbox) {
|
||||
|
@ -655,8 +657,8 @@ export class ApPersonService implements OnModuleInit {
|
|||
await resolver.resolveOrderedCollectionPage(collection.first) :
|
||||
collection;
|
||||
|
||||
// Perform activity but only the first 20 ones with `type: Create`
|
||||
await this.apInboxService.performActivity(user, firstPage, { limit: 20, allow: ['Create'] });
|
||||
// Perform activity but only the first outboxNotesFetchLimit ones with `type: Create`
|
||||
await this.apInboxService.performActivity(user, firstPage, { limit: this.config.outboxNotesFetchLimit, allow: ['Create'] });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue