1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Implement auto tag on comments and videos

* Comments and videos can be automatically tagged using core rules or
   watched word lists
 * These tags can be used to automatically filter videos and comments
 * Introduce a new video comment policy where comments must be approved
   first
 * Comments may have to be approved if the user auto block them using
   core rules or watched word lists
 * Implement FEP-5624 to federate reply control policies
This commit is contained in:
Chocobozzz 2024-03-29 14:25:03 +01:00 committed by Chocobozzz
parent b3e39df59e
commit 29329d6c45
241 changed files with 8090 additions and 1399 deletions

View file

@ -18,6 +18,8 @@ import {
UserRegistrationStateType,
VideoChannelSyncState,
VideoChannelSyncStateType,
VideoCommentPolicy,
VideoCommentPolicyType,
VideoImportState,
VideoImportStateType,
VideoPlaylistPrivacy,
@ -134,6 +136,8 @@ const SORTABLE_COLUMNS = {
ACCOUNTS_BLOCKLIST: [ 'createdAt' ],
SERVERS_BLOCKLIST: [ 'createdAt' ],
WATCHED_WORDS_LISTS: [ 'createdAt', 'updatedAt', 'listName' ],
USER_NOTIFICATIONS: [ 'createdAt', 'read' ],
VIDEO_PLAYLISTS: [ 'name', 'displayName', 'createdAt', 'updatedAt' ],
@ -498,6 +502,11 @@ const CONSTRAINTS_FIELDS = {
},
VIDEO_CHAPTERS: {
TITLE: { min: 1, max: 100 } // Length
},
WATCHED_WORDS: {
LIST_NAME: { min: 1, max: 100 }, // Length
WORDS: { min: 1, max: 500 }, // Number of total words
WORD: { min: 1, max: 100 } // Length
}
}
@ -663,6 +672,12 @@ const USER_IMPORT_STATES: { [ id in UserImportStateType ]: string } = {
[UserImportState.ERRORED]: 'Failed'
}
const VIDEO_COMMENTS_POLICY: { [ id in VideoCommentPolicyType ]: string } = {
[VideoCommentPolicy.DISABLED]: 'Disabled',
[VideoCommentPolicy.ENABLED]: 'Enabled',
[VideoCommentPolicy.REQUIRES_APPROVAL]: 'Requires approval'
}
const MIMETYPES = {
AUDIO: {
MIMETYPE_EXT: {
@ -973,6 +988,10 @@ const LRU_CACHE = {
MAX_SIZE: 100_000,
TTL: parseDurationToMs('8 hours')
},
WATCHED_WORDS_REGEX: {
MAX_SIZE: 100,
TTL: parseDurationToMs('24 hours')
},
TRACKER_IPS: {
MAX_SIZE: 100_000
}
@ -1243,6 +1262,7 @@ export {
ACCEPT_HEADERS,
BCRYPT_SALT_SIZE,
TRACKER_RATE_LIMITS,
VIDEO_COMMENTS_POLICY,
FILES_CACHE,
LOG_FILENAME,
CONSTRAINTS_FIELDS,