enhance(server): add rate limits for some endpoints
This commit is contained in:
parent
51b8d4ae3e
commit
7df3ca7388
7 changed files with 35 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import ms from 'ms';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import type { ChannelsRepository, DriveFilesRepository } from '@/models/index.js';
|
||||
import type { Channel } from '@/models/entities/Channel.js';
|
||||
|
|
@ -14,6 +15,11 @@ export const meta = {
|
|||
|
||||
kind: 'write:channels',
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 10,
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue