aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts27
1 files changed, 15 insertions, 12 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index fd2308eb6..28d51068b 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -3,9 +3,9 @@ import { dirname, join } from 'path'
3import { JobType, VideoRateType, VideoState, VideosRedundancy } from '../../shared/models' 3import { JobType, VideoRateType, VideoState, VideosRedundancy } from '../../shared/models'
4import { ActivityPubActorType } from '../../shared/models/activitypub' 4import { ActivityPubActorType } from '../../shared/models/activitypub'
5import { FollowState } from '../../shared/models/actors' 5import { FollowState } from '../../shared/models/actors'
6import { VideoAbuseState, VideoImportState, VideoPrivacy } from '../../shared/models/videos' 6import { VideoAbuseState, VideoImportState, VideoPrivacy, VideoTranscodingFPS } from '../../shared/models/videos'
7// Do not use barrels, remain constants as independent as possible 7// Do not use barrels, remain constants as independent as possible
8import { buildPath, isTestInstance, parseDuration, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' 8import { buildPath, isTestInstance, parseDuration, parseBytes, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
9import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' 9import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
10import { invert } from 'lodash' 10import { invert } from 'lodash'
11import { CronRepeatOptions, EveryRepeatOptions } from 'bull' 11import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
@@ -16,7 +16,7 @@ let config: IConfig = require('config')
16 16
17// --------------------------------------------------------------------------- 17// ---------------------------------------------------------------------------
18 18
19const LAST_MIGRATION_VERSION = 275 19const LAST_MIGRATION_VERSION = 285
20 20
21// --------------------------------------------------------------------------- 21// ---------------------------------------------------------------------------
22 22
@@ -47,7 +47,10 @@ const SORTABLE_COLUMNS = {
47 VIDEOS: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'trending' ], 47 VIDEOS: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'trending' ],
48 48
49 VIDEOS_SEARCH: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'match' ], 49 VIDEOS_SEARCH: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'match' ],
50 VIDEO_CHANNELS_SEARCH: [ 'match', 'displayName', 'createdAt' ] 50 VIDEO_CHANNELS_SEARCH: [ 'match', 'displayName', 'createdAt' ],
51
52 ACCOUNTS_BLOCKLIST: [ 'createdAt' ],
53 SERVERS_BLOCKLIST: [ 'createdAt' ]
51} 54}
52 55
53const OAUTH_LIFETIME = { 56const OAUTH_LIFETIME = {
@@ -232,8 +235,8 @@ const CONFIG = {
232 } 235 }
233 }, 236 },
234 USER: { 237 USER: {
235 get VIDEO_QUOTA () { return config.get<number>('user.video_quota') }, 238 get VIDEO_QUOTA () { return parseBytes(config.get<number>('user.video_quota')) },
236 get VIDEO_QUOTA_DAILY () { return config.get<number>('user.video_quota_daily') } 239 get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) }
237 }, 240 },
238 TRANSCODING: { 241 TRANSCODING: {
239 get ENABLED () { return config.get<boolean>('transcoding.enabled') }, 242 get ENABLED () { return config.get<boolean>('transcoding.enabled') },
@@ -292,7 +295,7 @@ const CONFIG = {
292const CONSTRAINTS_FIELDS = { 295const CONSTRAINTS_FIELDS = {
293 USERS: { 296 USERS: {
294 NAME: { min: 3, max: 120 }, // Length 297 NAME: { min: 3, max: 120 }, // Length
295 DESCRIPTION: { min: 3, max: 250 }, // Length 298 DESCRIPTION: { min: 3, max: 1000 }, // Length
296 USERNAME: { min: 3, max: 20 }, // Length 299 USERNAME: { min: 3, max: 20 }, // Length
297 PASSWORD: { min: 6, max: 255 }, // Length 300 PASSWORD: { min: 6, max: 255 }, // Length
298 VIDEO_QUOTA: { min: -1 }, 301 VIDEO_QUOTA: { min: -1 },
@@ -308,8 +311,8 @@ const CONSTRAINTS_FIELDS = {
308 }, 311 },
309 VIDEO_CHANNELS: { 312 VIDEO_CHANNELS: {
310 NAME: { min: 3, max: 120 }, // Length 313 NAME: { min: 3, max: 120 }, // Length
311 DESCRIPTION: { min: 3, max: 500 }, // Length 314 DESCRIPTION: { min: 3, max: 1000 }, // Length
312 SUPPORT: { min: 3, max: 500 }, // Length 315 SUPPORT: { min: 3, max: 1000 }, // Length
313 URL: { min: 3, max: 2000 } // Length 316 URL: { min: 3, max: 2000 } // Length
314 }, 317 },
315 VIDEO_CAPTIONS: { 318 VIDEO_CAPTIONS: {
@@ -338,7 +341,7 @@ const CONSTRAINTS_FIELDS = {
338 LANGUAGE: { min: 1, max: 10 }, // Length 341 LANGUAGE: { min: 1, max: 10 }, // Length
339 TRUNCATED_DESCRIPTION: { min: 3, max: 250 }, // Length 342 TRUNCATED_DESCRIPTION: { min: 3, max: 250 }, // Length
340 DESCRIPTION: { min: 3, max: 10000 }, // Length 343 DESCRIPTION: { min: 3, max: 10000 }, // Length
341 SUPPORT: { min: 3, max: 500 }, // Length 344 SUPPORT: { min: 3, max: 1000 }, // Length
342 IMAGE: { 345 IMAGE: {
343 EXTNAME: [ '.jpg', '.jpeg' ], 346 EXTNAME: [ '.jpg', '.jpeg' ],
344 FILE_SIZE: { 347 FILE_SIZE: {
@@ -393,7 +396,7 @@ const RATES_LIMIT = {
393} 396}
394 397
395let VIDEO_VIEW_LIFETIME = 60000 * 60 // 1 hour 398let VIDEO_VIEW_LIFETIME = 60000 * 60 // 1 hour
396const VIDEO_TRANSCODING_FPS = { 399const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = {
397 MIN: 10, 400 MIN: 10,
398 AVERAGE: 30, 401 AVERAGE: 30,
399 MAX: 60, 402 MAX: 60,
@@ -421,7 +424,7 @@ const VIDEO_CATEGORIES = {
421 8: 'People', 424 8: 'People',
422 9: 'Comedy', 425 9: 'Comedy',
423 10: 'Entertainment', 426 10: 'Entertainment',
424 11: 'News', 427 11: 'News & Politics',
425 12: 'How To', 428 12: 'How To',
426 13: 'Education', 429 13: 'Education',
427 14: 'Activism', 430 14: 'Activism',