X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Fconstants.ts;h=cf7cd3d74ee661c99269a6e92558e13c64922362;hb=990b6a0b0c4fbebc165e5cf7cec8fbc1cbaa6c66;hp=243d544eab47544ab7120c3f4893c39f85bd80bb;hpb=ce33919c24e7402d92d81f3cd8e545df52d98240;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 243d544ea..cf7cd3d74 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -273,6 +273,12 @@ const CONSTRAINTS_FIELDS = { VIDEO_IMPORTS: { URL: { min: 3, max: 2000 }, // Length TORRENT_NAME: { min: 3, max: 255 }, // Length + TORRENT_FILE: { + EXTNAME: [ '.torrent' ], + FILE_SIZE: { + max: 1024 * 200 // 200 KB + } + } }, VIDEOS: { NAME: { min: 3, max: 120 }, // Length @@ -417,6 +423,10 @@ const VIDEO_CAPTIONS_MIMETYPE_EXT = { 'application/x-subrip': '.srt' } +const TORRENT_MIMETYPE_EXT = { + 'application/x-bittorrent': '.torrent' +} + // --------------------------------------------------------------------------- const SERVER_ACTOR_NAME = 'peertube' @@ -596,6 +606,7 @@ export { FEEDS, JOB_TTL, NSFW_POLICY_TYPES, + TORRENT_MIMETYPE_EXT, STATIC_MAX_AGE, STATIC_PATHS, ACTIVITY_PUB,